/* ===================================================
   FCK Dashboard – styles.css  |  2026 Rewrite
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;900&family=Barlow:wght@400;500;600&display=swap');

:root {
  --bg:         #070c12;
  --bg-2:       #0c1520;
  --bg-3:       #101d2b;
  --surface:    rgba(255,255,255,0.04);
  --surface-2:  rgba(255,255,255,0.07);
  --border:     rgba(255,255,255,0.07);
  --border-2:   rgba(255,255,255,0.12);
  --text:       #dde4ec;
  --muted:      rgba(221,228,236,0.45);
  --red:        #e30613;
  --red-glow:   rgba(227,6,19,0.25);
  --red-dim:    rgba(227,6,19,0.12);
  --green:      #22c55e;
  --yellow:     #f59e0b;
  --nav-h:      60px;
  --radius:     12px;
  --radius-sm:  8px;
  --tr: 0.28s cubic-bezier(0.4,0,0.2,1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--red) transparent;
}
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 4px; }

body {
  font-family: 'Barlow', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}
body.loaded { opacity: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Noise overlay ────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Top Nav ──────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(7,12,18,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 0;
}

.topnav-brand {
  display: flex; align-items: center; gap: 12px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem; font-weight: 900;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: #fff; margin-right: 32px;
}
.topnav-brand img {
  width: 32px; height: 32px; object-fit: contain;
}
.topnav-brand span { color: var(--red); }

.topnav-links {
  display: flex; align-items: center; gap: 4px; flex: 1;
}
.topnav-links a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  transition: color var(--tr), background var(--tr);
}
.topnav-links a:hover { color: var(--text); background: var(--surface); }
.topnav-links a.active { color: #fff; background: var(--red-dim); border: 1px solid rgba(227,6,19,0.3); }
.topnav-links a i { font-size: 0.75rem; }

.topnav-back {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  padding: 6px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: color var(--tr), border-color var(--tr);
}
.topnav-back:hover { color: var(--text); border-color: var(--border-2); }

.menu-toggle {
  display: none; margin-left: auto;
  background: none; border: none; cursor: pointer;
  flex-direction: column; gap: 5px; padding: 4px;
}
.menu-toggle span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform var(--tr), opacity var(--tr);
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Dashboard Grid ───────────────────────────────── */
.dashboard {
  position: relative; z-index: 1;
  max-width: 1400px; margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  grid-template-rows: auto;
  gap: 16px;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color var(--tr);
  animation: cardIn 0.5s ease both;
}
.card:hover { border-color: var(--border-2); }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }

@keyframes highlightFlash {
  0%,100% { box-shadow: none; }
  40%      { box-shadow: 0 0 0 2px var(--red), 0 0 24px var(--red-glow); }
}
.highlight-effect { animation: highlightFlash 0.9s ease; }

.card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red);
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.card-title i { font-size: 0.65rem; opacity: 0.8; }

/* ── Tabelle ──────────────────────────────────────── */
#tabelle-box { grid-column: 1; grid-row: 1 / 3; }

table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  padding: 6px 8px; text-align: left;
  border-bottom: 1px solid var(--border);
}
tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  transition: background var(--tr);
}
tbody tr:hover { background: var(--surface); }
tbody td {
  padding: 6px 8px; font-size: 0.8rem;
}

.team-logo-small {
  width: 16px; height: 16px;
  object-fit: contain; vertical-align: middle;
  margin-right: 6px; border-radius: 2px;
}

.place-dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle;
}
.place-green .place-dot  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.place-yellow .place-dot { background: var(--yellow); box-shadow: 0 0 6px var(--yellow); }
.place-red    .place-dot { background: var(--red); box-shadow: 0 0 6px var(--red); }

.highlight-fck {
  background: rgba(227,6,19,0.08) !important;
  font-weight: 600; color: #fff;
}
.highlight-fck td:first-child { border-left: 2px solid var(--red); }

/* ── Next Match ───────────────────────────────────── */
#next-match-box { grid-column: 2; grid-row: 1; }

.match-vs {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; padding: 16px 0;
}
.match-team {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex: 1;
}
.match-team img {
  width: 56px; height: 56px; object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  transition: transform var(--tr);
}
.match-team img:hover { transform: scale(1.08); }
.match-team-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted); text-align: center;
}
.match-sep {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2rem; font-weight: 900; color: var(--red);
  letter-spacing: -0.05em;
}
.match-date-label {
  font-size: 0.78rem; color: var(--muted); text-align: center;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

/* Scoreaxis widget wrapper */
.widget-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #0f2c3f;
}

/* ── Upcoming & Last Matches ──────────────────────── */
#upcoming-match-box { grid-column: 2; grid-row: 2; }
#last-matches       { grid-column: 3; grid-row: 1; }

.match-list { display: flex; flex-direction: column; gap: 6px; }

.match-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.78rem; transition: background var(--tr), border-color var(--tr);
}
.match-item:hover { background: var(--surface-2); border-color: var(--border-2); }

.match-item .logo-wrap {
  width: 20px; height: 20px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.match-item img {
  width: 18px; height: 18px; object-fit: contain;
}
.match-item .teams {
  flex: 1; font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.match-item .score {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em;
  color: #fff; flex-shrink: 0;
}
.match-item .date-chip {
  font-size: 0.68rem; color: var(--muted);
  background: var(--bg-3); border-radius: 4px;
  padding: 2px 6px; flex-shrink: 0;
}

.match-item.cup   { border-left: 2px solid var(--green); }
.match-item.intl  { border-left: 2px solid #6b7280; }

/* ── Series ───────────────────────────────────────── */
#undefeated-series { grid-column: 3; grid-row: 2; }

.series-stat {
  text-align: center; padding: 12px 0 4px;
}
.series-num {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 4rem; font-weight: 900; line-height: 1;
  color: #fff; display: block;
}
.series-sub {
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em;
  text-transform: uppercase; display: block; margin-top: 4px;
}

.series-section-label {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
  margin: 8px 0 6px; display: block;
}

.series-grid {
  display: flex; flex-wrap: wrap; gap: 6px;
}

.series-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; position: relative; cursor: default;
}
.series-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
  transition: transform var(--tr);
}
.series-item:hover .series-circle { transform: scale(1.15); }
.series-win  { background: rgba(34,197,94,0.2);  border: 1.5px solid #22c55e; color: #22c55e; }
.series-draw { background: rgba(107,114,128,0.2); border: 1.5px solid #6b7280; color: #9ca3af; }

.series-item .opp-logo {
  width: 14px; height: 14px; object-fit: contain;
  border-radius: 50%; opacity: 0.7;
}

.series-tooltip {
  display: none;
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: #1a2535;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 0.72rem;
  white-space: nowrap; z-index: 50;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  line-height: 1.6;
}
.series-item:hover .series-tooltip { display: block; }

.series-highscore {
  font-size: 0.75rem; color: var(--muted); text-align: center;
  padding: 8px 12px; background: var(--surface);
  border-radius: var(--radius-sm); margin-top: 4px;
}

/* ── News box ─────────────────────────────────────── */
#news-box { grid-column: 1 / 4; }

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.news-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  transition: background var(--tr), border-color var(--tr);
  cursor: pointer;
}
.news-item:hover { background: var(--surface-2); border-color: var(--border-2); }
.news-item a { display: flex; gap: 10px; align-items: flex-start; width: 100%; }

.news-thumb {
  width: 56px; height: 56px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-3);
}
.news-thumb-placeholder {
  width: 56px; height: 56px; border-radius: 6px;
  background: var(--bg-3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.2rem;
}
.news-content { flex: 1; min-width: 0; }
.news-title {
  font-size: 0.82rem; font-weight: 600;
  color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.news-meta {
  font-size: 0.68rem; color: var(--muted);
  margin-top: 4px;
}

.news-more {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--red);
  margin-top: 8px; align-self: flex-end;
  transition: opacity var(--tr);
}
.news-more:hover { opacity: 0.75; }

/* ── Full News Page ───────────────────────────────── */
.news-page-grid {
  max-width: 900px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 10px;
}
.news-page-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border-radius: var(--radius);
  background: var(--bg-2); border: 1px solid var(--border);
  transition: background var(--tr), border-color var(--tr);
  animation: cardIn 0.4s ease both;
}
.news-page-item:hover { background: var(--bg-3); border-color: var(--border-2); }
.news-page-item a { display: flex; gap: 14px; align-items: flex-start; width: 100%; }
.news-page-item .news-thumb { width: 80px; height: 80px; }
.news-page-item .news-thumb-placeholder { width: 80px; height: 80px; font-size: 1.8rem; }
.news-page-item .news-title { font-size: 0.9rem; -webkit-line-clamp: 3; }

/* ── Footer ───────────────────────────────────────── */
.footer {
  position: relative; z-index: 1;
  text-align: center; font-size: 0.72rem;
  color: var(--muted); background: var(--bg);
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  line-height: 1.8;
}

/* ── Tooltip Modal (mobile) ───────────────────────── */
#tooltip-modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.tooltip-modal-content {
  position: relative;
  background: var(--bg-2); border: 1px solid var(--border-2);
  color: var(--text); padding: 20px 24px;
  border-radius: var(--radius);
  max-width: 90%; font-size: 0.85rem; line-height: 1.7;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.close-tooltip {
  position: absolute; top: 10px; right: 12px;
  background: none; border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; transition: color var(--tr);
}
.close-tooltip:hover { color: var(--red); }

/* ── Page Hero (news page) ────────────────────────── */
.page-hero {
  padding: 32px 20px 16px;
  max-width: 1400px; margin: 0 auto;
}
.page-hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900; letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}
.page-hero h1 span { color: var(--red); }
.page-label {
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); display: block; margin-bottom: 8px;
}
.news-page-wrapper {
  max-width: 1400px; margin: 0 auto; padding: 0 20px 48px;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1200px) {
  .dashboard {
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto;
  }
  #tabelle-box    { grid-column: 1; grid-row: 1 / 4; }
  #next-match-box { grid-column: 2; grid-row: 1; }
  #upcoming-match-box { grid-column: 2; grid-row: 2; }
  #last-matches   { grid-column: 2; grid-row: 3; }
  #undefeated-series { grid-column: 1 / 3; grid-row: 4; }
  #news-box       { grid-column: 1 / 3; grid-row: 5; }
}

@media (max-width: 768px) {
  .topnav-links { display: none; }
  .topnav-links.open {
    display: flex; flex-direction: column;
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    background: rgba(7,12,18,0.97);
    backdrop-filter: blur(16px);
    padding: 16px; gap: 4px; z-index: 99;
    border-bottom: 1px solid var(--border);
  }
  .menu-toggle { display: flex; }
  .topnav-back { display: none; }

  .dashboard {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  #tabelle-box,
  #next-match-box,
  #upcoming-match-box,
  #last-matches,
  #undefeated-series,
  #news-box { grid-column: 1; grid-row: auto; }

  .series-tooltip { display: none !important; }
  .news-grid { grid-template-columns: 1fr; }
}
