/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* Base Styles */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #222;
    line-height: 1.5;
}
.match-card .result {
    font-size: 1.3rem;   /* bigger */
    font-weight: 700;    /* bold */
    color: #000;         /* darker for emphasis */
    margin: 6px 0 8px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff;
    padding: 7px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    width: 90px;
    height: auto;
}

.f1-link {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    margin-left: auto;
}

.menu {
    display: flex;
    gap: 10px;
    align-items: center;
}

.menu a {
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #222;
    padding: 6px 10px;
    transition: color 0.3s ease;
}

.menu a:hover {
    color: #0056b3;
}

/* Responsive: Hamburger */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 10px;
        background: #fff;
        border: 1px solid #ccc;
        border-radius: 8px;
        padding: 10px;
        z-index: 1001;
    }

    .menu.show {
        display: flex;
    }

    .menu a {
        margin: 5px 0;
    }

    .navbar {
        flex-direction: row;
        padding: 15px;
    }

    .logo {
        width: 80px;
    }

    .f1-link {
        font-size: 14px;
    }
}

/* Main container and content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
    margin-top: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    font-size: 1.6rem;
    color: #000;
    text-align: center;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 30px;
    justify-content: center;
    width: 100%;
    max-width: 1198px;
    padding: 0 15px;
}

@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 0 10px;
    }

    .match-card {
        max-width: 95%;
    }
}

/* Match Card */
.match-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 7px;
    padding: 11px;
    text-align: center;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    max-width: 280px;
    margin-bottom: 10px;
}

.match-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.match-card h3 {
    margin: 5px 0 11px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-card p {
    margin: 3px 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flag-icon {
    width: 20px !important;
    height: 20px !important;
    margin-left: 8px !important;
    vertical-align: middle !important;
    position: relative !important;
    top: -2px !important;
}

/* Broadcast images */
.broadcast-images {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px;
}

.broadcast-image {
    width: 58px;
    height: 39px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #ddd;
    padding: 4px;
    background-color: #fafafa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.broadcast-image:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Section Titles */
.category-heading {
    font-size: 1.5rem;
    color: #222;
    margin: 25px 0 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Toggle button (▼) */
.toggle-button {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #222;
    transition: color 0.3s ease;
}

.toggle-button:hover {
    color: #0056b3;
}

.collapsed {
    display: none;
}

/* Match banners */
.match-card.overdue {
    opacity: 0.5;
    filter: grayscale(100%);
}

.live-banner {
    display: inline-block;
    background-color: #8c8686;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 3px;
    margin-bottom: 5px;
    animation: blink 1s infinite;
}

.ended-banner {
    display: inline-block;
    background-color: #4a4a4a;
    color: white;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 3px;
    margin-bottom: 5px;
}

.blinking-text {
    color: white;
    animation: blink 1s infinite;
    display: inline-block;
}

/* Blinking animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Table */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: #fff;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.styled-table th, .styled-table td {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.styled-table thead {
    background-color: #f1f1f1;
    font-weight: 600;
}

.styled-table tr:hover {
    background-color: #f9f9f9;
}
/* ========= Modern table look & mobile-friendly behavior ========= */
:root{
  --blue:#1d4ed8; --orange:#f59e0b; --red:#ef4444;
  --muted:#56627a; --ink:#0f172a; --border:#e0e0e0;
}

/* wrapper gets rounded corners + shadow */
.pl-wrapper{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 6px 14px rgba(0,0,0,.06);
  overflow:hidden;               /* keep radius on table header */
}

/* keep table usable on phones: horizontal swipe if needed */
.styled-table.modern-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size: clamp(13px, 2.8vw, 15px);  /* responsive text */
  min-width: 720px;                      /* prevents cramping on small screens */
}

/* header – soft gradient, no sticky (prevents overlap with first row) */
.styled-table.modern-table thead th{
  background: linear-gradient(180deg,#f7f8fb 0%, #f1f2f6 100%);
  padding:12px 10px;
  font-weight:700; color:#111827;
  border-bottom:1px solid var(--border);
  text-align:left; user-select:none;
}

/* cells */
.styled-table.modern-table td{
  padding:12px 10px;
  border-bottom:1px solid var(--border);
}
.styled-table.modern-table tbody tr:nth-child(odd){ background:#fff; }
.styled-table.modern-table tbody tr:nth-child(even){ background:#fbfbfd; }
.styled-table.modern-table tbody tr:hover{ background:#f7f8fb; }

/* Position chip – ensure “1” always visible */
.pos{
  min-width:44px; height:30px; display:grid; place-items:center;
  border:1px solid #cbd5e1; background:#ffffff; color:#0f172a;
  font-weight:800; border-radius:10px; line-height:1; letter-spacing:.2px;
}
.pos.top4{ box-shadow:0 0 0 2px rgba(29,78,216,.18) inset; }
.pos.europa{ box-shadow:0 0 0 2px rgba(245,158,11,.25) inset; }
.pos.releg{ box-shadow:0 0 0 2px rgba(239,68,68,.22) inset; }

/* Row highlights with subtle tint + left border */
.hl-top4{ border-left:4px solid rgba(29,78,216,.9); background:linear-gradient(90deg,rgba(29,78,216,.05),transparent) }
.hl-europa{ border-left:4px solid rgba(245,158,11,.95); background:linear-gradient(90deg,rgba(245,158,11,.06),transparent) }
.hl-releg{ border-left:4px solid rgba(239,68,68,.95); background:linear-gradient(90deg,rgba(239,68,68,.06),transparent) }

/* Team cell */
.club{ display:flex; align-items:center; gap:10px; white-space:nowrap; }
.crest{
  width:26px; height:26px; border-radius:8px; background:#fff;
  border:1px solid var(--border); object-fit:contain;
}
.team-name{ font-weight:600; color:#111827; }

/* Performance bar */
.perf-wrap{ display:flex; align-items:center; gap:10px }
.bar{
  position:relative; flex:1; height:10px; border-radius:999px;
  background:#eef2ff; border:1px solid var(--border); overflow:hidden;
}
.bar > span{
  position:absolute; inset:0; width:0%;
  background:linear-gradient(90deg,#22c55e,#38bdf8);
  animation: barFill .7s ease forwards;
}
@keyframes barFill{ from{width:0%} to{ /* final width via inline style */ } }
.pct{ min-width:48px; text-align:right; font-variant-numeric:tabular-nums }

/* Qualification legend block */
.qualnote{
  margin-top:12px; padding:12px 14px; border:1px solid var(--border);
  border-radius:12px; background:#fff; color:#0f172a;
}
.qual-legend{ display:flex; gap:18px; flex-wrap:wrap; margin-top:6px; font-size:.95rem }
.dot{ display:inline-block; width:10px; height:10px; border-radius:999px; margin-right:6px; vertical-align:middle }
.dot-blue{ background:#1d4ed8 } .dot-orange{ background:#f59e0b } .dot-red{ background:#ef4444 }
.qual-hint{ color:var(--muted); margin:10px 0 0 }

/* -------- Mobile tweaks: show table (not cards) -------- */
@media (max-width:760px){
  /* table stays visible; wrapper enables swipe */
  .table-wrapper{ overflow-x:auto; -webkit-overflow-scrolling: touch; }
  .styled-table.modern-table{ min-width: 680px; }       /* narrower min width for small phones */
  .team-name{ max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
  .pct{ min-width: 42px; }
  .container{ padding: 8px; }                           /* a bit tighter */
}
/* Icon inside title */
.title-icon {
  width: 36px;
  height: 36px;
  vertical-align: middle;
  margin-right: 10;
  object-fit: contain;
}
/* Position with movement arrow */
/* Posição + movimento juntos */
.pos-with-move{
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:0 8px;
}
.pos-num{ line-height:1; }

/* Setas coloridas + animação */
.pos-move{
  font-size:0.95rem; line-height:1; font-weight:700;
  display:inline-block;
}
.pos-move.up{   color:#16a34a; animation: moveUp .9s ease-in-out infinite alternate; }
.pos-move.down{ color:#ef4444; animation: moveDown .9s ease-in-out infinite alternate; }
.pos-move.same{ color:#64748b; animation: pulse .9s ease-in-out infinite alternate; }

@keyframes moveUp   { from{transform:translateY(0);   opacity:.9} to{transform:translateY(-3px); opacity:1} }
@keyframes moveDown { from{transform:translateY(0);   opacity:.9} to{transform:translateY( 3px); opacity:1} }
@keyframes pulse    { from{transform:scale(1);        opacity:.7} to{transform:scale(1.08);   opacity:1} }
