:root {
  --bg-dark: #0a0a0c;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --accent-red: #e63946;
  --accent-red-glow: rgba(230, 57, 70, 0.5);
  --accent-blue: #457b9d;
  --accent-gold: #f4a261;
  --text-main: #f8f9fa;
  --text-muted: #adb5bd;
  --success: #2a9d8f;
  
  --font-heading: 'Bebas Neue', cursive;
  --font-body: 'Outfit', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(230, 57, 70, 0.05), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(69, 123, 157, 0.05), transparent 25%);
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-heading);
  letter-spacing: 1px;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: rgba(0, 0, 0, 0.6);
  border-right: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.logo {
  margin-bottom: 3rem;
  text-align: center;
}

.logo .neon-text {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: #fff;
  text-shadow: 0 0 10px var(--accent-red-glow), 0 0 20px var(--accent-red);
}

.logo p {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: -5px;
}

.nav-links {
  list-style: none;
  flex-grow: 1;
}

.nav-links li {
  padding: 12px 15px;
  margin-bottom: 10px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-links li:hover, .nav-links li.active {
  background: var(--bg-panel);
  color: #fff;
  border-left: 3px solid var(--accent-red);
}

.base-bet-info {
  background: var(--bg-panel);
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  border: 1px solid var(--border-glass);
}

.highlight {
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 1.2rem;
  display: block;
  margin-top: 5px;
}

/* Main Content */
.content {
  flex-grow: 1;
  margin-left: 250px;
  padding: 3rem 4rem;
  max-width: 1200px;
}

header {
  margin-bottom: 2.5rem;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: #fff;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Sections */
.page {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.page.active {
  display: block;
}

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

/* Glass Panels & Tables */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.glass-table {
  width: 100%;
  border-collapse: collapse;
}

.glass-table th {
  background: rgba(255,255,255,0.05);
  font-family: var(--font-heading);
  font-size: 1.2rem;
  letter-spacing: 1px;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-glass);
}

.glass-table td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.02);
  color: #e9ecef;
}

.glass-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.glass-table .pos-1 { color: var(--accent-gold); font-weight: bold; }
.glass-table .pos-2 { color: silver; font-weight: bold; }
.glass-table .pos-3 { color: #cd7f32; font-weight: bold; }

.positive-bal { color: var(--success); }
.negative-bal { color: var(--accent-red); }

/* Glass Panel General */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  margin-bottom: 1.5rem;
}

.glass-panel h3 {
  font-size: 1.5rem;
  margin-bottom: 1.2rem;
  color: var(--accent-gold);
}

/* Forms */
.form-group {
  margin-bottom: 1.2rem;
}

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

input, select {
  width: 100%;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border-glass);
  color: #fff;
  padding: 0.8rem 1rem;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent-red);
  background: rgba(0,0,0,0.6);
}

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

.inline label {
  margin-bottom: 0;
  white-space: nowrap;
}

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

.w-50 {
  flex: 1;
}

.vs {
  font-family: var(--font-heading);
  color: var(--accent-red);
  font-size: 1.5rem;
}

/* Buttons */
.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1rem;
}

.btn-primary { background: var(--accent-gold); color: #000; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(244, 162, 97, 0.4); }

.btn-secondary { background: var(--accent-blue); color: #fff; }
.btn-secondary:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(69, 123, 157, 0.4); }

.btn-danger { background: var(--accent-red); color: #fff; }
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 4px 15px var(--accent-red-glow); }
.btn-success { background: var(--success) !important; color: #fff !important; pointer-events: none; }

.btn-submit-bets {
  width: 100%;
  margin-top: 2rem;
  padding: 1rem;
  font-size: 1.2rem;
}

.wide { width: 100%; margin-top: 1rem; }

/* Grids */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

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

/* Fight Cards */
.fight-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem;
  padding-top: 150px; /* Space for the image banner at the top */
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1; /* For cover backdrop */
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.fight-card > *:not(.fight-card-cover) {
  position: relative;
  z-index: 2; /* Keep contents above the cover */
}

.fight-card-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 160px; /* Constrain image to a header banner */
  background-size: cover;
  background-position: center 20%;
  opacity: 0.85; /* Highly visible banner */
  z-index: 0;
  pointer-events: none;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

.fight-card.closed {
  opacity: 0.7;
}

.fighter-names {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.fighter-a { color: #ff6b6b; }
.fighter-b { color: #4ecdc4; }

.status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: bold;
}

.status-pending { background: rgba(244, 162, 97, 0.2); color: var(--accent-gold); }
.status-closed { background: rgba(42, 157, 143, 0.2); color: var(--success); }

/* Poster Support Removed Obsolete Avatars */

/* Odds UI Components */
.odds-container {
  margin-top: auto;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.05);
}

/* Votos specific */
.voting-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.vote-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1.5rem;
  padding-top: 150px; /* Space for the image banner at the top */
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1; /* For cover backdrop */
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vote-card > *:not(.fight-card-cover) {
  position: relative;
  z-index: 2; /* Keep contents above the cover */
}

.vote-card .fight-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.vote-controls {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  width: 100%;
}

/* Admin Fight Item */
.admin-fight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-glass);
  gap: 1rem;
}

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

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--success);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
}

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

.toast.error {
  background: var(--accent-red);
}

@media (max-width: 768px) {
  /* Sidebar as Bottom Navigation & Top Logo */
  .sidebar {
    position: fixed;
    bottom: 0px;
    left: 0;
    width: 100%;
    height: calc(75px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    margin: 0;
    z-index: 9999;
    background: rgba(17, 17, 17, 0.98); /* Solid dark color */
    border-top: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 -5px 15px rgba(0,0,0,0.8);
    backdrop-filter: none !important; /* CRITICAL: prevents containing block bug for .logo */
  }
  
  .logo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: #111111;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 10px 0;
    margin-bottom: 0;
  }
  .logo .neon-text { font-size: 1.5rem !important; }
  .logo p { font-size: 0.6rem; display: block; letter-spacing: 2px; }

  .nav-links {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    align-items: center;
    justify-content: space-around;
  }
  
  .nav-links li {
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch; /* Stretch to fill height so link is full area */
    border-radius: 0;
    padding: 0;
    margin: 0;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-top: 3px solid transparent;
  }
  
  .nav-links li:hover, .nav-links li.active {
    background: rgba(255,255,255,0.08);
    border-top: 3px solid var(--accent-red) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    color: #fff !important;
  }
  
  .nav-links a {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    flex-direction: column !important;
    gap: 6px !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.85rem;
    color: inherit;
  }
  
  .nav-links li .icon { 
    display: block !important; 
    font-size: 1.5rem !important; 
    margin-bottom: 2px; 
    opacity: 1 !important;
  }
  .base-bet-info { display: none; }
  
  /* Main Content */
  .content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 85px; /* Space for top logo */
    padding-bottom: 95px; /* Space for bottom nav */
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  /* Grids */
  .admin-grid,
  .fights-grid {
    grid-template-columns: 1fr;
  }
  
  /* Glass Panels Layout */
  .flex-row {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .w-50 {
    width: 100%;
    flex: none;
  }
  
  /* Voting View */
  .vote-card {
    flex-direction: column;
    align-items: stretch;
  }
  
  .vote-controls {
    flex-direction: column;
    min-width: 100%;
  }
  
  /* Admin Fight Item */
  .admin-fight-item {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-fight-item > div:last-child {
    flex-direction: column;
  }
  
  /* Table (Let it scroll but adjust padding slightly) */
  .glass-table th, 
  .glass-table td {
    padding: 0.8rem 0.5rem;
    font-size: 0.9rem;
  }
  
  /* Toasts */
  .toast {
    left: 20px;
    right: 20px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    text-align: center;
    z-index: 10000;
  }
}
