/* =============================================
   Football Data SL – Style v6.0.5 (Optimized UI)
   ============================================= */

/* ──────────────────────────────────────────────
   WRAPPER — Để trình duyệt tự động nhận font từ theme
   ────────────────────────────────────────────── */
.bdsl-wrap {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
    background: #fff;
    color: #333;
    font-size: 14px; /* Kích thước chữ cơ bản */
}

/* Reset layout con (bỏ ép buộc font-family ở đây) */
.bdsl-wrap *,
.bdsl-wrap *::before,
.bdsl-wrap *::after {
    box-sizing: border-box;
}

/* Ảnh trong plugin */
.bdsl-wrap img {
    display: block !important;
    max-width: none !important;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    vertical-align: middle;
}

/* ── Header ── */
.bdsl-header {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #0f172a; /* Màu dark navy hiện đại */
    color: #fff;
    padding: 14px 18px;
    flex-wrap: wrap;
    line-height: 1.4;
}
.bdsl-flag   { font-size: 20px; line-height: 1; flex-shrink: 0; }
.bdsl-title  { font-size: 15px; font-weight: 700; flex: 1; color: #fff; margin: 0; }
.bdsl-season { font-size: 12px; color: #cbd5e1; white-space: nowrap; }
.bdsl-badge-source {
    font-size: 11px;
    background: rgba(255,255,255,.15);
    color: #e2e8f0;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.bdsl-match-count {
    font-size: 12px;
    background: #10b981;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.bdsl-badge-upcoming {
    font-size: 12px;
    background: #f59e0b;
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Group label (World Cup, CL) ── */
.bdsl-group-label {
    background: #1e293b;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 18px;
    letter-spacing: 0.5px;
    border-top: 1px solid #0f172a;
}

/* ── No match ── */
.bdsl-no-match {
    padding: 30px 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* ── Table wrapper ── */
.bdsl-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ────────────────────────────────────────────
   BASE TABLE
   ──────────────────────────────────────────── */
.bdsl-table {
    width: 100%;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    min-width: 500px;
    table-layout: auto;
}
.bdsl-table th,
.bdsl-table td {
    padding: 10px 14px !important;
    text-align: center !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
    white-space: nowrap;
    background: transparent;
    line-height: 1.5;
    color: #334155;
}
.bdsl-table th {
    background: #f8fafc !important;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}
.bdsl-table tbody tr:hover { background: #f8fafc; }

/* Live row */
.bdsl-table tbody .row-live       { background: #fffbeb !important; }
.bdsl-table tbody .row-live:hover { background: #fef3c7 !important; }

/* ────────────────────────────────────────────
   ✅ LOGO + TÊN ĐỘI: THẲNG LỐI, KHÔNG RỚT DÒNG
   ──────────────────────────────────────────── */

.bdsl-bxh-table td.col-team {
    min-width: 180px;
    width: 100%;
}
.bdsl-match-table td.col-home,
.bdsl-match-table td.col-away {
    min-width: 140px;
    width: 40%;
}

/* Container bọc Logo + Chữ */
.team-name-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important; /* Khóa tuyệt đối không rớt dòng */
    width: 100%;
}

/* Cột Chủ nhà: Canh lề phải, Logo nằm sát lề giữa */
.bdsl-match-table td.col-home .team-name-wrap {
    flex-direction: row-reverse !important;
    justify-content: flex-start !important;
}

/* Cột Khách & BXH: Canh lề trái, Logo nằm sát lề giữa */
.bdsl-match-table td.col-away .team-name-wrap,
.bdsl-bxh-table td.col-team .team-name-wrap {
    flex-direction: row !important;
    justify-content: flex-start !important;
}

/* Tên đội bóng: Cắt chữ + thêm '...' nếu quá dài */
.team-name-wrap > span {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 150px; /* Độ rộng tối đa của chữ */
    font-weight: 500;
}

/* Logo đội bóng */
.team-crest {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    background: transparent !important;
}

/* ── BXH columns ── */
.bdsl-bxh-table .col-pos  { width: 40px; font-weight: 700; color: #0f172a; }
.bdsl-bxh-table .col-pts  { background: #f8fafc !important; font-weight: 700; color: #0f172a; font-size: 15px; }
.bdsl-bxh-table .col-form { min-width: 120px; }

.bdsl-bxh-table tr.zone-cl  .col-pos { border-left: 4px solid #3b82f6 !important; }
.bdsl-bxh-table tr.zone-el  .col-pos { border-left: 4px solid #f97316 !important; }
.bdsl-bxh-table tr.zone-rel .col-pos { border-left: 4px solid #ef4444 !important; }

/* ── Form dots (Phong độ) ── */
.form-dot {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px; /* Chuyển từ tròn sang vuông bo góc nhẹ */
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin: 0 2px;
    line-height: 1;
}
.f-w { background: #10b981; }
.f-d { background: #eab308; }
.f-l { background: #ef4444; }

/* ── Legend ── */
.bdsl-legend {
    display: flex;
    gap: 16px;
    padding: 10px 18px;
    background: #f8fafc;
    font-size: 12px;
    border-top: 1px solid #e2e8f0;
    flex-wrap: wrap;
}
.leg-cl  { color: #3b82f6; font-weight: 600; }
.leg-el  { color: #f97316; font-weight: 600; }
.leg-rel { color: #ef4444; font-weight: 600; }

/* ── Match table columns ── */
.bdsl-match-table .col-datetime { text-align: left !important; min-width: 72px; }

.match-time {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
    line-height: 1.2;
}
.time-live { color: #ef4444; animation: blink 1.4s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.4} }

.match-date { display: block; font-size: 12px; color: #64748b; line-height: 1.4; }

.round-badge {
    display: inline-block;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.vs-badge {
    display: inline-block;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}
.col-venue {
    color: #64748b;
    font-size: 12px;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Score box ── */
.col-score-center { min-width: 90px; }
.score-box {
    display: inline-block;
    background: #0f172a;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 6px;
    letter-spacing: 1px;
}
.home-win .score-box { background: #10b981; }
.away-win .score-box { background: #ef4444; }
.draw     .score-box { background: #eab308; color: #fff; }
.live .score-box, .live-box { background: #ef4444 !important; animation: blink 1.4s infinite; }
.winner { font-weight: 700; color: #0f172a; }

/* ── Footer ── */
.bdsl-footer {
    margin: 0;
    padding: 10px 18px;
    background: #f8fafc;
    font-size: 12px;
    color: #94a3b8;
    border-top: 1px solid #e2e8f0;
    line-height: 1.6;
    text-align: right;
}
.bdsl-footer a { color: #3b82f6; text-decoration: none; }
.bdsl-footer a:hover { text-decoration: underline; }

/* ── Error ── */
.bdsl-error {
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 14px;
    margin: 10px 0;
}

/* ════════════════════════════════════════════
   bdsl_all_ngay — Gom tất cả giải trong ngày
   ════════════════════════════════════════════ */
.bdsl-league-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #f0fdf4;
    border-top: 2px solid #bbf7d0;
    border-bottom: 1px solid #dcfce3;
    flex-wrap: wrap;
}
.bdsl-league-flag { font-size: 18px; line-height: 1; flex-shrink: 0; }
.bdsl-league-name { font-weight: 700; font-size: 14px; color: #0f172a; flex: 1; }
.bdsl-league-count {
    font-size: 11px;
    background: #86efac;
    color: #14532d;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
}
.bdsl-league-block:first-of-type .bdsl-league-divider { border-top: none; }
.bdsl-league-block .bdsl-table-wrap { border-bottom: 1px solid #f1f5f9; }

/* ── Nav bar điều hướng ngày ── */
.bdsl-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    gap: 10px;
}
.bdsl-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #0f172a;
    color: #fff !important;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .2s;
    cursor: pointer;
}
.bdsl-nav-btn:hover { background: #334155; }
.bdsl-nav-today {
    font-size: 14px;
    color: #475569;
    font-weight: 700;
    text-align: center;
    flex: 1;
}

/* ── Thông báo nghỉ giải ── */
.bdsl-break-msg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    text-align: center;
}
.bdsl-break-icon { font-size: 40px; line-height: 1; }
.bdsl-break-msg strong { font-size: 16px; color: #0f172a; }
.bdsl-break-sub { font-size: 13px; color: #64748b; line-height: 1.6; }
.bdsl-break-nav { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.bdsl-break-link {
    padding: 8px 18px;
    background: #0f172a;
    color: #fff !important;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .2s;
}
.bdsl-break-link:hover { background: #334155; }

/* ── Responsive (Điện thoại) ── */
@media (max-width: 640px) {
    .bdsl-table th,
    .bdsl-table td { padding: 8px 6px !important; }
    .team-crest { width: 20px !important; height: 20px !important; min-width: 20px !important; min-height: 20px !important; }
    .team-name-wrap > span { max-width: 90px; font-size: 13px; } /* Thu nhỏ text chữ trên mobile để chống rớt dòng */
    .col-venue { display: none; }
    .bdsl-bxh-table .col-form { display: none; } /* Ẩn phong độ trên mobile cho bớt chật */
    .bdsl-all-day .col-venue { display: none; }
    .score-box { padding: 4px 10px; font-size: 13px; }
    .bdsl-nav-btn { padding: 5px 10px; font-size: 11px; }
    .bdsl-nav-today { font-size: 13px; }
}
