body {
    font-family: 'Google Sans Flex', sans-serif;
}

.article-header h1 { font-size: 2.8rem; font-weight: bold; line-height: 1.2; }
.article-meta { color: #6c757d; }
.article-category { font-weight: bold; color: #6c757d; text-transform: uppercase; font-size: 0.9rem; }
.author-info img { width: 45px; height: 45px; }
.main-image { width: 100%; height: auto; border-radius: 24px; margin-bottom: 2rem; }
.article-content { line-height: 1.8; font-size: 1.15rem; color: #212529; }
.article-content img { max-width: 100%; height: auto; border-radius: 4px; margin: 1.5rem 0; }
.article-content blockquote { border-left: 4px solid #ccc; margin: 1.5rem 0; padding-left: 16px; font-style: italic; color: #6c757d; }
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }

/* -- Responsive Styles for Scoreboard on Mobile -- */
@media (max-width: 576px) {
    .team-badge {
        width: auto; /* Perkecil ukuran logo tim */
        height: 50px !important;
    }
    .team-name {
        font-size: 1rem !important; /* Perkecil font nama tim */
        word-wrap: break-word; /* Agar nama tim panjang bisa turun ke bawah */
    }
    .match-score {
        font-size: 1.2rem !important; /* Perkecil font skor */
    }
    .match-status {
        font-size: 0.8rem !important; /* Perkecil font status pertandingan */
    }
}

/* --- FINAL RESPONSIVE TIMELINE STYLES --- */
.timeline-final-wrapper {
    padding: 1rem 0;
    font-family: sans-serif;
}
.timeline-final-status {
    text-align: center;
    color: #6c757d;
    margin-top: 2rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.timeline-final-status i {
    margin-right: 8px;
}
.timeline-final-row {
    display: flex;
    align-items: center;
    min-height: 70px;
}
.player-side {
    width: 45%;
    display: flex;
    align-items: center;
    gap: 10px;
}
.player-left {
    justify-content: flex-end;
    text-align: right;
}
.player-right {
    justify-content: flex-start;
    text-align: left;
}
.minute-center {
    width: 10%;
    text-align: center;
    font-weight: 500;
    color: #888;
}
.event-details {
    display: flex;
    flex-direction: column;
}
.player-left .event-details {
    align-items: flex-end;
}
.player-right .event-details {
    align-items: flex-start;
}
.player-name {
    font-weight: 600;
    font-size: 1rem;
    color: #333;
}
.event-description {
    font-size: 0.85rem;
    color: #6c757d;
    text-transform: capitalize;
}
.sub-in {
    color: #28a745;
    font-weight: 500;
}
.event-icon {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.card-icon {
    display: inline-block;
    width: 12px;
    height: 16px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 2px;
}
.card-icon.yellow { background-color: #ffc107; }
.card-icon.red { background-color: #dc3545; }
.event-icon i.fa-futbol { color: #333; }

/* -- Responsive Styles for Mobile -- */
@media (max-width: 767px) {
    .event-description {
        display: block; /* Pastikan deskripsi tampil */
    }
    .player-side {
        width: 40%;
        padding: 10px 5px;
        gap: 8px;
    }
    .minute-center {
        width: 20%;
    }
    .player-name,
    .minute-center span {
        font-size: 0.9rem;
    }
    .timeline-final-wrapper .timeline-final-row:last-of-type {
        border-bottom: none;
    }
}

/* --- CLEAN STATS STYLES --- */
.stats-wrapper-clean {
    padding: 0.5rem;
}
.stat-row-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.stats-wrapper-clean .stat-row-clean:last-child {
    border-bottom: none;
}
.stat-value-clean {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    width: 20%;
    text-align: center;
}
.stat-label-clean {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    width: 60%;
}

/* --- CARD DETAILS STYLES --- */
.card-details .card-body {
    padding: 0.5rem 1rem;
}
.detail-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.card-details ul li:last-child {
    border-bottom: none;
}
.detail-icon {
    font-size: 1.1rem;
    color: #6c757d;
    margin-top: 5px;
    width: 25px;
    text-align: center;
}
.detail-text {
    margin-left: 10px;
    display: flex;
    flex-direction: column;
}
.detail-text span {
    color: #6c757d;
}

/* --- STADIUM IMAGE STYLE --- */
.stadium-image {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.player-avatar { 
    width: 30px; 
    height: 30px; 
    object-fit: cover; 
    border-radius: 50%; 
    background-color: #f0f0f0;
}

.calendar-btn-picker {
    width: 50px;
    height: 50px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Perbaikan untuk Flatpickr */
.flatpickr-calendar {
    display: block !important;
    z-index: 9999 !important; /* Pastikan selalu di atas */
}

/* =================================== */
/* == Perbaikan Posisi Flatpickr      == */
/* =================================== */

/* 1. Jadikan div pembungkus sebagai patokan posisi (jangkar) */
.calendar-anchor-container {
    position: relative;
}

/* 2. Atur posisi kalender agar menempel pada jangkar */
.flatpickr-calendar {
    /* Posisikan 100% dari atas (tepat di bawah) jangkar, beri jarak 5px */
    top: calc(100% + 5px) !important; 
    
    /* Posisikan rata kanan dengan jangkar */
    right: 0 !important; 
    
    /* Hapus posisi kiri agar tidak bentrok */
    left: auto !important; 
}

/*
 * Kelas helper untuk menyembunyikan elemen secara visual
 * tanpa mengeluarkannya dari DOM layout.
 * Ini adalah cara yang lebih baik daripada 'display: none' atau 'left: -9999px'
 * untuk kasus seperti Flatpickr.
*/
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Footer */
.footer-desktop {
    background-color: #fff;
    padding: 20px 0;
}
.footer-mobile {
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    padding: 20px 0;
}
.footer-section {
    margin-bottom: 20px;
    text-align: center;
}
.footer-section:last-child {
    margin-bottom: 0;
}
.language-switcher a {
    font-size: 14px;
    padding: 0 5px;
}
.brand-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.brand-label {
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 5px;
}
.links-section a {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
}
.copyright {
    font-size: 12px;
    margin-top: 15px;
    color: #6c757d;
    text-align: center;
}

/* --- VIDEO THUMBNAIL STYLES --- */
.video-thumbnail-container {
    position: relative;
    display: block;
    cursor: pointer;
    overflow: hidden;
}
.video-thumbnail-container img {
    width: 100%; 
    border-radius: 24px;
}
.video-thumbnail-container:hover img {
    transform: scale(1.03);
    transition: transform 0.3s ease-in-out;
}
.play-icon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center; /* Pastikan properti ini ada */
    font-size: 60px;
    color: #ffffff;
    transition: all 0.3s ease;
    text-shadow: 0px 0px 15px rgba(0,0,0,0.5);
}
.video-thumbnail-container:hover .play-icon-overlay {
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

.avatar-stack {
    display: flex;
    padding-left: 15px; /* Beri ruang agar avatar pertama tidak terpotong */
}
.avatar-item {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid white;
    margin-left: -15px; /* Ini yang membuat avatar tumpang tindih */
    object-fit: cover;
    background-color: #f0f0f0;
}
.like-text {
    font-size: 0.9rem;
    color: #6c757d;
}

/* CSS untuk Jadwal dan Artikel Terkait */
.related-article-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.related-article-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.trending-article-text {
    /* Mencegah elemen meregang (fleksibel) */
    flex: 1;
    min-width: 0; /* Tetap pertahankan ini sebagai praktik terbaik */

    /* Properti untuk memotong teks secara paksa */
    white-space: nowrap;      /* 1. Mencegah teks turun ke baris baru */
    overflow: hidden;         /* 2. Sembunyikan teks yang meluber */
    text-overflow: ellipsis;  /* 3. Tampilkan "..." di akhir */
}

/* =================================== */
/* == Gaya Navbar Responsif Baru      == */
/* =================================== */

#mainNavbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-content-default {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Mencegah logo mengecil */
}

.navbar-content-search {
    flex-grow: 1;
    margin: 0 1rem;
    min-width: 0; /* Mencegah search bar merusak layout */
}

.navbar-icons-right {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Jarak antar ikon */
}

/* --- Tampilan Tablet & Mobile (di bawah 992px) --- */
@media (max-width: 991.98px) {
    .navbar-content-search {
        display: none; /* Sembunyikan search bar utama */
        width: 100%;
        margin: 0;
    }

    /* Atur state ketika pencarian aktif di mobile */
    #mainNavbar.search-active .navbar-content-default,
    #mainNavbar.search-active .navbar-icons-right {
        display: none; /* Sembunyikan logo dan ikon kanan */
    }

    #mainNavbar.search-active .navbar-content-search {
        display: block; /* Tampilkan search bar */
    }
}

/* --- Hanya Tampilan Desktop (di atas 992px) --- */
@media (min-width: 992px) {
    #mobile-search-open,
    #mobile-search-close {
        display: none !important; /* Pastikan tombol mobile tidak pernah muncul di desktop */
    }
}

/* -- Hasil Live Search (Tetap sama) -- */
#liveSearchForm {
    position: relative;
}
#searchResults {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 .25rem .25rem;
    max-height: 300px;
    overflow-y: auto;
}

.form-control:focus {
    border-color: transparent;
    box-shadow: none;
}

/* --- PENGATURAN LOGO NAVBAR RESPONSIVE --- */

/* Secara default, sembunyikan logo versi mobile */
.logo-mobile {
    display: none;
}

/* Ketika lebar layar 420px atau kurang */
@media (max-width: 420px) {
    /* Sembunyikan logo versi desktop */
    .logo-desktop {
        display: none;
    }

    /* Tampilkan logo versi mobile */
    .logo-mobile {
        display: inline; /* atau 'block', sesuai kebutuhan layout Anda */
    }
}