/* JudoKidsVideo - Modern Web App Stylesheet v3.0 */

:root {
  --primary: #2b7eff;
  --primary-dark: #1e5fcc;
  --primary-light: #4d96ff;
  --bg-dark: #0a1428;
  --bg-darker: #050b1c;
  --bg-card: rgba(15, 28, 56, 0.9);
  --bg-card-hover: rgba(25, 45, 85, 0.95);
  --border: rgba(43, 126, 255, 0.2);
  --text: #ffffff;
  --text-muted: #94a3c0;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;
  --success: #22c55e;
  --error: #ef4444;
  --warning: #f5a623;
  --header-h: 64px;
  --bottom-nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
*:focus { outline: none; }
*:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans Georgian', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #050b1f 0%, #0a1428 50%, #0d1f3d 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 20, 40, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.nav-container { display: flex; align-items: center; gap: 24px; height: 100%; padding: 0 20px; max-width: 1280px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; flex-shrink: 0; }
.logo img { width: 36px; height: 36px; border-radius: 8px; }
.logo span b { color: var(--primary); }

.main-nav { display: flex; gap: 4px; flex: 1; justify-content: center; align-items: center; }
.main-nav a {
  padding: 8px 14px; border-radius: 10px;
  color: var(--text); font-weight: 500; font-size: 14px;
  transition: all 0.2s; position: relative;
}
.main-nav a:hover { background: rgba(43, 126, 255, 0.12); color: var(--primary-light); }
.main-nav a.active { background: var(--primary); color: white; }

.nav-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.lang-switcher { display: flex; gap: 2px; background: rgba(255,255,255,0.06); padding: 3px; border-radius: 8px; }
.lang-switcher a { padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; color: var(--text-muted); }
.lang-switcher a.active { background: var(--primary); color: white; }

.btn-login, .btn-user, .btn-admin, .btn-logout {
  padding: 8px 16px; border-radius: 10px; font-weight: 600; font-size: 13px;
  background: var(--primary); color: white; transition: all 0.2s; white-space: nowrap;
}
.btn-login:hover, .btn-user:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-admin { background: var(--warning); }
.btn-logout { background: transparent; border: 1px solid var(--border); }
.user-menu { display: flex; gap: 6px; align-items: center; }

.menu-toggle {
  display: none; background: none; border: none; color: white; cursor: pointer;
  width: 40px; height: 40px; border-radius: 10px; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.menu-toggle:hover, .menu-toggle.open { background: rgba(255,255,255,0.08); }
.menu-toggle svg { width: 24px; height: 24px; }

/* ============ MOBILE SIDE NAV ============ */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 99; opacity: 0; transition: opacity 0.3s; }
.mobile-overlay.open { display: block; opacity: 1; }

.mobile-side-nav {
  position: fixed; top: 0; right: -85%; width: 80%; max-width: 320px; height: 100vh;
  background: linear-gradient(180deg, var(--bg-darker), var(--bg-dark));
  z-index: 101; transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.4);
}
.mobile-side-nav.open { right: 0; }
.mobile-side-header { padding: 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.mobile-side-header .logo { font-size: 18px; }
.mobile-side-close { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.08); border: 0; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mobile-side-close svg { width: 20px; height: 20px; }
.mobile-side-content { flex: 1; overflow-y: auto; padding: 14px 0; }
.mobile-side-nav a.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; color: var(--text);
  border-left: 3px solid transparent; transition: all 0.15s; font-size: 15px;
}
.mobile-side-nav a.nav-item:hover { background: rgba(43,126,255,0.1); }
.mobile-side-nav a.nav-item.active { background: rgba(43,126,255,0.15); border-left-color: var(--primary); color: var(--primary-light); }
.mobile-side-nav a.nav-item .ico { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mobile-side-nav a.nav-item .ico svg { width: 100%; height: 100%; }
.mobile-side-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.mobile-side-footer .lang-switcher { width: 100%; }
.mobile-side-footer .lang-switcher a { flex: 1; text-align: center; padding: 8px; }

/* ============ BOTTOM NAV (Mobile only) ============ */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-h);
  background: rgba(5, 12, 28, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--border); z-index: 98;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-inner { display: flex; height: var(--bottom-nav-h); }
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--text-muted); font-size: 10px; font-weight: 600;
  position: relative; transition: color 0.15s;
}
.bottom-nav a svg { width: 22px; height: 22px; transition: transform 0.15s; }
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active svg { transform: translateY(-2px); }
.bottom-nav a.active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--primary); border-radius: 0 0 3px 3px; }

main.main-content { min-height: calc(100vh - var(--header-h) - 100px); }

/* ============ HERO ============ */
.hero {
  padding: 60px 0;
  background:
    radial-gradient(circle at 80% 50%, rgba(43, 126, 255, 0.15), transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0.3) 0%, transparent 100%);
}
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: 88px; font-weight: 800; line-height: 1; letter-spacing: -2px; margin-bottom: 20px; }
.hero h1 .blue { color: var(--primary); }
.hero h1 .play-icon { display: inline-block; width: 56px; height: 56px; background: var(--primary); border-radius: 50%; position: relative; vertical-align: middle; margin-left: 10px; }
.hero h1 .play-icon::before { content: ''; position: absolute; top: 50%; left: 60%; transform: translate(-50%, -50%); border-left: 16px solid white; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.hero p { color: var(--text-muted); font-size: 17px; max-width: 480px; margin-bottom: 30px; }
.hero-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.hero-feature { text-align: center; padding: 12px 4px; }
.hero-feature .icon { width: 44px; height: 44px; margin: 0 auto 8px; background: rgba(43, 126, 255, 0.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.hero-feature .icon svg { width: 22px; height: 22px; fill: var(--primary); }
.hero-feature strong { display: block; font-size: 13px; margin-bottom: 3px; }
.hero-feature span { font-size: 11px; color: var(--text-muted); }
.btn-primary { display: inline-flex; align-items: center; gap: 10px; background: var(--primary); padding: 14px 24px; border-radius: 12px; font-weight: 600; color: white; transition: all 0.2s; }
.btn-primary::before { content: '▶'; font-size: 11px; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(43, 126, 255, 0.4); }
.hero-img {
  height: 460px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(43, 126, 255, 0.3), rgba(43, 126, 255, 0.05));
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

/* ============ SECTIONS ============ */
section { padding: 50px 0; }
.section-title { font-size: 30px; font-weight: 800; margin-bottom: 6px; }
.section-subtitle { color: var(--text-muted); margin-bottom: 28px; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }

/* ============ CARDS ============ */
.comp-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: all 0.25s; display: block; }
.comp-card:hover, .comp-card:active { transform: translateY(-3px); border-color: var(--primary); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.comp-card .img { height: 160px; background: linear-gradient(135deg, var(--primary), #1a4080); position: relative; }
.comp-card .badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); }
.comp-card .badge.live { background: var(--error); animation: pulse 1.5s infinite; }
.comp-card .badge.upcoming { background: var(--primary); }
.comp-card .badge.finished { background: #475569; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.comp-card .info { padding: 14px; }
.comp-card h3 { font-size: 15px; margin-bottom: 6px; }
.comp-card .meta { font-size: 12px; color: var(--text-muted); }

.video-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: all 0.2s; }
.video-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.video-card .thumb { aspect-ratio: 16/9; background: #1a2540; position: relative; }
.video-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-card .thumb::after { content: '▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 22px; background: rgba(43, 126, 255, 0.9); width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.video-card .info { padding: 12px; }
.video-card h4 { font-size: 13px; margin-bottom: 4px; }
.video-card .meta { font-size: 11px; color: var(--text-muted); }

.club-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-align: center; transition: all 0.2s; display: block; }
.club-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.club-card .logo-circle { width: 70px; height: 70px; background: var(--primary); border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 800; }
.club-card h3 { font-size: 16px; margin-bottom: 4px; }
.club-card .city { color: var(--text-muted); font-size: 13px; margin-bottom: 12px; }
.club-card .stats { display: flex; justify-content: space-around; padding-top: 12px; border-top: 1px solid var(--border); }
.club-card .stats div { display: flex; flex-direction: column; font-size: 11px; color: var(--text-muted); }
.club-card .stats strong { font-size: 16px; color: var(--text); margin-bottom: 2px; }

/* ============ BRACKETS ============ */
.bracket { display: flex; gap: 24px; overflow-x: auto; padding: 16px 0; -webkit-overflow-scrolling: touch; }
.bracket-round { display: flex; flex-direction: column; justify-content: space-around; gap: 16px; min-width: 200px; }
.bracket-match { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px; min-height: 70px; }
.bracket-match .row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.bracket-match .row:last-child { border-bottom: none; }
.bracket-match .row.winner { color: var(--gold); font-weight: 700; }

.rank-1 { color: var(--gold); font-weight: 800; }
.rank-2 { color: var(--silver); font-weight: 700; }
.rank-3 { color: var(--bronze); font-weight: 700; }

/* ============ FORMS ============ */
.form-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 30px; max-width: 440px; margin: 30px auto; }
.form-card h2 { margin-bottom: 20px; text-align: center; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], input[type="date"], input[type="url"], select, textarea {
  width: 100%; padding: 11px 14px; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-size: 14px; font-family: inherit; transition: border-color 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: rgba(0,0,0,0.4); }

/* ============ BUTTONS ============ */
.btn, button { display: inline-block; padding: 11px 20px; background: var(--primary); color: white; border: none; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; transition: all 0.2s; font-family: inherit; text-decoration: none; line-height: 1.4; }
.btn:hover, button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active, button:active { transform: translateY(0); }
.btn-full { width: 100%; }
.btn-secondary { background: rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: var(--error); }
.btn-danger:hover { background: #b91c1c; }

/* ============ ALERTS ============ */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.alert-error { background: rgba(220, 38, 38, 0.15); border: 1px solid rgba(220, 38, 38, 0.3); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.15); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; background: var(--bg-card); border-radius: 12px; border: 1px solid var(--border); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
table th { background: rgba(0,0,0,0.3); font-weight: 600; color: var(--text-muted); text-transform: uppercase; font-size: 11px; letter-spacing: 0.5px; }
table tr:hover { background: rgba(43, 126, 255, 0.05); }

/* ============ STATS ============ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; text-align: center; }
.stat-card .num { font-size: 30px; font-weight: 800; color: var(--primary); }
.stat-card .label { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

.live-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; margin: 20px 0; }
.live-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* ============ ADMIN ============ */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: rgba(5, 12, 28, 0.95); border-right: 1px solid var(--border); padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-sidebar .logo { padding: 0 20px; margin-bottom: 20px; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a { padding: 11px 20px; color: var(--text-muted); font-size: 13px; border-left: 3px solid transparent; transition: all 0.15s; }
.admin-sidebar nav a:hover { background: rgba(43, 126, 255, 0.1); color: var(--text); }
.admin-sidebar nav a.active { background: rgba(43, 126, 255, 0.15); color: var(--primary); border-left-color: var(--primary); }
.admin-content { padding: 28px; max-width: 100%; overflow-x: hidden; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.admin-header h1 { font-size: 24px; }

/* ============ FOOTER ============ */
.site-footer { background: rgba(0,0,0,0.4); border-top: 1px solid var(--border); padding: 50px 0 20px; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; margin-bottom: 24px; }
.footer-grid h4 { margin-bottom: 12px; font-size: 12px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.footer-grid a { display: block; color: var(--text-muted); font-size: 13px; margin-bottom: 6px; }
.footer-grid a:hover { color: var(--primary); }
.footer-bottom { text-align: center; padding-top: 18px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero h1 { font-size: 60px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-img { display: none; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: relative; height: auto; }
}

@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-toggle { display: flex; }
  .nav-right .btn-login, .nav-right .user-menu, .nav-right .lang-switcher { display: none; }
  .bottom-nav { display: block; }
  body { padding-bottom: var(--bottom-nav-h); }
}

@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .container { padding: 0 14px; }
  .nav-container { padding: 0 14px; gap: 14px; }
  .logo span { font-size: 16px; }
  .logo img { width: 32px; height: 32px; }
  .hero { padding: 30px 0; }
  .hero h1 { font-size: 40px; }
  .hero p { font-size: 15px; }
  .hero-features { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero-feature .icon { width: 38px; height: 38px; }
  .hero-feature strong { font-size: 12px; }
  .hero-feature span { font-size: 10px; }
  .btn-primary { padding: 12px 20px; font-size: 14px; }
  section { padding: 28px 0; }
  .section-title { font-size: 22px; }
  .section-subtitle { font-size: 13px; }
  .section-header { flex-direction: column; align-items: flex-start; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: 12px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card .num { font-size: 22px; }
  .form-card { padding: 20px; margin: 16px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .table-wrap { font-size: 13px; }
  table th, table td { padding: 10px 12px; font-size: 13px; }
  .comp-card .img { height: 140px; }
  .admin-content { padding: 16px 14px; }
  .admin-header h1 { font-size: 20px; }
  .btn { padding: 10px 16px; font-size: 13px; }
  .form-group { margin-bottom: 12px; }
  input, select, textarea { padding: 12px 14px; font-size: 16px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 32px; }
  .hero h1 .play-icon { width: 44px; height: 44px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .lang-switcher a { padding: 6px 10px; }
}

/* PWA standalone */
@media (display-mode: standalone) {
  .site-header { padding-top: env(safe-area-inset-top); height: calc(var(--header-h) + env(safe-area-inset-top)); }
}

/* Smooth scroll prevention on overlay open */
body.menu-open { overflow: hidden; }


/* === Hero Grid Responsive (added) === */
.hero-grid { display:grid; grid-template-columns:1fr 1fr; gap:40px; align-items:center; padding:40px 0; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns:1fr; gap:20px; padding:20px 0; }
  .ad-banner-frame { max-width:480px; margin:0 auto; }
}
@media (min-width: 1600px) {
  .hero-grid { gap:60px; padding:60px 0; }
}


/* === AUTO-SIZE IMAGES IN CARDS (added) === */
/* Competition cards — image at natural ratio */
.comp-card .img {
  height: auto !important;
  aspect-ratio: 16/9;
  background-size: contain !important;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #0e1f3a;
}

/* Video cards — use contain instead of cover */
.video-card .thumb img {
  object-fit: contain !important;
  background: #0e1f3a;
}

/* News cards — full image visible */
.news-card .img {
  height: auto !important;
  aspect-ratio: 16/9;
  background-size: contain !important;
  background-repeat: no-repeat;
  background-position: center;
  background-color: #0e1f3a;
}

/* Club cards / logos */
.club-card .logo,
.club-logo {
  object-fit: contain !important;
}

/* Any generic card with image */
.card-img,
[class*="card"] [class*="img"] img {
  object-fit: contain !important;
}
