/* Base Styles */
:root {
  --primary-color: #c9a227;
  --primary-hover: #d4b033;
  --primary-dark: #a68520;
  --secondary-color: #2c3e50;
  --bg-dark: #1a1a2e;
  --bg-darker: #0f0f1a;
  --bg-card: #16213e;
  --text-light: #e8e8e8;
  --text-muted: #a0a0a0;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;

  /* Rarity colors */
  --common: #9d9d9d;
  --uncommon: #1eff00;
  --rare: #0070dd;
  --heroic: #a335ee;
  --epic: #ff8000;
  --legendary: #ff8000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top, rgba(201, 162, 39, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(44, 62, 80, 0.2) 0%, transparent 50%);
}

h1, h2, h3 {
  font-family: 'Cinzel', serif;
}

/* Header */
header {
  background: var(--bg-darker);
  border-bottom: 2px solid var(--primary-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  gap: 2rem;
}

.logo {
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo h1 {
  color: var(--primary-color);
  font-size: 1.5rem;
  letter-spacing: 1px;
  position: relative;
  z-index: 2;
}

.logo .guild-logo {
  position: absolute;
  height: 70px;
  width: auto;
  opacity: 0.25;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.logo:hover .guild-logo {
  opacity: 0.4;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.1);
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.user-menu {
  position: relative;
  cursor: pointer;
}

.user-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.user-details:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.user-name {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
}

.dropdown-arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.user-menu:hover .dropdown-arrow,
.user-dropdown.active ~ .user-details .dropdown-arrow {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  margin-top: 0.5rem;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.25rem 0;
}

.logout-item {
  color: var(--danger);
}

.logout-item:hover {
  background: rgba(231, 76, 60, 0.1);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
}

/* Main Content */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
  padding-bottom: 0.5rem;
}

/* ==================== DASHBOARD ==================== */

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 550px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Stat Card Base */
.stat-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-gold);
  opacity: 0.5;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

/* Card color accents */
.stat-card.bank-card::before { background: #ffd700; }
.stat-card.stockpile-card::before { background: #cd853f; }
.stat-card.requests-card::before { background: #e74c3c; }
.stat-card.members-card::before { background: #3498db; }

/* Stat Icon Wrapper */
.stat-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper svg {
  width: 26px;
  height: 26px;
}

.stat-icon-wrapper.bank {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05));
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #ffd700;
}

.stat-icon-wrapper.stockpile {
  background: linear-gradient(135deg, rgba(205, 133, 63, 0.2), rgba(205, 133, 63, 0.05));
  border: 1px solid rgba(205, 133, 63, 0.3);
  color: #cd853f;
}

.stat-icon-wrapper.requests {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(231, 76, 60, 0.05));
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.stat-icon-wrapper.members {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(52, 152, 219, 0.05));
  border: 1px solid rgba(52, 152, 219, 0.3);
  color: #3498db;
}

/* Stat Content */
.stat-content {
  flex: 1;
  min-width: 0;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card.bank-card .stat-value { color: #ffd700; }
.stat-card.stockpile-card .stat-value { color: #cd853f; }
.stat-card.requests-card .stat-value { color: #e74c3c; }
.stat-card.members-card .stat-value { color: #3498db; }

/* Stat Trend Indicator */
.stat-trend {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-trend svg {
  width: 16px;
  height: 16px;
}

.stat-trend.up {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.stat-trend.down {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

/* Dashboard Widgets Container */
.dashboard-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-widgets {
    grid-template-columns: 1fr;
  }
}

/* Widget Card Base */
.widget-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.widget-title svg {
  width: 20px;
  height: 20px;
  color: var(--accent-gold);
}

.widget-title h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 600;
}

/* Transactions Widget */
.transactions-widget .activity-list {
  padding: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
}

/* Activity List Items */
.activity-list {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  transition: background 0.2s ease;
  border-left: 3px solid transparent;
}

.activity-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.activity-item.deposit { border-left-color: #2ecc71; }
.activity-item.withdraw, .activity-item.expense { border-left-color: #e74c3c; }
.activity-item.income { border-left-color: #ffd700; }

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.85rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.activity-item.deposit .activity-icon { background: rgba(46, 204, 113, 0.15); }
.activity-item.withdraw .activity-icon, .activity-item.expense .activity-icon { background: rgba(231, 76, 60, 0.15); }
.activity-item.income .activity-icon { background: rgba(255, 215, 0, 0.15); }

.activity-type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 0.75rem;
  min-width: 60px;
}

.activity-item.deposit .activity-type { color: #2ecc71; }
.activity-item.withdraw .activity-type, .activity-item.expense .activity-type { color: #e74c3c; }
.activity-item.income .activity-type { color: #ffd700; }

.activity-details {
  flex: 1;
  min-width: 0;
  color: var(--text-light);
  font-size: 0.9rem;
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  margin-left: auto;
  padding-left: 1rem;
}

.activity-user {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Distribution Widget */
.distribution-widget .widget-header {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.distribution-tabs {
  display: flex;
  gap: 0.5rem;
}

.dist-tab {
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dist-tab:hover {
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.15);
}

.dist-tab.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

.view-all-link {
  color: var(--primary-color);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.view-all-link:hover {
  text-decoration: underline;
  color: var(--accent-gold);
}

.distribution-content {
  padding: 1.25rem 1.5rem;
  max-height: 350px;
  overflow-y: auto;
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dist-item .color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dist-item .dist-info {
  flex: 1;
}

.dist-item .dist-name {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.dist-item .dist-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.dist-item .dist-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dist-item .dist-percentage {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 40px;
  text-align: right;
}

/* Distribution Modal */
.distribution-modal-content {
  padding: 1rem 0;
}

.distribution-tabs.modal-tabs {
  margin-bottom: 1.5rem;
  justify-content: center;
}

.modal-dist-content {
  max-height: 500px;
  overflow-y: auto;
}

.dist-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dist-detail-category {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1rem;
}

.dist-detail-category h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  color: var(--text-light);
  font-size: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.dist-detail-category h4 .cat-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dist-detail-category h4 .cat-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.9rem;
  margin-left: auto;
}

.dist-members-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.dist-member-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
}

.dist-member-item img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.dist-member-item .member-name {
  color: var(--text-light);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item.deposit {
  border-left: 3px solid var(--success);
}

.activity-item.withdraw {
  border-left: 3px solid var(--danger);
}

.activity-item.income {
  border-left: 3px solid #ffd700;
}

.activity-item.expense {
  border-left: 3px solid #ff6b6b;
}

.activity-type {
  font-weight: 600;
  margin-right: 0.5rem;
}

.activity-type.deposit {
  color: var(--success);
}

.activity-type.withdraw {
  color: var(--danger);
}

.activity-type.income {
  color: #ffd700;
}

.activity-type.expense {
  color: #ff6b6b;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-btn {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(231, 76, 60, 0.15);
  color: var(--text-light);
  border-color: rgba(231, 76, 60, 0.3);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

/* ==================== GUILD STOCKPILE ==================== */
.stockpile-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Stockpile Stats */
.stockpile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 800px) {
  .stockpile-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .stockpile-stats {
    grid-template-columns: 1fr 1fr;
  }
}

.stockpile-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.stockpile-stat:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.stockpile-stat .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stockpile-stat .stat-icon svg {
  width: 26px;
  height: 26px;
}

.stockpile-stat .stat-icon.stones {
  background: linear-gradient(135deg, rgba(149, 165, 166, 0.2), rgba(127, 140, 141, 0.1));
  border: 1px solid rgba(149, 165, 166, 0.3);
  color: #bdc3c7;
}

.stockpile-stat .stat-icon.plants {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(39, 174, 96, 0.1));
  border: 1px solid rgba(46, 204, 113, 0.3);
  color: #2ecc71;
}

.stockpile-stat .stat-icon.woods {
  background: linear-gradient(135deg, rgba(160, 106, 69, 0.2), rgba(139, 90, 43, 0.1));
  border: 1px solid rgba(160, 106, 69, 0.3);
  color: #cd853f;
}

.stockpile-stat .stat-icon.total {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.1));
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--accent-gold);
}

.stockpile-stat .stat-info {
  display: flex;
  flex-direction: column;
}

.stockpile-stat .stat-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.2;
}

.stockpile-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stockpile-stat.total .stat-count {
  color: var(--accent-gold);
}

/* Stockpile Grid */
.stockpile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

/* Item Card */
.item-card {
  background: linear-gradient(145deg, rgba(25, 30, 40, 0.95), rgba(18, 22, 30, 0.98));
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--common);
  opacity: 0.8;
}

.item-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Rarity border colors */
.item-card.common::before { background: var(--common); }
.item-card.uncommon::before { background: var(--uncommon); }
.item-card.rare::before { background: var(--rare); }
.item-card.heroic::before { background: var(--heroic); }
.item-card.epic::before { background: var(--epic); }
.item-card.legendary::before { background: linear-gradient(90deg, #ff8000, #ffd700, #ff8000); background-size: 200% 100%; animation: shimmer 2s linear infinite; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.item-card-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.item-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.item-icon.stones {
  background: linear-gradient(135deg, rgba(149, 165, 166, 0.15), rgba(127, 140, 141, 0.08));
  border: 1px solid rgba(149, 165, 166, 0.2);
}

.item-icon.plants {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.08));
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.item-icon.woods {
  background: linear-gradient(135deg, rgba(160, 106, 69, 0.15), rgba(139, 90, 43, 0.08));
  border: 1px solid rgba(160, 106, 69, 0.2);
}

/* Real item icons from AshesCodex */
.item-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.item-icon-wrapper.stones {
  background: linear-gradient(135deg, rgba(149, 165, 166, 0.15), rgba(127, 140, 141, 0.08));
  border: 1px solid rgba(149, 165, 166, 0.2);
}

.item-icon-wrapper.plants {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.08));
  border: 1px solid rgba(46, 204, 113, 0.2);
}

.item-icon-wrapper.woods {
  background: linear-gradient(135deg, rgba(160, 106, 69, 0.15), rgba(139, 90, 43, 0.08));
  border: 1px solid rgba(160, 106, 69, 0.2);
}

.item-real-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.item-icon-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.item-details {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-rarity {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-rarity.common { background: rgba(178, 178, 178, 0.2); color: #b2b2b2; border: 1px solid rgba(178, 178, 178, 0.3); }
.item-rarity.uncommon { background: rgba(30, 255, 0, 0.15); color: #1eff00; border: 1px solid rgba(30, 255, 0, 0.3); }
.item-rarity.rare { background: rgba(0, 112, 221, 0.2); color: #0070dd; border: 1px solid rgba(0, 112, 221, 0.3); }
.item-rarity.heroic { background: rgba(163, 53, 238, 0.2); color: #a335ee; border: 1px solid rgba(163, 53, 238, 0.3); }
.item-rarity.epic { background: rgba(255, 128, 0, 0.2); color: #ff8000; border: 1px solid rgba(255, 128, 0, 0.3); }
.item-rarity.legendary { background: linear-gradient(45deg, rgba(255, 128, 0, 0.2), rgba(255, 215, 0, 0.2)); color: #ffd700; border: 1px solid rgba(255, 215, 0, 0.4); }

.item-quantity {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.item-quantity::before {
  content: '×';
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Quantity colors based on amount */
.item-card.low-stock .item-quantity { color: #e74c3c; }
.item-card.medium-stock .item-quantity { color: #f39c12; }
.item-card.high-stock .item-quantity { color: #2ecc71; }

/* Empty state */
.stockpile-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.stockpile-empty svg {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.stockpile-empty p {
  font-size: 1.1rem;
}

/* ==================== GUILD BANK ==================== */
.bank-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .bank-container {
    grid-template-columns: 1fr;
  }
}

/* Treasury Display */
.treasury-display {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  border: 1px solid rgba(201, 162, 39, 0.3);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.treasury-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.treasury-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.treasury-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.2), rgba(201, 162, 39, 0.05));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.treasury-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent-gold);
}

.treasury-title {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.treasury-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.treasury-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* Currency Grid */
.currency-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .currency-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.currency-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.currency-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.1);
}

.currency-card.gold:hover { border-color: rgba(255, 215, 0, 0.3); }
.currency-card.silver:hover { border-color: rgba(192, 192, 192, 0.3); }
.currency-card.copper:hover { border-color: rgba(184, 115, 51, 0.3); }

/* Coin Styles */
.coin-wrapper {
  position: relative;
  width: 70px;
  height: 70px;
}

.coin {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  animation: float 3s ease-in-out infinite;
}

.coin-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  font-family: 'Cinzel', serif;
}

/* Gold Coin */
.gold-coin {
  background: linear-gradient(145deg, #ffd700, #b8860b);
  box-shadow:
    0 4px 15px rgba(255, 215, 0, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.gold-coin .coin-inner {
  background: linear-gradient(145deg, #ffec80, #daa520);
  color: #8b6914;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.gold-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse 2s ease-in-out infinite;
}

/* Silver Coin */
.silver-coin {
  background: linear-gradient(145deg, #e8e8e8, #a0a0a0);
  box-shadow:
    0 4px 15px rgba(192, 192, 192, 0.4),
    inset 0 2px 4px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2);
}

.silver-coin .coin-inner {
  background: linear-gradient(145deg, #f5f5f5, #c0c0c0);
  color: #606060;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.5);
}

.silver-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(192, 192, 192, 0.25) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse 2s ease-in-out infinite 0.5s;
}

/* Copper Coin */
.copper-coin {
  background: linear-gradient(145deg, #cd7f32, #8b4513);
  box-shadow:
    0 4px 15px rgba(184, 115, 51, 0.4),
    inset 0 2px 4px rgba(255, 200, 150, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
}

.copper-coin .coin-inner {
  background: linear-gradient(145deg, #daa06d, #b87333);
  color: #5c3317;
  text-shadow: 0 1px 1px rgba(255, 200, 150, 0.4);
  box-shadow: inset 0 2px 4px rgba(255, 200, 150, 0.2);
}

.copper-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(184, 115, 51, 0.25) 0%, transparent 70%);
  pointer-events: none;
  animation: pulse 2s ease-in-out infinite 1s;
}

/* Currency Info */
.currency-info {
  text-align: center;
}

.currency-card .currency-value {
  font-size: 2rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.currency-card.gold .currency-value { color: #ffd700; text-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
.currency-card.silver .currency-value { color: #e0e0e0; text-shadow: 0 0 10px rgba(192, 192, 192, 0.3); }
.currency-card.copper .currency-value { color: #cd7f32; text-shadow: 0 0 10px rgba(184, 115, 51, 0.3); }

.currency-card .currency-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* Recent Transactions */
.bank-transactions {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.transactions-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.transactions-header h4 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.transactions-list {
  padding: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
}

.no-transactions {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

.transaction-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.transaction-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.transaction-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.transaction-icon.deposit {
  background: rgba(46, 204, 113, 0.15);
  color: #2ecc71;
}

.transaction-icon.withdraw {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.transaction-details {
  flex: 1;
  min-width: 0;
}

.transaction-user {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.transaction-amount {
  font-weight: 600;
  font-size: 0.85rem;
  text-align: right;
}

.transaction-amount.deposit { color: #2ecc71; }
.transaction-amount.withdraw { color: #e74c3c; }

/* Transactions scrollbar */
.transactions-list::-webkit-scrollbar {
  width: 4px;
}

.transactions-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.transactions-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

.transactions-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Requests List */
/* Request Stats Header */
.requests-stats-header {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.request-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.request-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.request-stat-icon svg {
  width: 24px;
  height: 24px;
}

.request-stat-icon.open {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.3), rgba(39, 174, 96, 0.1));
  color: var(--success);
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.request-stat-icon.claimed {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.3), rgba(243, 156, 18, 0.1));
  color: var(--warning);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.request-stat-icon.completed {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(52, 152, 219, 0.1));
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.request-stat-icon.total {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.3), rgba(231, 76, 60, 0.1));
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.request-stat-info {
  display: flex;
  flex-direction: column;
}

.request-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  color: var(--text-light);
}

.request-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (max-width: 768px) {
  .requests-stats-header {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .requests-stats-header {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1rem;
  }

  .request-stat {
    padding: 0.5rem;
    gap: 0.5rem;
  }

  .request-stat-icon {
    width: 36px;
    height: 36px;
  }

  .request-stat-icon svg {
    width: 18px;
    height: 18px;
  }

  .request-stat-value {
    font-size: 1.2rem;
  }
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.request-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.request-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--danger), #c0392b);
}

.request-card:hover {
  border-color: rgba(231, 76, 60, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.15);
}

.request-id {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 50px;
  text-align: center;
  box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.request-info h4 {
  margin-bottom: 0.5rem;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.request-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.request-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.request-info .request-desc {
  color: var(--text-light);
  font-style: italic;
}

.request-info .request-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rarity-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.rarity-badge.common { background: rgba(157, 157, 157, 0.2); color: #9d9d9d; border: 1px solid rgba(157, 157, 157, 0.4); }
.rarity-badge.uncommon { background: rgba(30, 255, 0, 0.15); color: #1eff00; border: 1px solid rgba(30, 255, 0, 0.4); }
.rarity-badge.rare { background: rgba(0, 112, 221, 0.2); color: #0070dd; border: 1px solid rgba(0, 112, 221, 0.4); }
.rarity-badge.heroic { background: rgba(163, 53, 238, 0.2); color: #a335ee; border: 1px solid rgba(163, 53, 238, 0.4); }
.rarity-badge.epic { background: rgba(255, 128, 0, 0.2); color: #ff8000; border: 1px solid rgba(255, 128, 0, 0.4); }
.rarity-badge.legendary { background: rgba(230, 204, 128, 0.2); color: #e6cc80; border: 1px solid rgba(230, 204, 128, 0.4); }

.request-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.request-status {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.request-status.open {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success);
  border: 1px solid rgba(39, 174, 96, 0.4);
}
.request-status.claimed {
  background: rgba(243, 156, 18, 0.2);
  color: var(--warning);
  border: 1px solid rgba(243, 156, 18, 0.4);
}
.request-status.completed {
  background: rgba(52, 152, 219, 0.2);
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.4);
}

.request-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.request-actions button {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-claim {
  background: linear-gradient(135deg, var(--success), #219653);
  color: #fff;
  box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

.btn-claim:hover {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.btn-complete {
  background: linear-gradient(135deg, var(--info), #2980b9);
  color: #fff;
  box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.btn-complete:hover {
  background: linear-gradient(135deg, #5dade2, #3498db);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.btn-unclaim {
  background: linear-gradient(135deg, var(--warning), #d68910);
  color: #000;
  box-shadow: 0 3px 10px rgba(243, 156, 18, 0.3);
}

.btn-unclaim:hover {
  background: linear-gradient(135deg, #f5b041, #f39c12);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(243, 156, 18, 0.4);
}

.btn-delete-small {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger) !important;
}

.btn-delete-small:hover {
  background: var(--danger);
  color: #fff;
  transform: translateY(-2px);
}

/* ==================== RECIPE LIBRARY ==================== */

.library-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.library-filters input {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: 0.875rem 1rem;
  padding-left: 2.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0a0a0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  background-size: 1.25rem;
}

.library-filters input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
  background-color: rgba(0, 0, 0, 0.4);
}

.library-filters input::placeholder {
  color: var(--text-muted);
}

.library-filters select {
  padding: 0.875rem 2.5rem 0.875rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  font-size: 0.9rem;
  cursor: pointer;
  min-width: 160px;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a0a0a0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
}

.library-filters select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.library-filters select:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background-color: rgba(0, 0, 0, 0.4);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Recipe Card */
.recipe-card {
  background: linear-gradient(145deg, rgba(25, 30, 40, 0.95), rgba(18, 22, 30, 0.98));
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.recipe-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #9b59b6, #3498db);
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.recipe-card::after {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 1.25rem;
  width: 32px;
  height: 32px;
  background: url('/images/Recipelogo.png') no-repeat center center;
  background-size: contain;
  opacity: 0.9;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.recipe-card:hover {
  border-color: rgba(155, 89, 182, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.recipe-card:hover::before {
  opacity: 1;
}

.recipe-card:hover::after {
  opacity: 1;
}

.recipe-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.recipe-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}

.recipe-card h4 {
  color: var(--text-light);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
  font-size: 1rem;
  font-weight: 600;
}

.recipe-card .recipe-meta {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.recipe-card .category-badge,
.recipe-card .profession-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: capitalize;
  font-weight: 500;
  letter-spacing: 0.3px;
}

.category-badge {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
  border: 1px solid rgba(52, 152, 219, 0.25);
}

.profession-badge {
  background: rgba(155, 89, 182, 0.15);
  color: #bb8fce;
  border: 1px solid rgba(155, 89, 182, 0.25);
}

.grade-badge {
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  text-transform: capitalize;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.grade-badge.grade-novice {
  background: rgba(149, 165, 166, 0.15);
  color: #bdc3c7;
  border: 1px solid rgba(149, 165, 166, 0.25);
}

.grade-badge.grade-adept {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
  border: 1px solid rgba(52, 152, 219, 0.25);
}

.grade-badge.grade-radiant {
  background: rgba(241, 196, 15, 0.2);
  color: #f4d03f;
  border: 1px solid rgba(241, 196, 15, 0.35);
}

/* Recipe Card Draggable States */
.recipe-card.draggable {
  cursor: grab;
}

.recipe-card.draggable:active {
  cursor: grabbing;
}

.recipe-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Trash Drop Zone */
.library-trash-zone {
  position: fixed;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 100px;
  background: linear-gradient(145deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 0.95));
  border: 3px dashed rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -5px 30px rgba(231, 76, 60, 0.4);
}

.library-trash-zone.visible {
  bottom: 30px;
}

.library-trash-zone.drag-over {
  transform: translateX(-50%) scale(1.1);
  background: linear-gradient(145deg, rgba(231, 76, 60, 1), rgba(192, 57, 43, 1));
  border-color: #fff;
  box-shadow: 0 0 40px rgba(231, 76, 60, 0.7);
}

.library-trash-zone .trash-icon {
  font-size: 2.5rem;
  transition: transform 0.2s ease;
}

.library-trash-zone.drag-over .trash-icon {
  transform: scale(1.2) rotate(-10deg);
  animation: shake 0.3s ease-in-out infinite;
}

@keyframes shake {
  0%, 100% { transform: scale(1.2) rotate(-10deg); }
  50% { transform: scale(1.2) rotate(10deg); }
}

.library-trash-zone span {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Delete Confirmation Modal */
.delete-confirm-modal {
  max-width: 400px;
  text-align: center;
  padding: 2rem !important;
}

.delete-confirm-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.delete-confirm-modal h3 {
  color: var(--danger);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.delete-confirm-modal p {
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.delete-confirm-modal .delete-warning {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.delete-confirm-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.delete-confirm-actions .btn-cancel {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.delete-confirm-actions .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-danger-confirm {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-danger-confirm:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-success-confirm {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #27ae60, #1e8449);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-success-confirm:hover {
  background: linear-gradient(135deg, #1e8449, #196f3d);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
}

.btn-success-confirm:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Complete goal modal - green title */
#complete-goal-modal .delete-confirm-modal h3 {
  color: var(--success, #27ae60);
}

.recipe-card .crafters-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.recipe-card .crafters-count strong {
  color: var(--accent-gold);
}

/* My Recipe indicator */
.recipe-card.my-recipe {
  border-color: rgba(46, 204, 113, 0.3);
}

.recipe-card.my-recipe::before {
  background: linear-gradient(90deg, #27ae60, #2ecc71) !important;
  opacity: 1 !important;
}

.my-recipe-badge {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(46, 204, 113, 0.9);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 5;
}

/* Recipe Detail Modal - Enhanced Design */
.recipe-detail-modal-content {
  padding: 0;
  max-width: 500px;
  overflow: hidden;
}

.recipe-detail-modal-content .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recipe-detail-header {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(155, 89, 182, 0.2) 100%);
  padding: 2rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recipe-icon-wrapper {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-color), #9b59b6);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.recipe-icon {
  font-size: 2rem;
}

.recipe-title-section {
  flex: 1;
  min-width: 0;
}

.recipe-title-section h3 {
  margin: 0 0 0.75rem 0;
  font-size: 1.5rem;
  color: var(--text-light);
  font-family: 'Cinzel', serif;
  text-transform: capitalize;
  line-height: 1.2;
}

.recipe-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recipe-badges .badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  text-transform: capitalize;
  font-weight: 600;
}

.recipe-detail-body {
  padding: 1.5rem;
}

.recipe-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-icon {
  font-size: 1.5rem;
  opacity: 0.8;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Cinzel', serif;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-crafters-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-icon {
  font-size: 1.1rem;
  opacity: 0.7;
}

.crafters-list {
  max-height: 250px;
  overflow-y: auto;
}

.crafters-list::-webkit-scrollbar {
  width: 6px;
}

.crafters-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.crafters-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.crafter-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  transition: all 0.2s ease;
}

.crafter-item:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.crafter-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), #9b59b6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  font-size: 1rem;
  flex-shrink: 0;
}

.crafter-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.crafter-info {
  flex: 1;
  min-width: 0;
}

.crafter-name {
  color: var(--text-light);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.no-crafters {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Recipe Detail Actions */
.recipe-detail-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-leave-recipe {
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-leave-recipe::before {
  content: '\1F6AA';
}

.btn-leave-recipe:hover {
  background: linear-gradient(135deg, #d35400, #c0392b);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(211, 84, 0, 0.4);
}

/* Add Recipe Modal - Enhanced Design */
.add-recipe-modal-content {
  padding: 0;
  max-width: 480px;
  overflow: hidden;
}

.add-recipe-modal-content .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-recipe-header {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.2) 0%, rgba(52, 152, 219, 0.2) 100%);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.add-recipe-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #27ae60, #3498db);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.add-recipe-title-section h3 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--text-light);
  font-family: 'Cinzel', serif;
}

.add-recipe-subtitle {
  margin: 0.25rem 0 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.add-recipe-form {
  padding: 1.5rem;
}

.add-recipe-form .form-group {
  margin-bottom: 1.25rem;
}

.add-recipe-form label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-light);
}

.label-icon {
  font-size: 1rem;
  opacity: 0.8;
}

.add-recipe-form input,
.add-recipe-form select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.add-recipe-form select {
  cursor: pointer;
}

.add-recipe-form select option {
  background: var(--bg-card);
  color: var(--text-light);
  padding: 0.5rem;
}

.add-recipe-form input:focus,
.add-recipe-form select:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-darker);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

.add-recipe-form input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.add-recipe-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.add-recipe-actions .btn-cancel {
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-light);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.add-recipe-actions .btn-cancel:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-add-recipe-submit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  border: none;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-add-recipe-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

.btn-add-recipe-submit .btn-icon {
  font-size: 1.1rem;
}

/* Rosters Grid */
.rosters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.roster-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.roster-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.roster-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(201, 162, 39, 0.15);
  border-color: rgba(201, 162, 39, 0.3);
}

/* Type-specific top borders */
.roster-card[data-type="raid"]::before {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.roster-card[data-type="pvp"]::before {
  background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.roster-card[data-type="farming"]::before {
  background: linear-gradient(90deg, #27ae60, #219653);
}

.roster-card[data-type="dungeon"]::before {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.roster-card[data-type="event"]::before {
  background: linear-gradient(90deg, #f39c12, #d68910);
}

.roster-card[data-type="other"]::before {
  background: linear-gradient(90deg, #95a5a6, #7f8c8d);
}

.roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.roster-name {
  color: var(--text-light);
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
}

.roster-type {
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.roster-type.raid {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.roster-type.pvp {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.roster-type.farming {
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.roster-type.dungeon {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.roster-type.event {
  background: rgba(243, 156, 18, 0.2);
  color: #f39c12;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.roster-type.other {
  background: rgba(149, 165, 166, 0.2);
  color: #95a5a6;
  border: 1px solid rgba(149, 165, 166, 0.3);
}

.roster-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.roster-members {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.roster-members svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.roster-capacity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.capacity-bar {
  width: 60px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #2ecc71);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.capacity-fill.warning {
  background: linear-gradient(90deg, var(--warning), #f5b041);
}

.capacity-fill.full {
  background: linear-gradient(90deg, var(--danger), #e74c3c);
}

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  min-height: 32px;
}

.member-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.member-tag:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(201, 162, 39, 0.3);
}

.member-tag .member-role {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 0.1rem 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}

.roster-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.roster-actions button {
  flex: 1;
  padding: 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.roster-actions .btn-edit {
  background: rgba(52, 152, 219, 0.2);
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.roster-actions .btn-edit:hover {
  background: var(--info);
  color: #fff;
}

.roster-actions .btn-delete {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.roster-actions .btn-delete:hover {
  background: var(--danger);
  color: #fff;
}

.empty-roster-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}

/* Members Section */
.members-stats-header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
}

.member-stat {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.member-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.member-stat-icon svg {
  width: 24px;
  height: 24px;
}

.member-stat-icon.total {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.3), rgba(52, 152, 219, 0.1));
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.member-stat-icon.online {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.3), rgba(39, 174, 96, 0.1));
  color: var(--success);
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.member-stat-info {
  display: flex;
  flex-direction: column;
}

.member-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
  color: var(--text-light);
}

.member-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.member-stat.search-stat {
  justify-self: end;
}

.members-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
}

.members-search:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.1);
}

.members-search svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.members-search input {
  background: transparent;
  border: none;
  color: var(--text-light);
  padding: 0.5rem 0;
  font-size: 0.95rem;
  width: 250px;
  max-width: 100%;
}

.members-search input:focus {
  outline: none;
}

.members-search input::placeholder {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .members-stats-header {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .member-stat.search-stat {
    grid-column: span 2;
    justify-self: stretch;
  }

  .members-search {
    width: 100%;
  }

  .members-search input {
    width: 100%;
  }
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.member-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.member-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--info), #2980b9);
}

.member-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.15);
  border-color: rgba(52, 152, 219, 0.3);
}

.member-card.owner::before {
  background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
}

.member-card.owner:hover {
  box-shadow: 0 8px 25px rgba(201, 162, 39, 0.15);
  border-color: rgba(201, 162, 39, 0.3);
}

.member-avatar {
  position: relative;
  flex-shrink: 0;
}

.member-avatar img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: border-color 0.3s ease;
}

.member-card:hover .member-avatar img {
  border-color: rgba(52, 152, 219, 0.5);
}

.member-card.owner:hover .member-avatar img {
  border-color: rgba(201, 162, 39, 0.5);
}

.owner-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(201, 162, 39, 0.4);
}

.member-info {
  flex: 1;
  min-width: 0;
}

.member-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-username {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.member-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.role-tag {
  font-size: 0.65rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid;
  white-space: nowrap;
  font-weight: 500;
}

.role-tag.more-roles {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
}

.member-joined {
  text-align: right;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.joined-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.15rem;
}

.joined-date {
  font-size: 0.8rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Spreadsheet Section */
.spreadsheet-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.spreadsheet-tab {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.spreadsheet-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.spreadsheet-tab.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

/* Tab action buttons */
.tab-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.spreadsheet-tab:hover .tab-actions {
  opacity: 1;
}

.tab-edit,
.tab-delete {
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.tab-edit:hover {
  background: rgba(255, 255, 255, 0.2);
}

.tab-delete {
  font-size: 1rem;
  font-weight: bold;
}

.tab-delete:hover {
  background: rgba(231, 76, 60, 0.3);
  color: #e74c3c;
}

.spreadsheet-tab.active .tab-edit:hover {
  background: rgba(0, 0, 0, 0.2);
}

.spreadsheet-tab.active .tab-delete:hover {
  background: rgba(231, 76, 60, 0.5);
  color: #fff;
}

.spreadsheet-content {
  display: block;
}

.spreadsheet-content.hidden {
  display: none;
}

.spreadsheet-container {
  width: 100%;
  height: 70vh;
  min-height: 500px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-card);
}

.spreadsheet-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.spreadsheet-actions {
  margin-top: 1rem;
  text-align: center;
}

.btn-open-new {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-open-new:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Server Selector */
.server-selector-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.1) 0%, rgba(201, 162, 39, 0.05) 100%);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
}

.server-selector-container label {
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.server-selector {
  background: var(--bg-dark);
  border: 2px solid var(--primary-color);
  color: var(--text-color);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 220px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c9a227' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  transition: all 0.3s ease;
}

.server-selector:hover {
  background: rgba(201, 162, 39, 0.1);
  box-shadow: 0 0 15px rgba(201, 162, 39, 0.2);
}

.server-selector:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.3), 0 0 20px rgba(201, 162, 39, 0.2);
}

.server-selector option {
  background: var(--bg-dark);
  color: var(--text-color);
  padding: 0.75rem;
  font-weight: 500;
}

.server-selector option:checked {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.btn-create {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-create:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Stockpile Actions */
.stockpile-actions,
.bank-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-deposit {
  padding: 0.6rem 1.2rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-deposit:hover {
  background: #219a52;
  transform: translateY(-2px);
}

.btn-withdraw {
  padding: 0.6rem 1.2rem;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-withdraw:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* Modal */
.modal,
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active,
.modal-overlay[style*="display: flex"] {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content-wide {
  max-width: 650px;
}

/* Stockpile Multi-Item Modal */
.stockpile-modal-content {
  max-width: 600px;
}

.multi-items-container {
  max-height: 350px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.multi-items-container::-webkit-scrollbar {
  width: 6px;
}

.multi-items-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.multi-items-container::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.stock-item-entry {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  position: relative;
}

.stock-item-entry:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.stock-item-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.stock-item-header input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.stock-item-header input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.btn-remove-item {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: #e74c3c;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-remove-item:hover {
  background: rgba(231, 76, 60, 0.4);
}

.rarity-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.rarity-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rarity-input-group label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rarity-input-group label.rarity-common { color: #95a5a6; }
.rarity-input-group label.rarity-uncommon { color: #27ae60; }
.rarity-input-group label.rarity-rare { color: #3498db; }
.rarity-input-group label.rarity-heroic { color: #9b59b6; }
.rarity-input-group label.rarity-epic { color: #f39c12; }
.rarity-input-group label.rarity-legendary { color: #e74c3c; }

.rarity-input-group input {
  padding: 0.4rem 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 0.85rem;
  text-align: center;
  width: 100%;
}

.rarity-input-group input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.btn-add-item {
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.2), rgba(39, 174, 96, 0.1));
  border: 1px dashed rgba(39, 174, 96, 0.5);
  border-radius: 8px;
  color: #27ae60;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-item:hover {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.3), rgba(39, 174, 96, 0.2));
  border-color: #27ae60;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-light);
}

/* Form Styles */
.form-group {
  padding: 0 1.5rem;
  margin-bottom: 1rem;
}

.form-group:first-of-type {
  margin-top: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Multi-select styling */
.form-group select.multi-select {
  min-height: 120px;
  padding: 0.5rem;
}

.form-group select.multi-select option {
  padding: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group select.multi-select option:checked {
  background: linear-gradient(0deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--bg-darker);
}

.form-group select.multi-select optgroup {
  font-weight: bold;
  color: var(--primary-color);
  padding: 0.5rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
}

.btn-cancel {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.btn-submit {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

/* Roster Card Actions */
.roster-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.roster-actions button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-edit {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.btn-edit:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Roster Member Management in Modal */
.roster-members-list {
  max-height: 200px;
  overflow-y: auto;
  background: linear-gradient(145deg, rgba(15, 15, 25, 0.9), rgba(10, 10, 18, 0.95));
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.roster-member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.roster-member-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.roster-member-item:last-child {
  border-bottom: none;
}

.roster-member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.roster-member-name {
  font-weight: 500;
  color: var(--text-light);
}

.roster-member-role {
  font-size: 0.75rem;
  color: var(--primary-color);
  padding: 0.2rem 0.6rem;
  background: rgba(201, 162, 39, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 6px;
}

.btn-remove-member {
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
  color: var(--danger);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  line-height: 1;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-remove-member:hover {
  background: var(--danger);
  color: #fff;
}

.add-member-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem;
  background: linear-gradient(145deg, rgba(15, 15, 25, 0.9), rgba(10, 10, 18, 0.95));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.add-member-row select {
  flex: 2;
  padding: 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.add-member-row input {
  flex: 1;
  padding: 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.add-member-row select:focus,
.add-member-row input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.1);
}

.btn-add-member {
  padding: 0.7rem 1.2rem;
  background: linear-gradient(135deg, var(--success), #219653);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

.btn-add-member:hover {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

.empty-members {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* ==================== TOURNAMENT STYLES ==================== */

/* Tournament List */
/* Tournaments List */
.tournaments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.tournament-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tournament-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.tournament-card:hover {
  border-color: rgba(155, 89, 182, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(155, 89, 182, 0.15);
}

/* Status-specific top borders */
.tournament-card.active::before {
  background: linear-gradient(90deg, var(--success), #219653);
}

.tournament-card.completed::before {
  background: linear-gradient(90deg, var(--info), #2980b9);
}

.tournament-card.registration::before {
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.tournament-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.tournament-card-header h3 {
  color: var(--text-light);
  font-size: 1.1rem;
  font-family: 'Cinzel', serif;
}

.tournament-type-badge {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.tournament-card-info {
  margin-bottom: 1rem;
}

.tournament-card-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tournament-card-info p::before {
  content: '';
  width: 4px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 50%;
  opacity: 0.5;
}

.tournament-winner {
  color: var(--primary-color) !important;
  font-weight: 600;
}

.tournament-winner::before {
  background: var(--primary-color) !important;
  opacity: 1 !important;
}

.tournament-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tournament-status-badge {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tournament-status-badge.active,
.tournament-status.active {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success);
  border: 1px solid rgba(39, 174, 96, 0.3);
}

.tournament-status-badge.completed,
.tournament-status.completed {
  background: rgba(52, 152, 219, 0.2);
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.tournament-status-badge.registration {
  background: rgba(201, 162, 39, 0.2);
  color: var(--primary-color);
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.tournament-status-badge.draft {
  background: rgba(149, 165, 166, 0.2);
  color: #95a5a6;
  border: 1px solid rgba(149, 165, 166, 0.3);
}

.registration-progress {
  color: var(--primary-color);
  font-weight: 500;
}

.tournament-participants {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

/* Tournament Bracket Container */
.tournament-bracket-container {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tournament-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tournament-header h3 {
  flex: 1;
  color: var(--text-light);
  font-size: 1.4rem;
  font-family: 'Cinzel', serif;
}

.btn-back {
  padding: 0.6rem 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-light);
}

.btn-rankings {
  padding: 0.6rem 1.2rem;
  background: rgba(201, 162, 39, 0.15);
  border: 1px solid rgba(201, 162, 39, 0.3);
  color: var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-rankings:hover {
  background: var(--primary-color);
  color: var(--bg-dark);
}

/* Tournament Registration Panel */
.tournament-registration-panel {
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.1), rgba(201, 162, 39, 0.05));
  border: 1px solid rgba(201, 162, 39, 0.25);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.registration-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.registration-status {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.registration-count {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
}

.registration-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.registration-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-apply {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-apply:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-withdraw {
  padding: 0.5rem 1rem;
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-withdraw:hover {
  background: rgba(231, 76, 60, 0.1);
}

.application-status {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.application-status.pending {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.application-status.accepted {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.application-status.rejected {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

/* Applicants Section (Admin) */
.applicants-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.applicants-section h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.applicants-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.applicant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.applicant-item.accepted {
  border-color: rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.1);
}

.applicant-item.rejected {
  border-color: rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.1);
  opacity: 0.6;
}

.applicant-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.applicant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.applicant-name {
  font-weight: 500;
  color: var(--text-light);
}

.applicant-status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.applicant-status-badge.pending {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.applicant-status-badge.accepted {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.applicant-status-badge.rejected {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.applicant-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-accept-applicant,
.btn-reject-applicant {
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-accept-applicant {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.btn-accept-applicant:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.4);
}

.btn-accept-applicant:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-reject-applicant {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.btn-reject-applicant:hover {
  background: rgba(231, 76, 60, 0.4);
}

.registration-admin-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-accept-all,
.btn-shuffle-start {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-accept-all {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.btn-accept-all:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.3);
}

.btn-accept-all:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-shuffle-start {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.btn-shuffle-start:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-shuffle-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Tournament status badge styles */
.tournament-status.registration {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

/* Bracket Display - Traditional Tournament Style */
.bracket-wrapper {
  overflow-x: auto;
  padding: 2rem 1rem;
}

.bracket {
  display: flex;
  gap: 4rem;
  min-width: fit-content;
  align-items: center;
  position: relative;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.round-title {
  text-align: center;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(201, 162, 39, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.round-matches {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-around;
  flex: 1;
}

/* Scale gaps based on round for pyramid effect */
.bracket-round:nth-child(2) .round-matches { gap: 4rem; }
.bracket-round:nth-child(3) .round-matches { gap: 9rem; }
.bracket-round:nth-child(4) .round-matches { gap: 18rem; }
.bracket-round:nth-child(5) .round-matches { gap: 36rem; }

.bracket-match {
  background: var(--bg-darker);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0;
  min-width: 200px;
  transition: all 0.3s ease;
  position: relative;
}

/* Connector lines */
.bracket-match::after {
  content: '';
  position: absolute;
  right: -2rem;
  top: 50%;
  width: 2rem;
  height: 2px;
  background: rgba(201, 162, 39, 0.4);
}

.bracket-round:last-child .bracket-match::after {
  display: none;
}

.bracket-match.clickable {
  cursor: pointer;
  border-color: var(--success);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.bracket-match.clickable:hover {
  border-color: var(--primary-color);
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(201, 162, 39, 0.3);
}

.bracket-match.completed {
  border-color: rgba(255, 255, 255, 0.1);
}

.match-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-slot:last-of-type {
  border-bottom: none;
}

.match-slot:first-of-type {
  border-radius: 6px 6px 0 0;
}

.match-slot:last-of-type:not(:first-of-type) {
  border-radius: 0 0 6px 6px;
}

.match-slot.winner {
  background: rgba(46, 204, 113, 0.15);
  border-left: 3px solid var(--success);
}

.match-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.match-player-name {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.match-tbd {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.match-vs-line {
  display: none;
}

/* Team Match Styles */
.bracket-match.team-match {
  min-width: 220px;
  border-color: rgba(155, 89, 182, 0.4);
}

.bracket-match.team-match .match-slot {
  padding: 0.6rem 0.75rem;
}

.bracket-match.team-match .match-tbd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9b59b6;
  padding: 0.5rem 0;
}

.bracket-match.team-match .match-tbd::before {
  content: '👥';
}

/* Team Compact View in Bracket */
.team-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.team-name {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.85rem;
  white-space: nowrap;
}

.team-avatars {
  display: flex;
  align-items: center;
}

.team-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-darker);
  margin-left: -8px;
}

.team-mini-avatar:first-child {
  margin-left: 0;
}

.team-more {
  background: rgba(155, 89, 182, 0.3);
  color: #9b59b6;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.25rem;
}

/* Team Player List (for modal) */
.team-player {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.65rem;
}

.team-player-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.team-player span {
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* VS Text */
.vs-text {
  background: var(--bg-darker);
  padding: 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Tournament Header Right */
.tournament-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tournament-type-badge {
  padding: 0.35rem 0.75rem;
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-edit-tournament,
.btn-delete-tournament {
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.btn-edit-tournament {
  color: #3498db;
}

.btn-edit-tournament:hover {
  opacity: 1;
  transform: scale(1.15);
}

.btn-delete-tournament {
  color: #e74c3c;
}

.btn-delete-tournament:hover {
  opacity: 1;
  transform: scale(1.15);
}

/* Winner Display */
.bracket-winner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.winner-trophy {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: trophy-bounce 1s ease-in-out infinite;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.winner-title {
  color: var(--primary-color);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.winner-name {
  color: var(--text-light);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Tournament Modal */
.modal-tournament {
  max-width: 600px;
}

.tournament-form-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(15, 18, 25, 0.5), transparent);
  border-radius: 12px;
  margin-bottom: 1rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tournament-participants-section {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.participants-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.participants-header label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 1rem;
}

.participants-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Next/Back step buttons */
.btn-next-step {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border: none;
  border-radius: 8px;
  color: var(--bg-darker);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-next-step:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.4);
}

.btn-next-step:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-back-step {
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-back-step:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

/* Positions Section */
.tournament-positions-section {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.positions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.positions-header label {
  font-weight: 600;
  color: var(--text-light);
  font-size: 1rem;
}

.positions-hint {
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.btn-shuffle-positions {
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.2), rgba(142, 68, 173, 0.3));
  border: 1px solid rgba(155, 89, 182, 0.4);
  border-radius: 6px;
  color: #9b59b6;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-shuffle-positions:hover {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.3), rgba(142, 68, 173, 0.4));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
}

/* Bracket Positions List */
.bracket-positions-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.bracket-position-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(145deg, rgba(30, 35, 45, 0.9), rgba(25, 30, 40, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: grab;
  transition: all 0.3s ease;
}

.bracket-position-item:hover {
  border-color: rgba(201, 162, 39, 0.3);
  background: linear-gradient(145deg, rgba(40, 45, 55, 0.9), rgba(35, 40, 50, 0.95));
}

.bracket-position-item.dragging {
  opacity: 0.5;
  border-color: var(--primary-color);
}

.bracket-position-item.drag-over {
  border-color: var(--primary-color);
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.1), rgba(30, 35, 45, 0.95));
}

.position-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-darker);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.position-player-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.position-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.position-name {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.position-drag-handle {
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: grab;
}

.participants-hint {
  margin: 0 0 1rem 0;
  font-size: 0.8rem;
  color: var(--primary-color);
  font-style: italic;
  opacity: 0.9;
}

.participants-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.3);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.participants-count span {
  color: var(--primary-color);
  font-weight: 600;
}

/* Participants Selector */
.participants-selector {
  max-height: 280px;
  overflow-y: auto;
  background: linear-gradient(145deg, rgba(10, 12, 18, 0.8), rgba(15, 18, 25, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.participants-selector::-webkit-scrollbar {
  width: 6px;
}

.participants-selector::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.participants-selector::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.participant-checkbox {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.8rem;
  background: linear-gradient(145deg, rgba(30, 35, 45, 0.9), rgba(25, 30, 40, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.participant-checkbox:hover {
  background: linear-gradient(145deg, rgba(40, 45, 55, 0.9), rgba(35, 40, 50, 0.95));
  border-color: rgba(201, 162, 39, 0.3);
  transform: translateY(-1px);
}

.participant-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.participant-checkbox input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-color: var(--primary-color);
}

.participant-checkbox input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg-darker);
  font-size: 12px;
  font-weight: 700;
}

.participant-checkbox:has(input:checked) {
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.15), rgba(30, 35, 45, 0.95));
  border-color: rgba(201, 162, 39, 0.4);
}

.participant-checkbox:has(input:checked) .participant-name {
  color: var(--primary-color);
  font-weight: 600;
}

.participant-name {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

.participant-checkbox.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.participant-checkbox.disabled:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.06);
}

/* Match Modal */
.modal-match {
  max-width: 700px;
}

.match-selection {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  align-items: stretch;
}

.match-option {
  flex: 1;
  background: var(--bg-darker);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.match-option:hover {
  border-color: var(--primary-color);
}

.match-option.selected {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.match-option-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}

.match-option-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 150px;
  overflow-y: auto;
}

.match-player-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.match-player-item img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.match-player-item span {
  color: var(--text-light);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-vs-divider {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.btn-select-winner {
  margin-top: auto;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 2px solid var(--success);
  color: var(--success);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-select-winner:hover {
  background: rgba(46, 204, 113, 0.2);
}

.match-option.selected .btn-select-winner {
  background: var(--success);
  color: #fff;
}

/* Winner highlight in modal */
.match-option.winner-highlight {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.15);
}

.match-option.winner-highlight .match-option-header::after {
  content: ' 🏆 Winner';
  color: var(--success);
  font-size: 0.8rem;
}

.empty-team {
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem;
}

/* ==================== END TOURNAMENT STYLES ==================== */

/* ==================== GOALS STYLES ==================== */

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.goal-card {
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.goal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #f1c40f, #e67e22);
  opacity: 0.8;
}

.goal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.12);
}

.goal-card.completed {
  opacity: 0.85;
}

.goal-card.completed::before {
  background: linear-gradient(180deg, #2ecc71, #27ae60);
}

/* Goal type colors */
.goal-card[data-type="gold"]::before { background: linear-gradient(180deg, #ffd700, #f39c12); }
.goal-card[data-type="item"]::before { background: linear-gradient(180deg, #3498db, #2980b9); }
.goal-card[data-type="custom"]::before { background: linear-gradient(180deg, #9b59b6, #8e44ad); }

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.goal-title-section {
  flex: 1;
}

.goal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.35rem;
}

.goal-status-icon {
  font-size: 1rem;
}

.goal-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.goal-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.goal-type-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.goal-type-badge.gold {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.goal-type-badge.item {
  background: rgba(52, 152, 219, 0.15);
  color: #5dade2;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.goal-type-badge.custom {
  background: rgba(155, 89, 182, 0.15);
  color: #bb8fce;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.goal-actions {
  display: flex;
  gap: 0.5rem;
}

.goal-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Progress Bar */
.goal-progress {
  margin-bottom: 0.75rem;
}

.progress-bar-container {
  width: 100%;
  height: 28px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #f1c40f, #e67e22);
  border-radius: 14px;
  transition: width 0.5s ease;
  min-width: 4px;
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.3);
}

.progress-bar-fill.completed {
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.3);
}

/* Progress fill by type */
.goal-card[data-type="gold"] .progress-bar-fill { background: linear-gradient(90deg, #ffd700, #f39c12); box-shadow: 0 0 15px rgba(255, 215, 0, 0.3); }
.goal-card[data-type="item"] .progress-bar-fill { background: linear-gradient(90deg, #3498db, #2980b9); box-shadow: 0 0 15px rgba(52, 152, 219, 0.3); }
.goal-card[data-type="custom"] .progress-bar-fill { background: linear-gradient(90deg, #9b59b6, #8e44ad); box-shadow: 0 0 15px rgba(155, 89, 182, 0.3); }

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-light);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
}

.progress-current {
  color: var(--accent-gold);
  font-weight: 600;
}

.goal-card[data-type="item"] .progress-current { color: #5dade2; }
.goal-card[data-type="custom"] .progress-current { color: #bb8fce; }

/* Goal Footer */
.goal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.goal-creator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Goal Action Buttons */
.btn-contribute {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), #d4a84b);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-contribute:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(201, 162, 39, 0.3);
}

.btn-complete-goal {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-complete-goal:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.btn-delete-goal {
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: #e74c3c;
  border: 1px solid rgba(231, 76, 60, 0.5);
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-goal:hover {
  background: rgba(231, 76, 60, 0.1);
  border-color: #e74c3c;
}

/* Celebration animation for completed goals */
.goal-card.just-completed {
  animation: celebrate 0.5s ease;
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ==================== END GOALS STYLES ==================== */

/* ==================== GLOBAL SEARCH STYLES ==================== */

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header h2 {
  margin: 0;
}

.global-search {
  position: relative;
  margin-left: 1rem;
}

.global-search input {
  width: 280px;
  padding: 0.6rem 1rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.global-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.global-search input::placeholder {
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.search-results.active {
  display: block;
}

.search-category {
  padding: 0.5rem 1rem;
  background: var(--bg-darker);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-item-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* ==================== END GLOBAL SEARCH STYLES ==================== */

/* ==================== AUDIT LOGS STYLES ==================== */

/* Activity Logs Filters */
.logs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.filter-group select,
.filter-group input[type="date"] {
  padding: 0.6rem 0.85rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.9rem;
  min-width: 150px;
  transition: all 0.3s ease;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.1);
}

.btn-apply-filters {
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(201, 162, 39, 0.3);
}

.btn-apply-filters:hover {
  background: linear-gradient(135deg, var(--primary-hover), var(--primary-color));
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(201, 162, 39, 0.4);
}

.btn-clear-filters {
  padding: 0.6rem 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-clear-filters:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-export {
  padding: 0.6rem 1.2rem;
  background: rgba(52, 152, 219, 0.15);
  color: var(--info);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-export:hover {
  background: var(--info);
  color: #fff;
  border-color: var(--info);
}

/* Logs List */
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.log-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--text-muted);
  transition: all 0.3s ease;
}

.log-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(3px);
}

/* Type-specific left borders */
.log-item.deposit::before { background: linear-gradient(180deg, #27ae60, #219653); }
.log-item.withdrawal::before { background: linear-gradient(180deg, #e74c3c, #c0392b); }
.log-item.income::before { background: linear-gradient(180deg, var(--primary-color), var(--primary-dark)); }
.log-item.expense::before { background: linear-gradient(180deg, #e74c3c, #c0392b); }
.log-item.request::before { background: linear-gradient(180deg, #3498db, #2980b9); }
.log-item.roster::before { background: linear-gradient(180deg, #9b59b6, #8e44ad); }
.log-item.goal::before { background: linear-gradient(180deg, #f39c12, #d68910); }

.log-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.log-icon.deposit {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.25), rgba(39, 174, 96, 0.1));
  border: 1px solid rgba(39, 174, 96, 0.3);
}
.log-icon.withdrawal {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), rgba(231, 76, 60, 0.1));
  border: 1px solid rgba(231, 76, 60, 0.3);
}
.log-icon.income {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.25), rgba(201, 162, 39, 0.1));
  border: 1px solid rgba(201, 162, 39, 0.3);
}
.log-icon.expense {
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.25), rgba(231, 76, 60, 0.1));
  border: 1px solid rgba(231, 76, 60, 0.3);
}
.log-icon.request {
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.25), rgba(52, 152, 219, 0.1));
  border: 1px solid rgba(52, 152, 219, 0.3);
}
.log-icon.roster {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.25), rgba(155, 89, 182, 0.1));
  border: 1px solid rgba(155, 89, 182, 0.3);
}
.log-icon.goal {
  background: linear-gradient(135deg, rgba(243, 156, 18, 0.25), rgba(243, 156, 18, 0.1));
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.log-content {
  flex: 1;
  min-width: 0;
}

.log-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.log-description {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-meta {
  text-align: right;
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.log-member {
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.log-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Logs Pagination */
.logs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-page {
  padding: 0.6rem 1.25rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.btn-page:hover:not(:disabled) {
  background: rgba(201, 162, 39, 0.2);
  border-color: rgba(201, 162, 39, 0.4);
  color: var(--primary-color);
}

.btn-page:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-page:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==================== END AUDIT LOGS STYLES ==================== */

/* ==================== PERMISSIONS STYLES ==================== */

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.permissions-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

/* Roles List */
.permissions-roles {
  background: linear-gradient(145deg, rgba(25, 30, 45, 0.95), rgba(15, 20, 30, 0.98));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  height: fit-content;
  position: relative;
  overflow: hidden;
}

.permissions-roles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.permissions-roles h3 {
  margin-bottom: 1.25rem;
  font-size: 1rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.permissions-roles h3::before {
  content: '🛡️';
  font-size: 1.1rem;
}

.roles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.roles-list::-webkit-scrollbar {
  width: 5px;
}

.roles-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.roles-list::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.3);
  border-radius: 3px;
}

.role-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
}

.role-item:hover {
  border-color: rgba(201, 162, 39, 0.3);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(201, 162, 39, 0.03));
  transform: translateX(4px);
}

.role-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
}

.role-level {
  font-size: 0.75rem;
  color: var(--bg-darker);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
}

/* Permissions Matrix */
.permissions-matrix {
  background: linear-gradient(145deg, rgba(25, 30, 45, 0.95), rgba(15, 20, 30, 0.98));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}

.permissions-matrix::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.permissions-matrix h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.permissions-matrix h3::before {
  content: '⚙️';
  font-size: 1.1rem;
}

.matrix-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: rgba(201, 162, 39, 0.08);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.matrix-scroll {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-scroll::-webkit-scrollbar {
  height: 8px;
}

.matrix-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.matrix-scroll::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.3);
  border-radius: 4px;
}

.permissions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.permissions-table th,
.permissions-table td {
  padding: 0.875rem 0.75rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.permissions-table th {
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.08));
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.permissions-table th:first-child {
  border-radius: 10px 0 0 0;
}

.permissions-table th:last-child {
  border-radius: 0 10px 0 0;
}

.permissions-table th.feature-col,
.permissions-table th.action-col {
  text-align: left;
}

.permissions-table th.role-col {
  min-width: 100px;
  position: relative;
}

.permissions-table th.role-col::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 2px;
  background: var(--primary-color);
  opacity: 0.5;
}

.feature-cell {
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.12), rgba(201, 162, 39, 0.05));
  vertical-align: middle;
  font-size: 0.9rem;
  border-left: 3px solid var(--primary-color);
}

.action-cell {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-left: 1.25rem;
}

.checkbox-cell {
  padding: 0.5rem;
  position: relative;
}

.checkbox-cell input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
  transition: transform 0.2s ease;
}

.checkbox-cell input[type="checkbox"]:hover {
  transform: scale(1.15);
}

.checkbox-cell input[type="checkbox"]:checked {
  animation: checkPop 0.3s ease;
}

@keyframes checkPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.checkbox-cell input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.checkbox-cell input[type="checkbox"]:disabled:hover {
  transform: none;
}

.permissions-table tbody tr {
  transition: all 0.2s ease;
}

.permissions-table tbody tr:hover {
  background: rgba(201, 162, 39, 0.05);
}

.permissions-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.01);
}

.permissions-table tbody tr:nth-child(even):hover {
  background: rgba(201, 162, 39, 0.05);
}

.no-permission {
  text-align: center;
  padding: 3rem;
  color: var(--danger);
  background: rgba(231, 76, 60, 0.1);
  border-radius: 10px;
  border: 1px dashed rgba(231, 76, 60, 0.3);
}

/* Responsive permissions */
@media (max-width: 1024px) {
  .permissions-container {
    grid-template-columns: 1fr;
  }

  .permissions-roles {
    order: 2;
  }

  .permissions-matrix {
    order: 1;
  }
}

@media (max-width: 600px) {
  .permissions-matrix,
  .permissions-roles {
    padding: 1rem;
  }

  .permissions-table th,
  .permissions-table td {
    padding: 0.5rem 0.35rem;
    font-size: 0.8rem;
  }

  .permissions-table {
    min-width: 600px;
  }
}

/* Save Permissions Button */
.btn-save-permissions {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, var(--success), #229954);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-left: auto;
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.25);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-save-permissions::before {
  content: '💾';
  font-size: 1rem;
}

.btn-save-permissions:hover {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 204, 113, 0.35);
}

.btn-save-permissions:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(46, 204, 113, 0.25);
}

.btn-save-permissions:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==================== END PERMISSIONS STYLES ==================== */

/* ==================== BOT SETTINGS STYLES ==================== */

.bot-settings-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.bot-settings-card {
  background: linear-gradient(145deg, rgba(25, 30, 45, 0.95), rgba(15, 20, 30, 0.98));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.bot-settings-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bot-settings-card:hover {
  border-color: rgba(201, 162, 39, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.bot-settings-card:hover::before {
  opacity: 1;
}

.bot-settings-card h3 {
  color: var(--text-light);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.bot-settings-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.bot-features-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bot-feature-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bot-feature-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bot-feature-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 68, 173, 0.2);
  border-radius: 8px;
}

.bot-feature-details h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text);
  font-size: 1rem;
}

.bot-feature-details p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bot-feature-toggle {
  position: relative;
  width: 50px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.bot-feature-toggle.active {
  background: var(--success);
}

.bot-feature-toggle::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.bot-feature-toggle.active::after {
  transform: translateX(24px);
}

.bot-feature-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-configure {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-configure:hover {
  background: var(--secondary);
}

/* Bot Settings Cards Layout */
.bot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.bot-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-card-icon {
  font-size: 1.4rem;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.15), rgba(201, 162, 39, 0.05));
  border-radius: 10px;
  border: 1px solid rgba(201, 162, 39, 0.2);
}

.bot-card-title h3 {
  margin: 0;
  color: var(--text-light);
  font-size: 1rem;
  font-weight: 600;
}

.bot-settings-card-disabled {
  opacity: 0.6;
  pointer-events: none;
  position: relative;
}

.bot-settings-card-disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    rgba(0, 0, 0, 0.03) 10px,
    rgba(0, 0, 0, 0.03) 20px
  );
  border-radius: 16px;
  pointer-events: none;
}

.bot-settings-card-disabled:hover {
  transform: none;
  box-shadow: none;
}

.coming-soon-badge {
  background: linear-gradient(135deg, rgba(155, 89, 182, 0.25), rgba(142, 68, 173, 0.15));
  color: #b47cff;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid rgba(155, 89, 182, 0.4);
  box-shadow: 0 2px 10px rgba(155, 89, 182, 0.2);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Bot Settings Buttons */
.btn-add-reaction-role,
.btn-purge-channel,
.btn-add-auto-purge,
.btn-add-relay {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-darker);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-add-reaction-role:hover,
.btn-purge-channel:hover,
.btn-add-auto-purge:hover,
.btn-add-relay:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}

/* Role Visibility Styles */
.btn-edit-role-visibility {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-edit-role-visibility:hover {
  background: var(--primary-light);
}

.role-visibility-summary {
  color: #888;
  font-size: 0.9rem;
  margin: 0.5rem 0 0 0;
}

.modal-description {
  color: #aaa;
  margin-bottom: 1rem;
}

.role-visibility-search {
  margin-bottom: 1rem;
}

.role-visibility-search input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.role-visibility-search input:focus {
  outline: none;
  border-color: var(--primary);
}

.role-visibility-search input::placeholder {
  color: var(--text-muted);
}

.role-visibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.role-visibility-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-visibility-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.role-visibility-item.hidden-role {
  opacity: 0.5;
}

.role-visibility-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--success);
}

.role-visibility-tag {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-visibility-status {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.role-visibility-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Server Stats Styles */
.server-stats-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #444;
  transition: 0.3s;
  border-radius: 26px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--success);
}

input:checked + .toggle-slider:before {
  transform: translateX(24px);
}

#server-stats-status {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.server-stats-config {
  margin-top: 1rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.2));
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stats-category-name {
  margin-bottom: 1.25rem;
}

.stats-category-name label {
  display: block;
  font-size: 0.8rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-category-name input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.stats-category-name input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
  outline: none;
}

.stats-channels-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stat-channel-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.stat-channel-item:hover {
  border-color: rgba(201, 162, 39, 0.2);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.stat-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 120px;
  cursor: pointer;
}

.stat-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--success);
  cursor: pointer;
}

.stat-checkbox span {
  font-size: 0.9rem;
}

.stat-channel-item input[type="text"] {
  flex: 1;
  padding: 0.6rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.stat-channel-item input[type="text"]:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.1);
}

.stats-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-save-stats {
  padding: 0.625rem 1.5rem;
  background: linear-gradient(135deg, var(--success), #229954);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-save-stats:hover {
  background: linear-gradient(135deg, #27ae60, #1e8449);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

.btn-delete-stats {
  padding: 0.625rem 1.5rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-stats:hover {
  background: var(--danger);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-add-reaction-role {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-add-reaction-role:hover {
  background: var(--primary-light);
}

/* Channel Purge Button */
.btn-purge-channel {
  padding: 0.5rem 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-purge-channel:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

/* Time Input Group */
.time-input-group {
  display: flex;
  gap: 0.5rem;
}

.time-value-input {
  flex: 1;
  max-width: 100px;
}

.time-unit-select {
  flex: 2;
}

/* Purge Warning */
.purge-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  margin: 1rem 0;
}

.purge-warning .warning-icon {
  font-size: 1.25rem;
}

.purge-warning p {
  margin: 0;
  color: #e74c3c;
  font-size: 0.9rem;
}

/* Danger Button */
.btn-danger {
  background: #e74c3c !important;
}

.btn-danger:hover {
  background: #c0392b !important;
}

.btn-danger:disabled {
  background: #555 !important;
  color: #888 !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Section Header Actions */
.section-header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Reset Database Modal Styles */
#reset-database-modal .modal-content {
  max-width: 500px;
}

.reset-warning {
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
}

.reset-warning .warning-icon {
  font-size: 3rem;
  color: #e74c3c;
  margin-bottom: 0.5rem;
}

.reset-warning h4 {
  color: #e74c3c;
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
}

.reset-warning p {
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.reset-items-list {
  text-align: left;
  color: #e74c3c;
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.reset-items-list li {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.preserved-note {
  color: var(--success) !important;
  font-weight: 600;
  margin-top: 1rem !important;
}

.preserved-list {
  text-align: left;
  color: var(--success);
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.preserved-list li {
  margin: 0.3rem 0;
  font-size: 0.9rem;
}

.reset-confirmation {
  margin: 1.5rem 0 1rem;
}

.reset-confirmation label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.reset-confirmation input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-dark);
  border: 2px solid rgba(231, 76, 60, 0.3);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 1rem;
  text-align: center;
  text-transform: uppercase;
}

.reset-confirmation input:focus {
  outline: none;
  border-color: #e74c3c;
}

#btn-reset-database {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  color: white;
}

/* Reaction Roles List */
.reaction-roles-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.reaction-roles-list::-webkit-scrollbar {
  width: 6px;
}

.reaction-roles-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.reaction-roles-list::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.3);
  border-radius: 3px;
}

.reaction-roles-list::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 162, 39, 0.5);
}

.reaction-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}

.reaction-role-item:hover {
  border-color: rgba(201, 162, 39, 0.3);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(201, 162, 39, 0.03));
  transform: translateX(4px);
}

.reaction-role-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reaction-role-emoji {
  font-size: 1.75rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(142, 68, 173, 0.2), rgba(142, 68, 173, 0.1));
  border-radius: 12px;
  border: 1px solid rgba(142, 68, 173, 0.2);
}

.reaction-role-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reaction-role-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.reaction-role-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reaction-role-channel {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.reaction-role-channel::before {
  content: '#';
  opacity: 0.7;
}

.reaction-role-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit-rr,
.btn-delete-rr {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-edit-rr:hover {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.15);
  transform: scale(1.05);
}

.btn-delete-rr:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  transform: scale(1.05);
}

/* Generic Icon Buttons */
.btn-icon {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin-left: 0.5rem;
}

.btn-icon:hover {
  transform: scale(1.1);
}

.btn-edit-server-stats:hover {
  background: rgba(201, 162, 39, 0.2);
}

.btn-delete-icon-stats:hover {
  background: rgba(231, 76, 60, 0.2);
}

/* Reaction Roles Empty State */
.reaction-roles-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.reaction-roles-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Form hint */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.checkbox-text {
  color: var(--text);
  font-size: 0.9rem;
}

/* Toggle Group for Mode Selection */
.toggle-group {
  display: flex;
  gap: 0.5rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.toggle-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
  font-weight: 600;
}

/* Emoji-Role Pairs Container */
#emoji-role-pairs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.emoji-role-pair {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.emoji-role-pair .pair-emoji,
.emoji-role-pair .pair-role,
.emoji-role-pair .pair-remove-role {
  flex: 1;
}

.emoji-role-pair .pair-remove-role input {
  border-color: rgba(231, 76, 60, 0.3);
}

.emoji-role-pair .pair-remove-role input::placeholder {
  color: rgba(231, 76, 60, 0.5);
}

.emoji-role-pair .pair-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  padding-top: 0.75rem;
}

.emoji-role-pair .btn-remove-pair {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  margin-top: 0.25rem;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.emoji-role-pair .btn-remove-pair:hover {
  opacity: 1;
  color: #e74c3c;
}

.btn-add-pair {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-add-pair:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

/* Autocomplete Wrapper */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-wrapper input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
}

.autocomplete-wrapper input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Autocomplete Dropdown for Reaction Roles */
.rr-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1001;
  margin-top: 4px;
  display: none;
}

.rr-autocomplete-dropdown.active {
  display: block;
}

.rr-autocomplete-item {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease;
}

.rr-autocomplete-item:hover,
.rr-autocomplete-item.selected {
  background: rgba(255, 255, 255, 0.1);
}

.rr-autocomplete-item .channel-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.rr-autocomplete-item .channel-name {
  flex: 1;
}

.rr-autocomplete-item .channel-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rr-autocomplete-item .emoji-preview {
  font-size: 1.2rem;
}

.rr-autocomplete-item .emoji-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}

.rr-autocomplete-item .role-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rr-autocomplete-no-results {
  padding: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}

/* Textarea for Message Content */
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Hidden class for toggle */
.form-group.hidden {
  display: none;
}

/* Role badge in reaction roles */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Grouped reaction roles by message */
.reaction-role-group {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.reaction-role-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reaction-role-group-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reaction-role-group-title strong {
  color: var(--text);
}

.reaction-role-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reaction-role-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reaction-role-chip-emoji {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
}

.rr-emoji-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.rr-emoji-unicode {
  font-size: 1.25rem;
}

.rr-channel-icon {
  font-size: 1rem;
}

.rr-channel-name {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.rr-group-title {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.reaction-role-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rr-exclusive-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rr-remove-role {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.reaction-role-chip-role {
  color: #2ecc71;
  font-weight: 500;
}

.btn-edit-rr-group,
.btn-delete-rr-group {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 4px;
}

.btn-edit-rr-group {
  margin-left: auto;
}

.btn-edit-rr-group:hover {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.1);
}

.btn-delete-rr-group:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.reaction-role-chip-role {
  font-weight: 500;
}

.reaction-role-chip-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.25rem;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.reaction-role-chip-delete:hover {
  opacity: 1;
  color: #e74c3c;
}

/* Auto-Purge List */
.auto-purge-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.auto-purge-list::-webkit-scrollbar {
  width: 6px;
}

.auto-purge-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.auto-purge-list::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.3);
  border-radius: 3px;
}

.auto-purge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}

.auto-purge-item:hover {
  border-color: rgba(201, 162, 39, 0.3);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(201, 162, 39, 0.03));
  transform: translateX(4px);
}

.auto-purge-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auto-purge-channel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.auto-purge-channel-icon {
  color: var(--text-muted);
}

.auto-purge-details {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auto-purge-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit-auto-purge,
.btn-delete-auto-purge {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-edit-auto-purge:hover {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.15);
  transform: scale(1.05);
}

.btn-delete-auto-purge:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  transform: scale(1.05);
}

.btn-add-auto-purge {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-add-auto-purge:hover {
  background: var(--primary-light);
}

.auto-purge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auto-purge-status.active {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.auto-purge-status.paused {
  color: #f39c12;
  background: rgba(243, 156, 18, 0.15);
  border: 1px solid rgba(243, 156, 18, 0.3);
}

/* Message Relay Styles */
.btn-add-relay {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-add-relay:hover {
  background: var(--primary-light);
}

.relay-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.relay-list::-webkit-scrollbar {
  width: 6px;
}

.relay-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.relay-list::-webkit-scrollbar-thumb {
  background: rgba(201, 162, 39, 0.3);
  border-radius: 3px;
}

.relay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.25s ease;
}

.relay-item:hover {
  border-color: rgba(201, 162, 39, 0.3);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(201, 162, 39, 0.03));
  transform: translateX(4px);
}

.relay-item-info {
  flex: 1;
}

.relay-item-title {
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.relay-item-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.relay-item-detail {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.relay-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.relay-status.active {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.15);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.relay-status.disabled {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.relay-item-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
}

.btn-edit-relay,
.btn-delete-relay {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 6px;
  font-size: 0.85rem;
}

.btn-edit-relay:hover {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.15);
  transform: scale(1.05);
}

.btn-delete-relay:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.15);
  transform: scale(1.05);
}

/* Toggle label for checkboxes */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-light);
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.form-group-inline {
  display: flex;
  align-items: center;
}

.form-row {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}

/* ==================== END BOT SETTINGS STYLES ==================== */

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 3rem;
}

footer p {
  margin: 0;
  line-height: 1.6;
}

.footer-credits {
  font-size: 0.85rem;
  margin-top: 0.5rem !important;
  opacity: 0.7;
}

.footer-credits .credit-name {
  color: var(--accent-gold);
  font-weight: 600;
  transition: all 0.2s ease;
}

.footer-credits .credit-name:hover {
  text-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

/* Loading */
.loading {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.loading::before {
  content: '';
  width: 24px;
  height: 24px;
  border: 2px solid rgba(201, 162, 39, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.1);
}

.empty-state::before {
  content: '📭';
  display: block;
  font-size: 2rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Bot Settings Responsive */
@media (max-width: 900px) {
  .bot-settings-container {
    grid-template-columns: 1fr;
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .server-selector-container {
    width: 100%;
  }

  .server-selector {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .bot-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .stat-channel-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .stat-checkbox {
    min-width: auto;
  }

  .reaction-role-item,
  .auto-purge-item,
  .relay-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .reaction-role-actions,
  .auto-purge-actions,
  .relay-item-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .stats-actions {
    flex-direction: column;
  }

  .btn-save-stats,
  .btn-delete-stats {
    width: 100%;
    text-align: center;
  }
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  main {
    padding: 1rem;
  }

  .bank-display {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .currency-icon {
    font-size: 2.5rem;
  }

  .currency-value {
    font-size: 2rem;
  }

  .request-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }

  .member-card {
    flex-wrap: wrap;
  }

  .member-joined {
    width: 100%;
    text-align: left;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .members-search input {
    width: 100%;
  }
}

/* ==================== PROFILE STYLES ==================== */

.profile-layout,
.profile-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

/* Profile Sidebar */
.profile-sidebar {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.profile-avatar-section {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar,
.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  margin-bottom: 1rem;
  object-fit: cover;
}

.profile-display-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.profile-username {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Profile Navigation */
.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.profile-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.profile-nav-item.active {
  background: rgba(201, 162, 39, 0.15);
  color: var(--primary-color);
}

.profile-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.profile-nav-item.danger {
  color: var(--danger);
}

.profile-nav-item.danger:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* Profile Content */
.profile-content {
  min-height: 500px;
}

.profile-tab {
  display: none;
  animation: fadeIn 0.3s ease;
}

.profile-tab.active {
  display: block;
}

.profile-section-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

/* Profile Cards */
.profile-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.profile-card h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Character Form */
.character-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.character-form .form-group {
  padding: 0;
  margin-bottom: 0;
}

.character-form .form-group.full-width {
  grid-column: 1 / -1;
}

.character-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.character-form .form-group input,
.character-form .form-group select,
.character-form .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.character-form .form-group input:focus,
.character-form .form-group select:focus,
.character-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.character-form .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.profile-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn-save-profile,
.btn-save,
.profile-form .btn-save,
#save-professions {
  padding: 0.875rem 2.5rem;
  background: linear-gradient(135deg, var(--success) 0%, #27ae60 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
  letter-spacing: 0.3px;
}

.btn-save-profile:hover,
.btn-save:hover,
.profile-form .btn-save:hover,
#save-professions:hover {
  background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-save-profile:active,
.btn-save:active,
.profile-form .btn-save:active,
#save-professions:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

/* Profile form rows */
.profile-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.profile-form .form-group {
  margin-bottom: 1rem;
}

.profile-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-form .form-group input,
.profile-form .form-group select,
.profile-form .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.profile-form .form-group input:focus,
.profile-form .form-group select:focus,
.profile-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Character Stats Section */
.stats-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.stats-section h4 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-input-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-input-group input {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
}

.stat-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.stat-input-group input::placeholder {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tab-description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.tab-description.danger-text {
  color: var(--danger);
}

/* Wipe buttons */
.btn-danger {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
}

/* Professions Grid */
.professions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.profession-category {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.profession-category h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profession-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profession-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-darker);
  border-radius: 8px;
}

.profession-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.profession-name {
  flex: 1;
  color: var(--text-light);
  font-size: 0.9rem;
}

.profession-level {
  width: 60px;
  padding: 0.4rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 0.85rem;
  text-align: center;
}

.profession-level:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Absences */
.absences-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.btn-add-absence {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-absence:hover {
  background: var(--primary-dark);
}

.absences-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.absence-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-darker);
  border-radius: 8px;
  border-left: 3px solid var(--warning);
}

.absence-dates {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.absence-reason {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-remove-absence {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-remove-absence:hover {
  opacity: 1;
}

.empty-absences {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Attendance Stats */
.attendance-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.attendance-stat {
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.attendance-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.attendance-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.attendance-history {
  max-height: 300px;
  overflow-y: auto;
}

.attendance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.attendance-item:last-child {
  border-bottom: none;
}

.attendance-event {
  font-weight: 500;
  color: var(--text-light);
}

.attendance-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.attendance-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.attendance-status.present {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.attendance-status.absent {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.attendance-status.excused {
  background: rgba(241, 196, 15, 0.2);
  color: var(--warning);
}

/* Commissions */
.commissions-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.commission-stat {
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.commission-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.commission-stat-value.earnings {
  color: #ffd700;
}

.commission-stat-value.completed {
  color: var(--success);
}

.commission-stat-value.pending {
  color: var(--warning);
}

.commission-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.commissions-list {
  max-height: 300px;
  overflow-y: auto;
}

.commission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-darker);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.commission-info h5 {
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.commission-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.commission-amount {
  font-weight: 700;
  color: #ffd700;
}

/* Points */
.points-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.points-card {
  background: var(--bg-darker);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.points-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.points-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.points-history {
  max-height: 250px;
  overflow-y: auto;
}

.points-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.points-item:last-child {
  border-bottom: none;
}

.points-reason {
  color: var(--text-light);
}

.points-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.points-change {
  font-weight: 600;
}

.points-change.positive {
  color: var(--success);
}

.points-change.negative {
  color: var(--danger);
}

/* Roles Display */
.roles-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-role-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-darker);
  border-radius: 20px;
  border: 1px solid;
}

.role-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profile-role-name {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Wipe Data */
.wipe-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wipe-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--bg-darker);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wipe-option-info h5 {
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.wipe-option-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-wipe {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-wipe:hover {
  background: var(--danger);
  color: white;
}

.wipe-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  margin-top: 1.5rem;
}

.wipe-warning i {
  color: var(--danger);
  font-size: 1.25rem;
}

.wipe-warning p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive Profile */
@media (max-width: 1024px) {
  .profile-layout,
  .profile-container {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .profile-nav-item {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .professions-grid {
    grid-template-columns: 1fr;
  }

  .attendance-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .commissions-summary {
    grid-template-columns: 1fr;
  }

  .points-display {
    grid-template-columns: 1fr;
  }

  .profile-form .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .character-form {
    grid-template-columns: 1fr;
  }

  .attendance-stats {
    grid-template-columns: 1fr;
  }
}

/* ==================== END PROFILE STYLES ==================== */

/* ==================== MEMBER PROFILE VIEW MODAL ==================== */

/* Clickable member cards */
.member-card.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-color);
}

/* Large modal for profile view */
.modal-large {
  max-width: 700px;
  width: 95%;
}

/* ==================== MEMBER PROFILE MODAL - NEW DESIGN ==================== */

.modal-profile {
  max-width: 1300px;
  width: 95%;
  max-height: 85vh;
  overflow: hidden;
  padding: 0;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.98), rgba(12, 15, 22, 0.99));
}

.profile-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr 320px;
  height: 100%;
  max-height: 85vh;
}

/* Profile Sidebar */
.profile-sidebar {
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.08), rgba(15, 18, 25, 0.95));
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
}

.profile-avatar-wrapper {
  position: relative;
  margin-bottom: 0.75rem;
}

.profile-avatar-large {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  object-fit: cover;
  box-shadow: 0 6px 24px rgba(201, 162, 39, 0.3);
}

.profile-level-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--bg-darker);
  border: 2px solid var(--bg-darker);
}

.profile-display-name {
  margin: 0;
  font-size: 1.2rem;
  color: var(--text-light);
  font-weight: 700;
}

.profile-username {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0.2rem 0 0.5rem 0;
}

.profile-char-name {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.profile-class-race {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-class,
.profile-race {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.profile-class {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border: 1px solid rgba(155, 89, 182, 0.3);
}

.profile-race {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
  border: 1px solid rgba(52, 152, 219, 0.3);
}

.profile-secondary {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.profile-secondary .secondary-label {
  opacity: 0.7;
}

.profile-secondary .secondary-value {
  color: var(--text-light);
}

.profile-joined {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
}

.profile-joined span:last-child {
  color: var(--primary-color);
  font-weight: 600;
}

.profile-roles-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
}

.profile-roles-compact .role-tag {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
}

/* Profile Center Column */
.profile-center {
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* Profile Right Column */
.profile-right {
  padding: 1.25rem;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(46, 204, 113, 0.03), rgba(15, 18, 25, 0.95));
}

.profile-card-professions {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.profile-card-professions .profile-professions {
  flex: 1;
  overflow-y: auto;
}

.profile-card {
  background: linear-gradient(145deg, rgba(30, 35, 45, 0.8), rgba(20, 25, 35, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 1rem;
}

.profile-card h4 {
  margin: 0 0 0.75rem 0;
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-bio-card {
  background: linear-gradient(145deg, rgba(201, 162, 39, 0.05), rgba(20, 25, 35, 0.9));
  border-color: rgba(201, 162, 39, 0.15);
}

.profile-bio-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}

/* Stats Row */
.profile-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.profile-stat-box {
  background: linear-gradient(145deg, rgba(30, 35, 45, 0.9), rgba(20, 25, 35, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-stat-box .stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-light);
}

.profile-stat-box .stat-value.wins {
  color: var(--success);
}

.profile-stat-box .stat-value.championships {
  color: var(--primary-color);
}

.profile-stat-box .stat-name {
  font-size: 0.6rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Character Stats */
.profile-char-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 0.75rem;
}

.profile-char-stats .stat-item {
  text-align: center;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

/* Professions */
.profile-professions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.profile-professions .profession-badge {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.1));
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 8px;
  color: #2ecc71;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Tournament Performance Grid */
.profile-tournament-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.tournament-type-card {
  background: linear-gradient(145deg, rgba(25, 30, 40, 0.9), rgba(20, 25, 35, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 0.75rem;
  position: relative;
  overflow: hidden;
}

.tournament-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.tournament-type-card.solo::before {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.tournament-type-card.team::before {
  background: linear-gradient(90deg, #3498db, #2980b9);
}

.tournament-type-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.8rem;
}

.tournament-type-icon {
  font-size: 0.9rem;
}

.tournament-type-stats {
  display: flex;
  justify-content: space-between;
}

.t-stat {
  text-align: center;
  flex: 1;
}

.t-stat-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-light);
}

.t-stat-value.wins {
  color: var(--success);
}

.t-stat-value.losses {
  color: var(--danger);
}

.t-stat-value.winrate {
  color: var(--primary-color);
}

.t-stat.championships .t-stat-value {
  color: var(--primary-color);
}

.t-stat-label {
  display: block;
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.15rem;
}

/* Match History */
.profile-match-history {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 120px;
  overflow-y: auto;
}

.profile-match-history .match-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 0.85rem;
}

.profile-match-history .match-result {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.75rem;
}

.profile-match-history .match-result.win {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success);
}

.profile-match-history .match-result.loss {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

/* Match history items in profile */
.profile-match-history .match-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border-left: 3px solid transparent;
  font-size: 0.85rem;
}

.profile-match-history .match-history-item.win {
  border-left-color: var(--success);
}

.profile-match-history .match-history-item.loss {
  border-left-color: var(--danger);
}

.profile-match-history .match-tournament-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-light);
}

.profile-match-history .match-round {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.profile-match-history .match-date {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 1100px) {
  .profile-layout {
    grid-template-columns: 220px 1fr;
  }

  .profile-right {
    display: none;
  }

  /* Move professions to center column */
  .profile-center::after {
    content: '';
  }
}

@media (max-width: 768px) {
  .modal-profile {
    max-height: 95vh;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }

  .profile-sidebar {
    padding: 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .profile-avatar-large {
    width: 80px;
    height: 80px;
  }

  .profile-stats-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .profile-tournament-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-right {
    display: block;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* ==================== OLD STYLES (keeping for compatibility) ==================== */

.view-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.view-stat-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.8rem;
}

.view-stat-item .stat-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.view-stat-item .stat-label {
  color: var(--text-muted);
  flex: 1;
  font-size: 0.75rem;
}

.view-stat-item .stat-value {
  color: var(--primary-color);
  font-weight: 600;
}

@media (max-width: 600px) {
  .view-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Roles display in view modal */
.view-roles-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Professions in view modal */
.view-professions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.view-profession-category {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1rem;
}

.view-profession-category h5 {
  margin: 0 0 0.75rem 0;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.view-profession-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.view-profession-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.view-profession-item.has-level {
  border-color: rgba(201, 162, 39, 0.2);
  background: rgba(201, 162, 39, 0.05);
}

.view-profession-item .view-prof-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-profession-item .profession-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.view-profession-item .profession-name {
  color: var(--text-light);
  font-size: 0.85rem;
  flex: 1;
}

.view-profession-item .profession-level {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.15);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.view-profession-item .view-prof-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.view-profession-item .view-prof-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.view-profession-item .profession-rank {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 600px) {
  .view-profile-header {
    flex-direction: column;
    text-align: center;
  }

  .view-character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .view-profession-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== END MEMBER PROFILE VIEW MODAL ==================== */

/* ==================== PROFESSIONS WIZARD ==================== */

/* Edit buttons for profile tabs */
.btn-edit-professions,
.btn-edit-character {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1.5rem;
}

.btn-edit-professions:hover,
.btn-edit-character:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Character Summary (View Mode) */
.character-summary {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
}

.character-summary .empty-state {
  color: #888;
  text-align: center;
  padding: 2rem;
}

.character-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.character-info-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

.character-info-item label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.character-info-item .value {
  font-size: 1.1rem;
  color: #fff;
  font-weight: 500;
}

.character-info-item .value.not-set {
  color: #666;
  font-style: italic;
}

.character-bio-section {
  margin-top: 1.5rem;
}

.character-bio-section h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.character-bio-section .bio-text {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  color: #ccc;
  line-height: 1.6;
  white-space: pre-wrap;
}

.character-stats-section {
  margin-top: 1.5rem;
}

.character-stats-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.character-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.character-stat-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border-radius: 6px;
  text-align: center;
}

.character-stat-item label {
  display: block;
  font-size: 0.7rem;
  color: #888;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.character-stat-item .value {
  font-size: 1.2rem;
  color: var(--primary-color);
  font-weight: 600;
}

/* Wizard Modal */
.modal-wizard {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Wizard Progress Bar */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  background: var(--bg-darker);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 2.5rem;
  left: 4rem;
  right: 4rem;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.wizard-step.active .step-circle,
.wizard-step.completed .step-circle {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--bg-dark);
}

.wizard-step.completed .step-circle::after {
  content: '✓';
  font-size: 1rem;
}

.wizard-step.completed .step-circle {
  font-size: 0;
}

.wizard-step span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.wizard-step.active span,
.wizard-step.completed span {
  color: var(--text-light);
}

/* Wizard Content */
.wizard-content {
  display: none;
  padding: 0.5rem 0;
}

.wizard-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.wizard-content h4 {
  color: var(--text-light);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.wizard-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Professions Wizard Grid */
.professions-wizard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* Profession Wizard Item */
.profession-wizard-item {
  background: var(--bg-darker);
  border-radius: 10px;
  padding: 1rem;
}

.profession-wizard-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.profession-wizard-icon {
  font-size: 1.25rem;
}

.profession-wizard-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
}

.profession-wizard-fields {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profession-level-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profession-level-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profession-level-field .level-value {
  color: var(--text-light);
  font-weight: 600;
  font-size: 1rem;
}

.profession-level-field input[type="range"] {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-card);
  border-radius: 4px;
  cursor: pointer;
}

.profession-level-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.profession-level-field input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.profession-level-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.profession-rank {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.profession-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profession-field label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profession-field input,
.profession-field select {
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.profession-field input:focus,
.profession-field select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.profession-field input[type="number"] {
  text-align: center;
}

.profession-field select {
  cursor: pointer;
}

/* Certification colors */
.profession-field select option[value="novice"] { color: #aaa; }
.profession-field select option[value="apprentice"] { color: #2ecc71; }
.profession-field select option[value="journeyman"] { color: #3498db; }
.profession-field select option[value="master"] { color: #9b59b6; }
.profession-field select option[value="grandmaster"] { color: #f1c40f; }

/* Wizard Summary */
.wizard-summary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.summary-category {
  background: var(--bg-darker);
  border-radius: 10px;
  padding: 1.25rem;
}

.summary-category h5 {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-item .summary-icon {
  font-size: 1rem;
}

.summary-item .summary-name {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.summary-item .summary-cert {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.summary-item .cert-icon {
  font-size: 0.8rem;
}

.summary-item .cert-name {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Certification colors in summary */
.cert-novice { color: #888; }
.cert-apprentice { color: #2ecc71; }
.cert-journeyman { color: #3498db; }
.cert-master { color: #9b59b6; }
.cert-grandmaster { color: #f1c40f; }

.wizard-summary-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(201, 162, 39, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

/* Wizard Actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1.5rem;
}

.wizard-nav {
  display: flex;
  gap: 1rem;
}

.btn-wizard-save {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--success) 0%, #27ae60 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-wizard-save:hover {
  background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
  transform: translateY(-1px);
}

.btn-wizard-next {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-wizard-next:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-wizard-next::after {
  content: '→';
}

.btn-wizard-prev {
  padding: 0.75rem 1.5rem;
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-wizard-prev:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-wizard-prev::before {
  content: '←';
}

/* Professions Summary on Profile Tab */
.professions-summary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.professions-summary .summary-category {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Profession Display (Profile Tab) */
.profession-display-category {
  margin-bottom: 1.5rem;
}

.profession-display-category h5 {
  color: var(--primary-color);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

.profession-display-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.profession-display-item {
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 0.75rem;
}

.profession-display-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.profession-display-icon {
  font-size: 1.1rem;
}

.profession-display-name {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-light);
}

.profession-display-level {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.profession-display-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.profession-display-progress {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.profession-display-rank {
  font-size: 0.75rem;
  font-weight: 600;
  display: block;
  text-align: right;
}

/* Summary level and rank for wizard summary */
.summary-level {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

.summary-rank {
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Responsive Wizard */
@media (max-width: 768px) {
  .professions-wizard-grid {
    grid-template-columns: 1fr;
  }

  .wizard-progress {
    padding: 1rem;
  }

  .wizard-progress::before {
    left: 2rem;
    right: 2rem;
  }

  .wizard-step span {
    font-size: 0.65rem;
  }

  .step-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .profession-wizard-fields {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== END PROFESSIONS WIZARD ==================== */

/* ==================== TOURNAMENT RANKINGS ==================== */

/* Rankings button in tournaments header */
.btn-rankings {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-rankings:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

/* Rankings tabs */
.rankings-tabs {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(145deg, rgba(15, 18, 25, 0.6), rgba(10, 12, 18, 0.8));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rankings-tab {
  padding: 0.7rem 1.4rem;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rankings-tab:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.rankings-tab.active {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-darker);
  border-color: var(--primary-color);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}

/* Rankings content */
.rankings-content {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(15, 18, 25, 0.4), transparent);
}

/* Rankings table */
.rankings-table {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.rankings-header {
  display: grid;
  grid-template-columns: 60px 1fr 60px 60px 70px 60px;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
  border-radius: 10px;
  font-weight: 700;
  color: var(--primary-color);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid rgba(201, 162, 39, 0.15);
}

.rankings-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px 60px 70px 60px;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(145deg, rgba(20, 25, 35, 0.95), rgba(15, 18, 25, 0.98));
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.rankings-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.rankings-row:hover {
  border-color: rgba(201, 162, 39, 0.3);
  transform: translateX(4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.rankings-row:hover::before {
  background: var(--primary-color);
}

.rankings-row.top-1 {
  background: linear-gradient(145deg, rgba(255, 215, 0, 0.12), rgba(20, 25, 35, 0.95));
  border-color: rgba(255, 215, 0, 0.25);
}

.rankings-row.top-1::before {
  background: linear-gradient(180deg, #ffd700, #b8860b);
}

.rankings-row.top-2 {
  background: linear-gradient(145deg, rgba(192, 192, 192, 0.1), rgba(20, 25, 35, 0.95));
  border-color: rgba(192, 192, 192, 0.2);
}

.rankings-row.top-2::before {
  background: linear-gradient(180deg, #c0c0c0, #808080);
}

.rankings-row.top-3 {
  background: linear-gradient(145deg, rgba(205, 127, 50, 0.1), rgba(20, 25, 35, 0.95));
  border-color: rgba(205, 127, 50, 0.2);
}

.rankings-row.top-3::before {
  background: linear-gradient(180deg, #cd7f32, #8b4513);
}

.rank-col {
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.rankings-row.top-1 .rank-col {
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.rankings-row.top-2 .rank-col {
  color: #c0c0c0;
  text-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
}

.rankings-row.top-3 .rank-col {
  color: #cd7f32;
  text-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
}

.player-col {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ranking-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.rankings-row.top-1 .ranking-avatar {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.rankings-row.top-2 .ranking-avatar {
  border-color: rgba(192, 192, 192, 0.5);
  box-shadow: 0 0 12px rgba(192, 192, 192, 0.3);
}

.rankings-row.top-3 .ranking-avatar {
  border-color: rgba(205, 127, 50, 0.5);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.3);
}

.rankings-row:hover .ranking-avatar {
  transform: scale(1.1);
}

.player-name {
  font-weight: 600;
  color: var(--text-light);
}

.stat-col {
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}

.stat-col.wins {
  color: var(--success);
}

.stat-col.losses {
  color: var(--danger);
}

.stat-col.winrate {
  color: var(--primary-color);
  font-weight: 700;
}

.trophy-col {
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}

.trophy-col.tournament-wins {
  color: var(--primary-color);
  text-shadow: 0 0 8px rgba(201, 162, 39, 0.4);
}

/* ==================== PROFILE TOURNAMENT STATS ==================== */

.tournament-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tournament-stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.tournament-stat-card h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-align: center;
}

.stat-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
}

.stat-number.wins {
  color: var(--success);
}

.stat-number.losses {
  color: var(--danger);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tournament-wins-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(201, 162, 39, 0.1);
  border-radius: 8px;
  color: var(--primary-color);
  font-weight: 600;
}

.trophy-icon {
  font-size: 1.5rem;
}

/* Match history */
.match-history {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.match-history h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.match-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.match-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.match-history-item.win {
  border-left-color: var(--success);
}

.match-history-item.loss {
  border-left-color: var(--danger);
}

.match-result {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.match-result.win {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success);
}

.match-result.loss {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.match-tournament-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-round {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.match-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive rankings */
@media (max-width: 768px) {
  .rankings-header,
  .rankings-row {
    grid-template-columns: 40px 1fr 40px 40px 50px 40px;
    font-size: 0.85rem;
  }

  .ranking-avatar {
    width: 28px;
    height: 28px;
  }

  .tournament-stats-grid {
    grid-template-columns: 1fr;
  }

  .match-history-item {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .match-date {
    display: none;
  }
}

/* ==================== END TOURNAMENT RANKINGS ====================*/

/* ==================== AUTOCOMPLETE DROPDOWN ==================== */

.autocomplete-dropdown {
  position: fixed;
  background: #1a1a2e;
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 999999;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--accent-color);
  color: white;
}

.autocomplete-item strong {
  color: var(--secondary-color);
  font-weight: 700;
}

.autocomplete-item:hover strong,
.autocomplete-item.selected strong {
  color: #fff;
}

.autocomplete-item.no-results {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
}

.autocomplete-item.no-results:hover {
  background: transparent;
  color: var(--text-muted);
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.autocomplete-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
  flex-shrink: 0;
}

.autocomplete-item .item-info {
  color: var(--text-muted);
  font-size: 0.85em;
  margin-left: 8px;
}

.balance-info {
  background: var(--surface-dark);
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: var(--gold);
  font-weight: 500;
  text-align: center;
}

/* Ensure form groups have proper positioning for dropdown */
.form-group {
  position: relative;
}

/* Scrollbar styling for autocomplete */
.autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

/* Item autocomplete with icons */
.stock-item-input-wrapper {
  position: relative;
  flex: 1;
}

.item-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1a1a2e;
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 10000;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  margin-top: 4px;
}

.item-autocomplete-dropdown .autocomplete-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
}

.item-autocomplete-dropdown .autocomplete-item:last-child {
  border-bottom: none;
}

.item-autocomplete-dropdown .autocomplete-item:hover {
  background: var(--accent-color);
}

.item-autocomplete-dropdown .autocomplete-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.item-autocomplete-dropdown .autocomplete-name {
  color: #e0e0e0;
  font-size: 0.9rem;
  flex: 1;
}

.item-autocomplete-dropdown .autocomplete-item:hover .autocomplete-name {
  color: white;
}

.item-autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.item-autocomplete-dropdown::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.item-autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

/* ==================== END AUTOCOMPLETE ====================*/

/* ==================== ROLE VISIBILITY MODAL ====================*/

/* Section styles */
.visibility-section {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 1rem;
}

.section-header {
  margin-bottom: 0.75rem;
}

.section-hint {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Excluded Roles Container */
.excluded-roles-container {
  max-height: 150px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}

.excluded-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.excluded-role-item {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.excluded-role-item input[type="checkbox"] {
  display: none;
}

.excluded-role-tag {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid;
  background: transparent;
  transition: all 0.2s ease;
  opacity: 0.6;
}

.excluded-role-item:hover .excluded-role-tag {
  opacity: 0.8;
}

.excluded-role-item.excluded .excluded-role-tag {
  opacity: 1;
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c !important;
  color: #e74c3c !important;
  position: relative;
}

.excluded-role-item.excluded .excluded-role-tag::before {
  content: "×";
  margin-right: 0.35rem;
  font-weight: bold;
}

/* Role Visibility List */
.role-visibility-search {
  margin-bottom: 0.75rem;
}

.role-visibility-search input {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-light);
  font-size: 0.9rem;
}

.role-visibility-search input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.role-visibility-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}

.role-visibility-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.role-visibility-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-visibility-item input[type="checkbox"] {
  display: none;
}

.role-visibility-tag {
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  border: 1px solid;
  background: transparent;
  transition: all 0.2s ease;
}

.role-visibility-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: rgba(39, 174, 96, 0.2);
  color: #27ae60;
}

.role-visibility-item.hidden-role .role-visibility-tag {
  opacity: 0.4;
}

.role-visibility-item.hidden-role .role-visibility-status {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.role-visibility-hint {
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Scrollbar styling for role containers */
.excluded-roles-container::-webkit-scrollbar,
.role-visibility-list::-webkit-scrollbar {
  width: 6px;
}

.excluded-roles-container::-webkit-scrollbar-track,
.role-visibility-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.excluded-roles-container::-webkit-scrollbar-thumb,
.role-visibility-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

/* ==================== END ROLE VISIBILITY MODAL ====================*/

/* ==================== TOAST NOTIFICATIONS ==================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(30, 35, 45, 0.98), rgba(20, 25, 35, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  color: var(--text-light);
  font-size: 0.9rem;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  backdrop-filter: blur(10px);
}

.toast.hiding {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

/* Toast Types */
.toast.success {
  border-left: 4px solid var(--success);
}

.toast.success .toast-icon {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.error .toast-icon {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

.toast.warning .toast-icon {
  background: rgba(243, 156, 18, 0.2);
  color: var(--warning);
}

.toast.info {
  border-left: 4px solid var(--info);
}

.toast.info .toast-icon {
  background: rgba(52, 152, 219, 0.2);
  color: var(--info);
}

/* Progress bar for auto-dismiss */
.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary-color);
  border-radius: 0 0 0 10px;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* Responsive */
@media (max-width: 480px) {
  #toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* ==================== END TOAST NOTIFICATIONS ====================*/
