/* ==========================================
   DESIGN SYSTEM & VARIABLES
   PT JRBM MLBB TOURNAMENT
   ========================================== */

:root {
  /* Color Palette */
  --bg-darker: #0d0805;      /* Ultra dark brown background */
  --bg-main: #140d0a;        /* Deep chocolate brown background */
  --bg-card: #20130d;        /* Warm medium brown for cards */
  --bg-card-hover: #291a12;  /* Slightly lighter brown on hover */
  
  --primary: #079992;        /* Flat UI Teal */
  --primary-glow: #0ce0d6;   /* Bright teal glow */
  --primary-dark: #056e69;   /* Darker teal for active/hover states */
  
  --accent-gold: #d4af37;    /* Gold highlight for champions */
  --accent-gold-glow: rgba(212, 175, 55, 0.4);
  
  --text-light: #fbf8f6;     /* Off-white */
  --text-muted: #a69288;     /* Warm muted brown-gray */
  --text-dark: #20130d;      /* Dark brown text for contrast */
  
  --border-color: #38251c;   /* Subtle brown border */
  --border-glow: rgba(7, 153, 146, 0.25);
  
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f1c40f;
  
  /* Fonts */
  --font-body: 'Inter', sans-serif;
  --font-title: 'Outfit', sans-serif;
  
  /* Shadow & Blur */
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  --teal-shadow: 0 0 20px rgba(7, 153, 146, 0.35);
  --glass-blur: blur(12px);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==========================================
   RESET & GLOBAL STYLES
   ========================================== */

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

body {
  background-color: var(--bg-main);
  color: var(--text-light);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(7, 153, 146, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(61, 35, 20, 0.3) 0%, transparent 50%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

button, input, select, textarea {
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-gold { color: var(--accent-gold) !important; }
.text-muted { color: var(--text-muted) !important; }
.mt-4 { margin-top: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* ==========================================
   TYPOGRAPHY
   ========================================== */

h1, h2, h3, h4, h5, h6, .font-title {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.5px;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

h2.section-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 80px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--primary-glow);
}

h2.section-header.center::after {
  left: 50%;
  transform: translateX(-50%);
}

/* ==========================================
   LAYOUT: HEADER & NAVIGATION
   ========================================== */

.main-header {
  background-color: rgba(13, 8, 5, 0.85);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trophy-logo {
  font-size: 2.2rem;
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-company {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-light);
  line-height: 1;
}

.logo-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--primary);
  text-shadow: 0 0 5px rgba(7, 153, 146, 0.5);
}

.navbar-toggle {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.5rem;
  cursor: pointer;
  display: none;
  transition: var(--transition);
}

.navbar-toggle:hover {
  color: var(--primary);
}

.navbar-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
}

.nav-link:hover::after {
  width: 100%;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
}

.btn-primary, .btn-register {
  background: var(--primary);
  color: var(--text-light);
  box-shadow: var(--teal-shadow);
}

.btn-primary:hover, .btn-register:hover {
  background: var(--primary-glow);
  color: var(--bg-darker);
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--primary-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-light);
}

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

.btn-logout {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.btn-logout:hover {
  background: var(--danger);
  color: var(--text-light);
  transform: translateY(-2px);
}

.btn-gold {
  background: var(--accent-gold);
  color: var(--bg-darker);
  box-shadow: 0 0 15px var(--accent-gold-glow);
}

.btn-gold:hover {
  background: #e5c158;
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--accent-gold);
}

.nav-btn {
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ==========================================
   CARDS & CONTAINERS (GLASSMORPHISM)
   ========================================== */

.glass-panel {
  background: rgba(32, 19, 13, 0.7);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.glass-panel:hover {
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 15px rgba(7, 153, 146, 0.1);
}

/* ==========================================
   LANDING HERO SECTION
   ========================================== */

.hero-section {
  position: relative;
  padding: 5rem 0 4rem;
  text-align: center;
  background-image: 
    linear-gradient(to bottom, rgba(20, 13, 10, 0.7), var(--bg-main)),
    url('https://images.unsplash.com/photo-1511512578047-dfb367046420?q=80&w=1200&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-color);
}

.hero-badge {
  display: inline-block;
  background: rgba(7, 153, 146, 0.15);
  border: 1px solid var(--primary);
  color: var(--primary-glow);
  padding: 0.4rem 1rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px rgba(7, 153, 146, 0.2);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.hero-desc {
  max-width: 700px;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  color: var(--text-muted);
}

/* Statistics Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
}

.stat-card {
  padding: 1.5rem;
  background: rgba(13, 8, 5, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 5px var(--primary-glow));
}

.stat-number {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.2;
}

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

/* ==========================================
   FORMS & INPUTS (LOGIN & REGISTER)
   ========================================== */

.form-wrapper {
  max-width: 500px;
  margin: 3rem auto;
}

.form-header {
  text-align: center;
  margin-bottom: 2rem;
}

.form-header h2 {
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(13, 8, 5, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(7, 153, 146, 0.4);
}

/* Custom file input */
.file-upload-wrapper {
  position: relative;
  width: 100%;
  height: 50px;
  background: rgba(13, 8, 5, 0.6);
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.file-upload-wrapper:hover {
  border-color: var(--primary);
  background: rgba(7, 153, 146, 0.05);
}

.file-upload-wrapper input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

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

.file-preview {
  width: 50px;
  height: 50px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

/* Auth Toggle */
.auth-toggle {
  display: flex;
  background: rgba(13, 8, 5, 0.8);
  border-radius: 8px;
  padding: 0.25rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.auth-toggle-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.auth-toggle-btn.active {
  background: var(--primary);
  color: var(--text-light);
  box-shadow: 0 0 10px rgba(7, 153, 146, 0.3);
}

/* ==========================================
   TEAMS GRID SECTION
   ========================================== */

.teams-section {
  padding: 2.5rem 0;
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 1rem !important;
}

.team-card-logo-container {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(13, 8, 5, 0.9);
  padding: 3px;
  border: 2px solid var(--primary);
  box-shadow: 0 0 12px rgba(7, 153, 146, 0.25);
  margin-bottom: 0.6rem;
  flex-shrink: 0;
}

.team-card-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.team-card-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-light);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.team-card-dept {
  font-size: 0.78rem;
  color: var(--primary-glow);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.team-card-leader {
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  width: 100%;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

/* Lightweight Participating Team Cards */
.public-team-card.team-card-complete {
  border: 1.5px solid var(--primary) !important;
  box-shadow: 0 4px 12px rgba(7, 153, 146, 0.2);
}

.public-team-card.team-card-complete:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(7, 153, 146, 0.35);
}

.public-team-card.team-card-incomplete {
  border: 1.5px solid #e74c3c !important;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.2);
}

.public-team-card.team-card-incomplete:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(231, 76, 60, 0.35);
}

/* ==========================================
   TOURNAMENT BRACKET STYLING
   (MOBILE-FRIENDLY SWIPEABLE SCROLL)
   ========================================== */

.bracket-section {
  padding: 4rem 0;
  background: rgba(13, 8, 5, 0.4);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.bracket-outer {
  width: 100%;
  overflow-x: auto; /* Enable horizontal swipe on mobile */
  padding: 2rem 0;
  -webkit-overflow-scrolling: touch;
}

.bracket-container {
  display: inline-flex;
  min-width: 800px; /* Force minimum width on mobile for structural layout */
  justify-content: space-between;
  gap: 3rem;
  padding: 0 1.5rem;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 250px;
  flex-shrink: 0;
}

.round-title {
  text-align: center;
  background: rgba(7, 153, 146, 0.1);
  border: 1px solid var(--primary);
  border-radius: 4px;
  padding: 0.5rem;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary-glow);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.matchup-card {
  background: rgba(20, 13, 10, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: var(--transition);
}

.matchup-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(7, 153, 146, 0.2);
}

.matchup-card.ongoing {
  border-color: var(--warning);
}

.matchup-card.ongoing::before {
  content: 'LIVE';
  position: absolute;
  top: 0;
  right: 0;
  background: var(--warning);
  color: var(--bg-darker);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 1px 6px;
  border-bottom-left-radius: 4px;
}

.matchup-teams {
  display: flex;
  flex-direction: column;
}

.matchup-team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(32, 19, 13, 0.2);
}

.matchup-team:last-child {
  border-bottom: none;
}

.matchup-team.winner-team {
  background: rgba(7, 153, 146, 0.1);
}

.matchup-team.winner-team .team-name-bracket {
  color: var(--text-light);
  font-weight: 600;
}

.matchup-team-details {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.team-logo-bracket {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.team-name-bracket {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.team-score-bracket {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-muted);
  width: 20px;
  text-align: right;
}

.matchup-team.winner-team .team-score-bracket {
  color: var(--primary-glow);
}

.matchup-team.bye-team .team-name-bracket {
  font-style: italic;
  color: rgba(255, 255, 255, 0.2);
}

.matchup-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(13, 8, 5, 0.6);
  padding: 0.4rem 1rem;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
}

/* Champion Box */
.champion-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.champion-card {
  text-align: center;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 0 20px var(--accent-gold-glow);
  animation: goldPulse 2s infinite ease-in-out;
  padding: 2.5rem;
  background: radial-gradient(circle, rgba(61, 47, 20, 0.9) 0%, rgba(20, 13, 10, 0.95) 100%);
}

.crown-icon {
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 0 10px var(--accent-gold));
}

.champion-logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-gold);
  margin: 0.75rem auto;
}

@keyframes goldPulse {
  0% { box-shadow: 0 0 15px var(--accent-gold-glow); }
  50% { box-shadow: 0 0 30px rgba(212, 175, 55, 0.7); }
  100% { box-shadow: 0 0 15px var(--accent-gold-glow); }
}

/* ==========================================
   CAPTAIN DASHBOARD & MEMBERS EDITOR
   ========================================== */

.dashboard-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

/* Team Profile Sidebar */
.team-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.team-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-logo-preview-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 1.5rem;
}

.team-logo-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary);
  box-shadow: var(--teal-shadow);
}

.avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-color);
}

.sidebar-team-name {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.sidebar-team-dept {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--primary-glow);
  letter-spacing: 1px;
}

.info-list {
  margin-top: 1rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

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

.info-label {
  color: var(--text-muted);
}

.info-val {
  color: var(--text-light);
  font-weight: 600;
}

/* Leader Player Box */
.leader-box {
  background: rgba(7, 153, 146, 0.05);
  border: 1px solid rgba(7, 153, 146, 0.2);
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.leader-box-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.leader-badge {
  background: var(--primary);
  color: var(--text-light);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Members Grid Panel */
.members-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.members-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

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

/* Member Dynamic Card */
.member-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
}

.member-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
}

.member-card.core {
  border-left: 4px solid var(--primary);
}

.member-card.reserve {
  border-left: 4px solid var(--text-muted);
}

.member-role-badge {
  align-self: flex-start;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  display: inline-block;
}

.member-card.captain .member-role-badge {
  background: rgba(7, 153, 146, 0.25);
  color: var(--text-light);
  border: 1px solid var(--primary-glow);
}

.member-card.core .member-role-badge {
  background: rgba(7, 153, 146, 0.15);
  color: var(--primary-glow);
  border: 1px solid var(--primary);
}

.member-card.reserve .member-role-badge {
  background: rgba(166, 146, 136, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

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

.member-avatar-container {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-darker);
  border: 2px solid var(--border-color);
  flex-shrink: 0;
}

.member-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.member-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-nick {
  font-size: 0.9rem;
  color: var(--primary-glow);
  font-weight: 600;
}

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

.member-actions {
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
  display: flex;
  justify-content: flex-end;
}

.member-card-empty {
  text-align: center;
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
}

.member-card-empty i {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.1);
}

/* Member Form Overlay Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: var(--glass-blur);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  padding: 1.5rem 1rem;
  box-sizing: border-box;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 450px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  transform: scale(0.9);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 3rem);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

/* Ensure any form wrapping modal-body/footer is also a flex column */
.modal-card > form {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.modal-header {
  background: rgba(13, 8, 5, 0.8);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0; /* critical: allows flex child to shrink and scroll */
}

.modal-footer {
  background: rgba(13, 8, 5, 0.4);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  border-top: 1px solid var(--border-color);
}

/* ==========================================
   ADMIN DASHBOARD MANAGEMENT
   ========================================== */

.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 2rem 0;
}

.admin-controls-card {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.admin-stats-summary {
  display: flex;
  gap: 2rem;
}

.admin-stat-unit {
  font-size: 1rem;
  color: var(--text-muted);
}

.admin-stat-unit strong {
  font-size: 1.4rem;
  color: var(--primary-glow);
  font-family: var(--font-title);
  margin-right: 0.25rem;
}

/* Matches manager table */
.admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: rgba(13, 8, 5, 0.5);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.admin-table th {
  background: rgba(13, 8, 5, 0.9);
  padding: 1rem;
  color: var(--primary-glow);
  font-family: var(--font-title);
  font-weight: 700;
  border-bottom: 2px solid var(--border-color);
}

.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.admin-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.team-badge-admin {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.team-badge-admin img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.match-score-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-input {
  width: 50px;
  text-align: center;
  padding: 0.4rem;
  background: rgba(13, 8, 5, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-light);
  font-weight: 700;
  font-size: 1rem;
}

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

.status-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.status-badge.scheduled {
  background: rgba(7, 153, 146, 0.15);
  color: var(--primary-glow);
}

.status-badge.ongoing {
  background: rgba(241, 196, 15, 0.15);
  color: var(--warning);
}

.status-badge.completed {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.status-badge.pending {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* ==========================================
   TOAST NOTIFICATION COMPONENT
   ========================================== */

.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 350px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-light);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-left-color: var(--success);
}

.toast.toast-success i {
  color: var(--success);
}

.toast.toast-error {
  border-left-color: var(--danger);
}

.toast.toast-error i {
  color: var(--danger);
}

.toast.toast-info i {
  color: var(--primary-glow);
}

/* ==========================================
   RESPONSIVENESS MEDIA QUERIES
   ========================================== */

@media (max-width: 992px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
  
  .hero-title {
    font-size: 2.75rem;
  }
}

@media (max-width: 768px) {
  /* Navigation mobile menu */
  .navbar-toggle {
    display: block;
  }

  .navbar-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: rgba(20, 13, 10, 0.98);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.5rem 0;
    gap: 1.25rem;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: none;
  }

  .navbar-menu.active {
    display: flex;
  }

  .nav-link {
    width: 80%;
    justify-content: center;
    padding: 0.75rem;
  }

  .nav-btn {
    width: 80%;
    text-align: center;
  }

  /* Stats grid stack */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    max-width: 400px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-section {
    padding: 3rem 0;
  }
  
  .admin-controls-card {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  
  .admin-stats-summary {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  
  .glass-panel {
    padding: 1.25rem;
  }
  
  .members-grid {
    grid-template-columns: 1fr;
  }

  .member-card {
    padding: 1rem;
  }

  .member-info-view {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

/* ==========================================
   FOOTER SECTION STYLES
   ========================================== */
.main-footer {
  background: var(--bg-darker);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2rem 0;
  margin-top: 5rem;
  color: var(--text-light);
  font-family: var(--font-body);
}

.footer-container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.footer-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 1px;
}

.footer-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 400px;
}

.footer-links h4,
.footer-contact h4 {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-glow);
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
  display: inline-block;
}

.footer-links ul li a:hover {
  color: var(--primary-glow);
  transform: translateX(5px);
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-contact p {
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
}

.footer-contact p i {
  color: var(--primary);
  width: 16px;
  text-align: center;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

/* ==========================================
   LOGOS MERGING ANIMATION (PURE GPU CSS 60FPS)
   ========================================== */
.logo-merging-wrapper {
  position: relative;
  overflow: hidden;
  padding: 3rem 1rem;
}

.logo-merging-arena {
  position: relative;
  width: 280px;
  height: 280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-merging-center {
  position: relative;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2.5px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 0 30px rgba(7, 153, 146, 0.6);
}

.merging-center-icon {
  font-size: 2.5rem;
  color: var(--primary-glow);
  filter: drop-shadow(0 0 10px var(--primary-glow));
}

.merging-pulse-ring {
  position: absolute;
  top: -12px; left: -12px; right: -12px; bottom: -12px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.8;
  animation: pulseMerge 2.2s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

.merging-pulse-ring.delay {
  animation-delay: 1.1s;
}

@keyframes pulseMerge {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2.3); opacity: 0; }
}

.merging-logos-circle {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
}

.merging-logo-node {
  position: absolute;
  width: 52px;
  height: 52px;
  top: 50%;
  left: 50%;
  margin-top: -26px;
  margin-left: -26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.merging-logo-img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-glow);
  background: var(--bg-darker);
  box-shadow: 0 0 12px rgba(7, 153, 146, 0.5);
}

.merging-logo-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary-glow);
  white-space: nowrap;
  margin-top: 2px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
}

.node-0 { animation: mergeIn0 3.6s infinite ease-in-out; animation-delay: 0s; }
.node-1 { animation: mergeIn1 3.6s infinite ease-in-out; animation-delay: 0.45s; }
.node-2 { animation: mergeIn2 3.6s infinite ease-in-out; animation-delay: 0.9s; }
.node-3 { animation: mergeIn3 3.6s infinite ease-in-out; animation-delay: 1.35s; }
.node-4 { animation: mergeIn4 3.6s infinite ease-in-out; animation-delay: 1.8s; }
.node-5 { animation: mergeIn5 3.6s infinite ease-in-out; animation-delay: 2.25s; }
.node-6 { animation: mergeIn6 3.6s infinite ease-in-out; animation-delay: 2.7s; }
.node-7 { animation: mergeIn7 3.6s infinite ease-in-out; animation-delay: 3.15s; }

@keyframes mergeIn0 { 0% { opacity: 0; transform: translate(-110px, -110px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn1 { 0% { opacity: 0; transform: translate(110px, -110px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn2 { 0% { opacity: 0; transform: translate(125px, 0px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn3 { 0% { opacity: 0; transform: translate(110px, 110px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn4 { 0% { opacity: 0; transform: translate(-110px, 110px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn5 { 0% { opacity: 0; transform: translate(-125px, 0px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn6 { 0% { opacity: 0; transform: translate(0px, -125px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
@keyframes mergeIn7 { 0% { opacity: 0; transform: translate(0px, 125px) scale(0.6); } 35% { opacity: 1; transform: translate(0, 0) scale(1); } 60% { opacity: 0.8; transform: translate(0, 0) scale(0.2); } 100% { opacity: 0; transform: translate(0, 0) scale(0); } }
