/* =============================================
   VAYU MITRA — Merged Design System (Shotokan Red - Dark Mode Only)
   ============================================= */

:root {
  --c-primary:          #c62828; 
  --c-primary-dark:     #8e0000;
  --c-primary-subtle:   rgba(198,40,40,0.08);
  --c-primary-fixed:    #ffcdd2;
  --c-secondary:        #1b6d24;
  --c-secondary-subtle: rgba(27,109,36,0.1);
  --c-success:          #16a34a;
  --c-success-subtle:   rgba(22,163,74,0.1);
  --c-warning:          #ea580c;
  --c-warning-subtle:   rgba(234,88,12,0.1);
  --c-error:            #ba1a1a;
  --c-error-subtle:     rgba(186,26,26,0.1);

  /* FIXED: Hardcoded Dark Mode variables as the default */
  --bg-body:        #0d1117;
  --bg-card:        #161b22;
  --bg-card-alt:    #1c2129;
  --bg-input:       rgba(255,255,255,0.06);
  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #6e7681;
  --border:         rgba(255,255,255,0.12);
  --border-light:   rgba(255,255,255,0.06);
  --shadow-sm:      0 1px 4px rgba(0,0,0,0.4);
  --shadow-md:      0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:      0 12px 32px rgba(0,0,0,0.6);
  --shadow-glow:    0 0 20px rgba(198,40,40,0.25);

  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  --transition: 0.22s cubic-bezier(0.4,0,0.2,1);
  --font-head:  'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --font-body:  'Manrope', ui-sans-serif, system-ui, sans-serif;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:80px; }

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

@keyframes fadeUp { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }

.page-section { display:none; }
.page-section.active { display:block; animation: fadeUp 0.35s ease; }
.vm-container { max-width:1280px; margin:0 auto; padding:32px 24px 60px; }

/* Header */
.vm-header {
  position: sticky; top: 0; z-index: 1000;
  width: 100%; max-width: 100vw;
}

.vm-header::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(142, 0, 0, 0.3); 
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px); 
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: var(--shadow-md);
  z-index: -1;
  pointer-events: none;
}
.vm-header-inner {
  max-width:1280px; margin:0 auto;
  padding:0 24px; height:68px;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
}
.vm-logo { display:flex; align-items:center; gap:12px; text-decoration:none; color:#fff; flex-shrink:0; min-width: 0; }
.vm-logo-icon { width:42px; height:42px; border-radius:12px; background:rgba(255,255,255,0.12); border:1px solid rgba(255,255,255,0.25); display:flex; align-items:center; justify-content:center; color:#fff; }
.vm-logo-name { font-family:var(--font-head); font-size:1.2rem; font-weight:800; letter-spacing:-0.02em; }
.vm-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav */
.vm-nav { display:flex; align-items:center; gap:4px; }
.vm-nav-link { display:inline-flex; align-items:center; gap:7px; padding:9px 16px; border-radius:10px; font-size:0.875rem; font-weight:600; color:rgba(255,255,255,0.8); text-decoration:none; transition: all 0.2s; }
.vm-nav-link:hover { background:rgba(255,255,255,0.12); color:#fff; }
.vm-nav-link.active { background:rgba(255,255,255,0.95); color:var(--c-primary); }
.vm-header-actions { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.vm-mobile-menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #fff; cursor: pointer; flex-shrink: 0; }

/* Mobile Navigation */
@media (max-width: 768px) {
  .vm-mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
  
  .vm-nav { 
    display: none; 
    flex-direction: column; 
    position: absolute; 
    top: 68px; 
    left: 0; 
    right: 0; 
    background: rgba(142, 0, 0, 0.3); 
    backdrop-filter: blur(24px); 
    -webkit-backdrop-filter: blur(24px); 
    border-bottom: 1px solid rgba(255,255,255,0.12);
    padding: 16px; 
    z-index: 999; 
    box-shadow: 0 12px 32px rgba(0,0,0,0.4); 
  }
  
  .vm-nav.open { display: flex; gap: 8px; }

  .vm-nav-link {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  }
}

@media (max-width: 480px) {
  .vm-header-inner {
    padding: 0 12px;
    gap: 8px;
  }
  .vm-logo-name {
    font-size: 1.05rem; 
  }
}

/* Buttons */
.btn-vm { display:inline-flex; align-items:center; gap:8px; padding:12px 24px; border-radius:var(--radius-md); font-family:var(--font-body); font-size:0.9rem; font-weight:700; cursor:pointer; border:none; transition: all 0.2s; }
.btn-vm-primary { background:linear-gradient(135deg,var(--c-primary),var(--c-primary-dark)); color:#fff; box-shadow:0 4px 14px rgba(198,40,40,0.35); }
.btn-vm-primary:hover { transform:translateY(-2px); box-shadow:0 6px 20px rgba(198,40,40,0.5); }
.btn-vm-outline { background:transparent; color:var(--text-primary); border:2px solid var(--border); }
.btn-vm-outline:hover { background:var(--c-primary-subtle); border-color:var(--c-primary); color:var(--c-primary); }
.btn-vm-outline.active { background:var(--c-primary); color:#fff; border-color:var(--c-primary); }
.btn-vm-danger { background:var(--c-error-subtle); color:var(--c-error); border:2px solid rgba(186,26,26,0.25); }
.btn-vm-lg { padding:15px 32px; font-size:1rem; border-radius:16px; }
.btn-vm-sm { padding:8px 16px; font-size:0.8rem; border-radius:10px; }
.btn-vm-full { width:100%; justify-content:center; }
.vm-btn-row { display:flex; gap:12px; flex-wrap:wrap; }

/* Cards & Layout */
.vm-pill { display:inline-block; padding:5px 16px; border-radius:var(--radius-full); background:var(--c-primary-subtle); color:var(--c-primary); font-size:0.75rem; font-weight:700; text-transform:uppercase; margin-bottom:16px; }
/* FIXED: Using native dark mode background for the hero */
.vm-hero { position:relative; overflow:hidden; border-radius:var(--radius-2xl); background:radial-gradient(circle at top right,rgba(198,40,40,0.25) 0%,var(--bg-body) 65%); margin-bottom:32px; padding:56px 48px; }
.vm-hero-title { font-family:var(--font-head); font-size:clamp(2.2rem,5vw,4.2rem); font-weight:800; margin-bottom:20px; }
.vm-text-primary { color:var(--c-primary); }
.vm-form-card { background:var(--bg-card); border-radius:var(--radius-xl); padding:36px; margin-bottom:28px; box-shadow:var(--shadow-sm); border:1px solid var(--border-light); }
.vm-form-header { display:flex; align-items:center; gap:16px; margin-bottom:28px; padding-bottom:24px; border-bottom:1px solid var(--border-light); }
.vm-form-header-icon { width:52px; height:52px; border-radius:14px; background:var(--c-primary-subtle); display:flex; align-items:center; justify-content:center; }
.vm-section-title { font-family:var(--font-head); font-size:1.4rem; font-weight:700; }
.vm-section-sub { font-size:0.9rem; color:var(--text-muted); margin-top:4px; }
.hub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(198,40,40,0.3); }

/* Forms */
.vm-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media(max-width:640px) { .vm-grid-2 { grid-template-columns:1fr; } }
.vm-field-full { grid-column:1/-1; }
.vm-field { display:flex; flex-direction:column; gap:6px; }
.vm-label { font-size:0.8rem; font-weight:700; text-transform:uppercase; color:var(--text-secondary); }
/* FIXED: Input natively uses dark mode input background */
.vm-input { width:100%; padding:14px 18px; background:var(--bg-input); border:2px solid transparent; border-radius:var(--radius-md); font-family:var(--font-body); font-size:0.95rem; color:var(--text-primary); outline:none; }
.vm-input:focus { border-color:var(--c-primary); background:var(--bg-card); }
.vm-select { appearance:none; padding-right:44px; cursor:pointer; }
.vm-upload-icon-wrap { width:64px; height:64px; background:var(--c-primary-fixed); border-radius:50%; display:flex; align-items:center; justify-content:center; margin:0 auto 16px; }

/* Lists & Dash */
.report-list { list-style:none; padding:0; display:flex; flex-direction:column; gap:14px; }
.report-item { background:var(--bg-card-alt); border-radius:var(--radius-lg); padding:24px; border:1px solid var(--border-light); transition: transform 0.2s; }
.report-item:hover { transform:translateX(4px); border-color:rgba(198,40,40,0.2); }
.report-title { font-size:1rem; font-weight:700; color:var(--text-primary); }
.vote-btn { padding:9px 18px; border-radius:10px; border:1px solid var(--border); background:transparent; color:var(--text-secondary); font-weight:600; cursor:pointer; }
.vote-btn:hover { background:var(--c-primary-subtle); color:var(--c-primary); border-color:var(--c-primary); }
.vm-dash-header { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:28px; flex-wrap:wrap; }
.vm-dash-title { font-family:var(--font-head); font-size:1.9rem; font-weight:800; }

/* Login */
.vm-login-wrap { display:flex; align-items:center; justify-content:center; min-height:calc(100vh - 180px); padding:40px 24px; }
.vm-login-card { background:var(--bg-card); border-radius:var(--radius-xl); padding:48px; width:100%; max-width:440px; box-shadow:var(--shadow-lg); border:1px solid var(--border-light); text-align:center; }

/* Leaderboard */
.leaderboard-rank { font-size: 1.5rem; font-weight: 800; color: var(--text-muted); width: 40px; text-align: center; }
.rank-1 { color: #fbbf24; font-size: 2rem; } 
.rank-2 { color: #94a3b8; font-size: 1.8rem; } 
.rank-3 { color: #b45309; font-size: 1.6rem; } 

/* ===== KUMITE BRACKET UI ===== */
.bracket-wrapper { overflow-x: auto; padding: 24px 0; }
.bracket { display: flex; gap: 40px; min-width: max-content; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 20px; width: 220px; }
.bracket-match {
  background: var(--bg-card); border: 2px solid var(--border-light);
  border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm);
}
.bracket-slot {
  padding: 12px 16px; font-size: 0.9rem; font-weight: 700;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border-light); cursor: pointer; transition: 0.2s;
}
.bracket-slot:last-child { border-bottom: none; }
.bracket-slot:hover:not(.empty) { background: var(--c-primary-subtle); color: var(--c-primary); }
.bracket-slot.empty { color: var(--text-muted); background: var(--bg-card-alt); cursor: not-allowed; }
.bracket-slot.winner { background: var(--c-success-subtle); color: var(--c-success); }

/* Modals & Toast */
.vm-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; z-index: 9999; opacity: 0; }
.vm-modal-overlay.show { display: flex; opacity: 1; }
.vm-modal-card { background: var(--bg-card); width: 100%; max-width: 500px; border-radius: var(--radius-xl); padding: 32px; position: relative; }
.vm-modal-close { position: absolute; top: 20px; right: 20px; background: var(--bg-card-alt); border: none; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; text-align: center; }
.calendar-day-header { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; }
.calendar-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-weight: 600; background: var(--bg-card-alt); border: 1px solid var(--border-light); }

/* Calendar Colors */
.day-present { background: rgba(22, 163, 74, 0.15) !important; color: var(--c-success); border-color: var(--c-success) !important; }
.day-absent { background: rgba(186, 26, 26, 0.15) !important; color: var(--c-error); border-color: var(--c-error) !important; }
.day-holiday { background: rgba(37, 99, 235, 0.15) !important; color: #2563eb; border-color: #2563eb !important; } 

.toast { position:fixed; bottom:28px; right:28px; z-index:9000; display:flex; align-items:center; gap:12px; padding:14px 22px; border-radius:var(--radius-md); background:rgba(15,23,42,0.96); color:#fff; transform:translateX(140%); transition:transform 0.3s; font-weight:500; }
.toast.show { transform:translateX(0); }

@media (max-width:480px) {
  .toast { left:16px; right:16px; min-width:auto; }
  .vm-login-card { padding:32px 24px; }
  .vm-form-card  { padding:24px 20px; }
  .vm-hero { padding:32px 20px; }
}