/* ============================================================
   SimRace Liga Manager – Main CSS
   ============================================================ */

/* --- Reset & Base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:   #e8333a;
  --secondary: #f5a623;
  --tertiary:  #1a9fff;
  --bg:        #0a0a0f;
  --bg2:       #12121a;
  --bg3:       #1c1c28;
  --border:    #2a2a3a;
  --text:      #f0f0f5;
  --text2:     #8888a0;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --radius: 4px;
  --shadow: 0 4px 24px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* --- Layout ----------------------------------------------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
#app { padding-top: 64px; min-height: calc(100vh - 64px); }
.section { padding: 48px 0 40px; }

/* --- TOP NAV ---------------------------------------------- */
#top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  background: rgba(10,10,15,.96);
  backdrop-filter: blur(14px);
  border-bottom: 2px solid var(--primary);
  display: flex; align-items: center; height: 64px;
  gap: 0;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; text-decoration: none;
  min-width: 210px; flex-shrink: 0;
}
.brand-logo  { height: 38px; object-fit: contain; }
.brand-icon  {
  width: 38px; height: 38px; border-radius: var(--radius);
  background: var(--primary); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 900; color: #fff; font-size: 1.1rem;
  flex-shrink: 0;
}
.brand-text  { display: flex; flex-direction: column; }
.brand-name  { font-family: var(--font-display); font-size: 1.25rem; font-weight: 900; color: var(--text); letter-spacing: .04em; line-height: 1.1; }
.brand-sub   { font-size: .6rem; color: var(--primary); letter-spacing: .14em; text-transform: uppercase; }

.main-nav { display: flex; flex: 1; height: 100%; }
.main-nav a {
  display: flex; align-items: center; padding: 0 15px;
  font-family: var(--font-display); font-size: .9rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--text2); text-decoration: none;
  border-right: 1px solid var(--border);
  transition: color .18s, background .18s;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.active {
  color: var(--text); background: rgba(232,51,58,.1);
}

.nav-right { margin-left: auto; padding: 0 16px; display: flex; align-items: center; gap: 10px; }

/* Burger Button – 3 Streifen */
.nav-burger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 40px; height: 40px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; padding: 0;
  transition: border-color .2s;
}
.nav-burger:hover { border-color: var(--primary); }
.burger-bar {
  display: block; width: 20px; height: 2px;
  background: var(--text2); border-radius: 2px;
  transition: all .28s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
}
/* X-Animation wenn offen */
.nav-burger.open .burger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); background: var(--primary); }
.nav-burger.open .burger-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-burger.open .burger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); background: var(--primary); }

/* Mobile Overlay */
.mobile-nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 840;
  background: rgba(0,0,0,.5); backdrop-filter: blur(2px);
}
.mobile-nav-overlay.open { display: block; }

/* Mobile Nav – Slide-in von rechts */
.mobile-nav {
  display: flex; flex-direction: column;
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(320px, 85vw); z-index: 860;
  background: var(--bg2);
  border-left: 2px solid var(--primary);
  padding: 0; overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -8px 0 32px rgba(0,0,0,.4);
}
.mobile-nav.open { transform: translateX(0); }

/* Mobile Nav Header */
.mobile-nav::before {
  content: 'MENÜ';
  display: block;
  padding: 20px 24px 16px;
  font-family: var(--font-display); font-size: .72rem; font-weight: 900;
  letter-spacing: .22em; color: var(--primary);
  border-bottom: 1px solid var(--border);
}

/* Mobile Nav Links */
.mobile-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px;
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text2); font-size: 1rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  text-decoration: none;
  transition: color .15s, background .15s, padding-left .15s;
}
.mobile-nav a:hover, .mobile-nav a.active {
  color: var(--text);
  background: rgba(255,255,255,.04);
  padding-left: 30px;
}
.mobile-nav a.active { color: var(--primary); border-left: 3px solid var(--primary); }
.mnav-icon { font-size: 1rem; width: 22px; text-align: center; flex-shrink: 0; }
.mnav-divider { height: 1px; background: var(--border); margin: 8px 0; }
.mnav-admin {
  color: var(--primary) !important;
  background: rgba(232,51,58,.06);
}
.mnav-admin:hover { background: rgba(232,51,58,.14) !important; }

/* --- BUTTONS ---------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--radius);
  font-family: var(--font-display); font-size: .9rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  border: none; cursor: pointer; text-decoration: none;
  transition: filter .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); text-decoration: none; color: #fff; }
.btn-secondary { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); color: var(--text); text-decoration: none; }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-danger:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }
.btn-success   { background: #27ae60; color: #fff; }
.btn-success:hover { filter: brightness(1.1); text-decoration: none; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 6px 10px; }

/* --- CARDS ------------------------------------------------ */
.card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s;
}
.card:hover { border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); }
.card-header {
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-header h3 {
  font-family: var(--font-display); font-size: .95rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
}
.card-body { padding: 18px; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg3); }

/* --- SECTION TITLE ---------------------------------------- */
.section-title {
  font-family: var(--font-display); font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 4px;
}
.section-title span { color: var(--primary); }
.section-sub { color: var(--text2); margin-bottom: 28px; font-size: .95rem; }

/* --- HERO ------------------------------------------------- */
.hero {
  position: relative; height: calc(100vh - 64px); min-height: 480px;
  display: flex; align-items: center; overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg2) 55%, var(--bg) 100%);
}
.hero-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(232,51,58,.028) 40px, rgba(232,51,58,.028) 80px);
}
.hero-glow {
  position: absolute; top: 35%; right: 10%;
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(232,51,58,.22) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content { position: relative; z-index: 2; }
.hero h1 {
  font-family: var(--font-display); font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900; line-height: .9; letter-spacing: -.01em; text-transform: uppercase;
}
.hero h1 em { color: var(--primary); font-style: normal; display: block; }
.hero-sub { font-size: 1.1rem; color: var(--text2); margin: 20px 0 32px; max-width: 520px; font-weight: 300; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* --- GRID ------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2,1fr); }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .nav-admin-btn { display: none; }
  .nav-burger { display: flex; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --- NEWS CARD -------------------------------------------- */
.news-card { cursor: pointer; }
.news-card-img {
  width: 100%; height: 180px; overflow: hidden;
  background: var(--bg3); position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.news-card:hover .news-card-img img { transform: scale(1.04); }
.news-tag {
  position: absolute; top: 10px; left: 10px;
  background: var(--primary); color: #fff;
  font-family: var(--font-display); font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; border-radius: 2px;
}
.news-card-body { padding: 14px 16px; }
.news-date { font-size: .75rem; color: var(--text2); margin-bottom: 5px; letter-spacing: .04em; }
.news-card-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.news-excerpt { font-size: .86rem; color: var(--text2); line-height: 1.55; }
.news-read-more { font-family: var(--font-display); font-size: .78rem; font-weight: 700; color: var(--primary); letter-spacing: .06em; text-transform: uppercase; margin-top: 10px; }

/* --- TABLES ----------------------------------------------- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  font-family: var(--font-display); font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text2);
  padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.data-table tbody tr:hover td { background: rgba(255,255,255,.025); }
.data-table .pos-col { font-family: var(--font-display); font-weight: 900; font-size: 1.1rem; }
.pos-1 { color: var(--secondary); }
.pos-2 { color: #c0c0c0; }
.pos-3 { color: #cd7f32; }
.pts-col { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--primary); }
.gap-col { color: var(--text2); font-size: .84rem; }
.fl-badge { background: rgba(245,166,35,.15); color: var(--secondary); font-size: .68rem; font-weight: 700; padding: 2px 6px; border-radius: 2px; letter-spacing: .06em; margin-left: 6px; }
.team-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; flex-shrink: 0; }
.driver-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .72rem; margin-right: 8px; overflow: hidden; flex-shrink: 0;
}
.driver-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* --- RACE ITEM -------------------------------------------- */
.race-item {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; transition: border-color .2s;
}
.race-item:hover { border-color: var(--primary); }
.race-item.past { opacity: .6; }
.race-item.next-race { border-left: 3px solid var(--secondary); }
.race-round { font-family: var(--font-display); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); min-width: 55px; }
.race-track-name { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; }
.race-track-loc  { font-size: .8rem; color: var(--text2); }
.race-date-badge { font-family: var(--font-display); font-size: .85rem; color: var(--text2); text-align: right; min-width: 90px; }
.race-status { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 8px; border-radius: 2px; display: inline-block; }
.race-status.done     { background: rgba(144,144,168,.12); color: var(--text2); }
.race-status.next     { background: rgba(245,166,35,.18); color: var(--secondary); }
.race-status.upcoming { background: rgba(26,159,255,.12); color: var(--tertiary); }

/* --- TEAM CARD -------------------------------------------- */
.team-card-header { height: 90px; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.team-card-header img { max-height: 60px; object-fit: contain; }
.team-card-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; }
.driver-list { list-style: none; }
.driver-list li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.driver-list li:last-child { border-bottom: none; }
.driver-num { font-family: var(--font-display); font-weight: 900; font-size: 1rem; width: 26px; color: var(--primary); flex-shrink: 0; }

/* --- BADGES ----------------------------------------------- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 2px; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.badge-primary   { background: rgba(232,51,58,.18); color: var(--primary); }
.badge-secondary { background: rgba(245,166,35,.18); color: var(--secondary); }
.badge-info      { background: rgba(26,159,255,.13); color: var(--tertiary); }
.badge-success   { background: rgba(39,174,96,.15); color: #4cffb0; }
.badge-muted     { background: rgba(144,144,168,.12); color: var(--text2); }

/* --- STAT BOX --------------------------------------------- */
.stat-box { text-align: center; padding: 20px; }
.stat-number { font-family: var(--font-display); font-size: 2.8rem; font-weight: 900; color: var(--primary); line-height: 1; }
.stat-label  { font-size: .75rem; color: var(--text2); text-transform: uppercase; letter-spacing: .1em; margin-top: 5px; }

/* --- FORMS (PUBLIC) --------------------------------------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: .9rem; }
.alert-success { background: rgba(0,200,100,.08); border: 1px solid rgba(0,200,100,.25); color: #4cffb0; }
.alert-error   { background: rgba(200,50,50,.08); border: 1px solid rgba(200,50,50,.25); color: #ff8080; }
.alert-info    { background: rgba(26,159,255,.08); border: 1px solid rgba(26,159,255,.2); color: var(--tertiary); }

/* --- FOOTER ----------------------------------------------- */
footer {
  background: var(--bg2); border-top: 2px solid var(--border);
  padding: 40px 0 20px; margin-top: 60px;
}
.footer-inner {
  display: grid; grid-template-columns: 1fr auto;
  gap: 40px; align-items: start; margin-bottom: 24px;
}
.footer-league-name { font-family: var(--font-display); font-size: 1.8rem; font-weight: 900; }
.footer-league-abbr { font-size: .72rem; color: var(--primary); letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }
.footer-desc { color: var(--text2); font-size: .85rem; margin-top: 10px; max-width: 340px; line-height: 1.65; }
.social-links { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.social-link {
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text2); font-size: .9rem; transition: all .18s; text-decoration: none;
}
.social-link:hover { border-color: var(--primary); color: var(--primary); }
.footer-nav { display: flex; flex-direction: column; gap: 8px; }
.footer-nav-title { font-family: var(--font-display); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text2); margin-bottom: 4px; }
.footer-nav a { color: var(--text2); font-size: .88rem; transition: color .18s; }
.footer-nav a:hover { color: var(--text); text-decoration: none; }
.footer-copy { text-align: center; color: var(--text2); font-size: .78rem; padding-top: 20px; border-top: 1px solid var(--border); }

/* --- PAGINATION ------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 6px 14px; border-radius: var(--radius); font-family: var(--font-display); font-size: .88rem; font-weight: 700;
  border: 1px solid var(--border); color: var(--text2); text-decoration: none; transition: all .18s;
}
.pagination a:hover { border-color: var(--primary); color: var(--text); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- UTILITY ---------------------------------------------- */
.flex { display: flex; }
.flex-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.text-muted  { color: var(--text2); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-display { font-family: var(--font-display); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }.mb-2 { margin-bottom: 16px;}.mb-3 { margin-bottom: 24px;}.mb-4 { margin-bottom: 32px;}
.hidden { display: none; }
.overflow-x { overflow-x: auto; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.w-full { width: 100%; }
.rounded { border-radius: var(--radius); }
.uppercase { text-transform: uppercase; }

/* --- SCROLLBAR -------------------------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- ANIMATIONS ------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .35s ease both; }

@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(2.2rem, 10vw, 3.5rem); }
}

/* ============================================================
   Tab Sheets – wie Tabellenblätter
   ============================================================ */
.sheet-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 0 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
}
.sheet-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text2);
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  background: transparent;
  transition: all .18s;
  white-space: nowrap;
  user-select: none;
  position: relative;
  bottom: -2px;
}
.sheet-tab:hover { color: var(--text); background: var(--bg3); }
.sheet-tab.active {
  color: var(--text);
  background: var(--bg2);
  border-color: var(--border);
  border-bottom-color: var(--bg2);
}
.sheet-tab .tab-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
}
.sheet-panel { display: none; background: var(--bg2); border: 1px solid var(--border); border-top: none; border-radius: 0 0 4px 4px; }
.sheet-panel.active { display: block; }
.sheet-panel-inner { padding: 20px; }
