/* ==========================================================================
   OVERORDNET WRAPPER & DESKTOP LAYOUT
   ========================================================================= */
.tvsport-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
}

/* Custom Navigation */
.tvsport-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #1a202c;
}

.tvsport-nav-buttons {
    display: flex;
    gap: 5px;
}

.cal-nav-btn {
    background: #529bcc; /* Grundfarve */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
}

.cal-nav-btn:hover {
    background: #6caae2;
}

#custom-date-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

/* --- DYNAMISK FILTER DESIGN (DESKTOP) --- */
#tvsport-filter-container {
    margin: 0 0 25px 0;
    width: 100%;
}

/* Hvis shortcode har slået filtre fra via data-attribut */
#tvsport-filter-container[data-show-filter="false"] .filter-buttons-mobile-wrapper,
#tvsport-filter-container[data-show-filter="false"] #cal-filter-box {
    display: none !important;
}

.cal-filter-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.cal-filter-actions {
    margin-bottom: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.filter-action-link {
    background: none;
    border: none;
    color: #529bcc;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    font-weight: 600;
}

.filter-action-link:hover {
    color: #6caae2;
}

/* Fane-navigation (Tabs) */
.filter-tabs-nav button {
    transition: all 0.2s ease;
}
.filter-tabs-nav button:hover {
    color: #3b82f6 !important;
    background-color: #f8fafc !important;
}

/* Pills Wrappers & Grid */
.filter-pills-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-pill {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-pill:hover {
    background-color: #e2e8f0;
}

/* Aktiv status (Når sporten/medie er tilvalgt) */
.filter-pill.active {
    background-color: #2557d6;
    color: #ffffff;
    border-color: #2557d6;
}

/* Medie-ikoner (Billedknapper) i filter */
.filter-pill-media-img {
    background: #ffffff !important;
    transform: scale(1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-pill-media-img:hover {
    border-color: #3b82f6 !important;
    transform: scale(1.05);
}

/* Når et medie-ikon fravælges (Gøres gråt og semi-transparent) */
.filter-pill-media-img.inactive {
    border-color: #e2e8f0 !important;
    box-shadow: none;
}
.filter-pill-media-img.inactive img {
    filter: grayscale(100%) !important;
    opacity: 0.35 !important;
}

/* Mobil-elementer (Skjult som standard på desktop) */
.filter-buttons-mobile-wrapper {
    display: none !important;
}

.filter-mobile-btn {
    background-color: #1a202c;
    color: #ffffff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.cal-filter-header-mobile {
    display: none;
}

/* Samlende datobjælke i uge/min-liste visning */
.cal-list-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333333; /* Mørkegrå baggrund som på billedet */
    color: #ffffff;
    padding: 10px 16px;
    margin-top: 20px;
    margin-bottom: 5px;
    border-radius: 4px; /* Giver et blødt, moderne look */
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Første række efter en overskrift behøver ikke ekstra top-margin */
.cal-list-date-header + .sport-event-row {
    margin-top: 0;
}

/* Ugedagen (venstre side) */
.cal-header-day {
    font-size: 16px;
    font-weight: 700;
    text-transform: capitalize;
}

.cal-header-day::before {
    content: "";
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    margin-right: 20px;
    margin-left: 6px;
    background: url(https://digitalt.tv/pics/svg/datotid-cropped.svg) no-repeat center;
    background-size: contain;
}

/* Den fulde dato (højre side) */
.cal-header-date {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0; /* Svagt lysere grå for flot hierarki */
}

/* Mobil-optimering så det ikke kniber på smalle skærme */
@media (max-width: 480px) {
    .cal-list-date-header {
        padding: 8px 12px;
    }
    .cal-header-day {
        font-size: 14px;
    }
    .cal-header-date {
        font-size: 12px;
    }
}

/* --- LISTEVISNING RÆKKER (DESKTOP) --- */
.sport-list-wrapper {
    width: 100%;
}

.sport-event-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #e2e8f0;
    gap: 5px;
}

/* Kolonne 1: Tid og Ikon */
.sport-time-col {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 110px;
}

.time-text {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
}

.sport-icon {
    font-size: 20px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

/* Kolonne 2: Indhold */
.sport-content-col {
    flex: 1;
}

.sport-title {
    margin: 0 0 6px 0 !important;
    font-size: 14px !important;
    font-weight: 600;
    color: #2557d6;
}

/* Stjernen ligger i .sport-tags flex-containeren */
.sport-action-col {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
}

.btn-toggle-mylist {
    background: none !important;
    border: none !important;
    font-size: 18px !important;
    cursor: pointer;
    padding: 2px 0 !important;
    line-height: 1 !important;
    color: #f59e0b;
    transition: transform 0.1s ease;
}

.btn-toggle-mylist:hover {
    transform: scale(1.1);
}

/* Badges og logoer container */
.sport-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.sport-badge {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.badge-sport { background: #eef3ff; color: #2557d6; }
.badge-cat { background: #f1f5f9; color: #475569; }

/* Skub logoer helt til højre på desktop */
.sport-media-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

/* Text fallback piller */
.media-pill {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    border: 1px solid #e2e8f0;
}
.media-pill.channel { background: #0066ff; color: white; }
.media-pill.streaming { background: #1a1a1a; color: white; }

.sport-media-logo {
    max-height: 30px;
    width: auto;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    border-radius: 4px;
}

.no-events {
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-style: italic;
}

/* Affiliate Links */
.affiliate-link {
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.affiliate-link:hover {
    transform: scale(1.08);
}

.sport-media-logo.affiliate-logo {
    max-height: 30px;
    width: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Sørger for, at titellinket arver den flotte blå farve fra din h3 */
.sport-title-link {
    color: #1a44b8!important;
    text-decoration: none;
    transition: color 0.2s ease;
}

/* Giver en tydelig understregning eller farveskift, når brugeren holder musen over titlen */
.sport-title-link:hover {
    text-decoration: underline;
    color: #1a44b8; /* En anelse mørkere blå ved hover for god feedback */
}
/* --- ANNONCE STYLING --- */
.cal-ad-wrapper {
    width: 100%;
    margin: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent;
}

.cal-ad-notice {
    font-size: 11px;
    color: #888888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.cal-ad-slot {
    display: flex;
    justify-content: center;
    width: 100%;
}

.ad-desktop { display: none !important; }
.ad-mobile { display: flex !important; }

@media (min-width: 768px) {
    .ad-desktop { display: flex !important; }
    .ad-mobile { display: none !important; }
}

/* ==========================================================================
   RESPONSIVT MOBIL SETUP (< 600px)
   ========================================================================= */
@media (max-width: 600px) {
    
    .tvsport-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    #custom-date-title {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tvsport-nav-buttons {
        align-items: center;
        gap: 4px;
    }

    .cal-nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    #btn-today {
        padding: 6px 8px;
    }

    /* Omdan mobil-filteret til en smart app-skuffe/overlay i bunden */
    .filter-buttons-mobile-wrapper {
        display: flex !important; /* Viser de nye 50/50 knapper */
    }

    .cal-filter-box {
        position: fixed;
        bottom: -100%;
        left: 0;
        width: 100%;
        max-height: 80vh;
        background-color: #ffffff;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.15);
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        padding: 20px;
        z-index: 99999;
        overflow-y: auto;
        transition: bottom 0.3s ease-out;
        box-sizing: border-box;
        border: none;
    }

    .cal-filter-box.mobile-open {
        bottom: 0;
    }

    .cal-filter-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }

    .cal-filter-header-mobile h3 {
        margin: 0;
        font-size: 16px;
        color: #1a202c;
    }

    .filter-close-btn {
        background: #f1f5f9;
        border: none;
        font-size: 14px;
        font-weight: bold;
        padding: 6px 12px;
        border-radius: 12px;
        cursor: pointer;
        color: #475569;
    }

    .filter-pill {
        padding: 8px 16px;
        font-size: 14px;
    }

    /* Justeringer af medie-ikoner på touch/mobil */
    .filter-pill-media-img img {
        width: 45px !important;
        height: 45px !important;
    }

    /* Grid layout for rækker på mobil */
    .sport-event-row {
        display: grid !important;
        grid-template-columns: 60px 1fr !important;
        gap: 5px;
        padding: 12px 0;
        position: relative;
    }

    .sport-time-col {
        width: 100%;
        flex: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
    }

    .time-text {
        font-size: 15px;
        text-align: center;
        color: #000000;
    }

    .sport-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .sport-content-col {
        grid-column: 2;
        width: 100%;
    }

    .sport-action-col {
        position: static !important;
        display: inline-flex !important;
        margin-right: 6px !important;
        margin-bottom: 0 !important;
    }

    .btn-toggle-mylist {
        font-size: 22px !important;
        padding: 4px 0 !important;
    }

    .sport-media-inline {
        margin-left: auto; 
        display: flex;
    }
    
    .tvsport-container {
        margin-bottom: 60px; /* Ekstra frirum til f.eks. mobile enheder */
    }
}
/* ==========================
   SØG OVERLAY
   ========================== */

#tvsport-search-overlay {

    position: fixed;
    inset: 0;

    background: rgba(0,0,0,0.5);

    z-index: 100000;

    display: none;

    align-items: flex-end;
    justify-content: center;
}

#tvsport-search-overlay.active {
    display: flex;
}

.tvsport-search-panel {

    width: 100%;
    max-width: 700px;

    background: #fff;

    border-radius: 16px 16px 0 0;

    padding: 20px;

    max-height: 80vh;

    overflow-y: auto;
}

@media (min-width: 768px) {

    #tvsport-search-overlay {
        align-items: center;
    }

    .tvsport-search-panel {

        border-radius: 12px;

        max-height: 600px;
    }
}
.cal-filter-box,
.cal-filter-box.mobile-open {
    background-color: #ffffff !important;
    /* Force hardware acceleration */
    transform: translateZ(0);
}