/* ==========================================================================
   1. HERO SECTION (Index)
   ========================================================================== */
.hero-article {
    position: relative;
    width: 100%;
    height: 70vh;
    background-color: #0b0b0b;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    display: flex;
    align-items: flex-end;
    /* NIEUW: Op desktop staat alles links, op mobiel overschrijven we dit naar center */
    justify-content: flex-start; 
    
    padding: 0;
    margin: 0;
    overflow: hidden;
    color: white;
    box-sizing: border-box;
}

.hero-article::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(11,11,11,1) 0%, rgba(11,11,11,0) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    /* AANGEPAST: We gebruiken margin-bottom voor de afstand tot de onderkant */
    margin-bottom: 60px;
    /* AANGEPAST: Geen margin-left meer, maar padding op de container */
    padding-left: 60px;
    padding-right: 20px;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 5vw, 3.5rem); /* Minimum verlaagd voor mobiel */
    font-weight: 900;
    margin: 10px 0;
    line-height: 1.1;
    text-shadow: 0 2px 15px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 550px;
    color: #eee;
    margin-bottom: 30px;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

/* --- Mobiel Specifiek binnen de Hero --- */
@media (max-width: 600px) {
    .hero-article {
        /* Hier zetten we de boel in het midden voor mobiel */
        justify-content: center;
        text-align: center;
    }

    .hero-content {
        /* Verwijder de 60px inspringing op mobiel */
        padding-left: 20px;
        margin-bottom: 40px;
    }

    .hero-content p, 
    .tag-new {
        /* Haal de drukte weg */
        display: none;
    }
}

/* ==========================================================================
   2. ROW WRAPPERS & SLIDERS (Algemeen)
   ========================================================================== */
.row-wrapper { 
    position: relative; 
    margin-bottom: 50px; 
}

/* Alleen de pijltjes tonen als iemand echt een muis heeft */
@media (hover: hover) {
    .row-wrapper:hover .nav-btn { 
        opacity: 1; 
    }
}

.slider-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto; 
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 15px; 
    
    /* FIX: Padding boven én onder toegevoegd voor de groene lijntjes */
    padding: 10px 0; 
    margin-top: -10px; /* Compenseert de padding-top zodat de titel van de rij op de juiste plek blijft */
    
    scrollbar-width: none; 
}

.slider-container::-webkit-scrollbar { 
    display: none; 
}

/* De navigatieknoppen */
.nav-btn {
    position: absolute;
    top: calc(50% - 5px); 
    transform: translateY(-50%);
    z-index: 100;
    background: rgba(0,0,0,0.8);
    color: white;
    border: none;
    width: 45px;
    height: 70px; 
    cursor: pointer;
    /* AANGEPAST: Standaard onzichtbaar EN niet inklikbaar */
    opacity: 0; 
    visibility: hidden; 
    transition: opacity 0.3s, visibility 0.3s, background 0.2s, transform 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* AANGEPAST: Alleen tonen als we ECHT kunnen hoveren (desktop) */
@media (hover: hover) {
    .row-wrapper:hover .nav-btn { 
        opacity: 1; 
        visibility: visible;
    }
}

.btn-left { left: 0; } 
.btn-right { right: 0; }

.nav-btn:hover { 
    background: var(--xbox-green, #107c10); 
    transform: translateY(-50%) scale(1.05);
}

/* Extra safety voor de game-cards binnen deze slider */
.slider-container .game-card {
    /* Zorg dat de kaart niet wordt afgesneden als hij schaalt */
    margin: 5px 0;
}

/* ==========================================================================
   3. HOT DROPS (Deals & Banners)
   ========================================================================== */
.deals-banner {
    background: linear-gradient(145deg, #107c10 0%, #062e06 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 50px;
}

.deals-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.deals-main-title {
    color: #fff;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
}

.deal-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 12px;
    padding-bottom: 15px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.deal-grid::-webkit-scrollbar { display: none; }

.deal-item {
    position: relative;
    flex: 0 0 45%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-color: #1a1a1a;
    transition: transform 0.2s;
    scroll-snap-align: start;
}

.deal-item:hover { transform: scale(1.03); }

.deal-img-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.deal-content-overlay {
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 20%, transparent 100%);
    padding: 12px;
    width: 100%;
}

.deal-name {
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2px;
    display: block;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Begint op 0.75rem op mobiel en groeit mee naar 0.85rem */
    font-size: clamp(0.75rem, 2vw, 0.85rem);
}

.deal-price-top {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    color: #ffffff;
    /* Gebruik clamp zodat hij op mobiel naar 0.9rem zakt en op desktop 1.1rem is */
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: 900;
    text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.8);
    letter-spacing: -0.5px;
    margin: 0;
}

.deal-price {
    color: var(--xbox-green, #107c10);
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0;
}

.save-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    color: #ffffff;
    /* Iets kleiner font en minder padding voor de badge op kleine schermen */
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    font-weight: 800;
    padding: 2px 6px; 
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0px 1px 5px rgba(0, 0, 0, 0.5);
}

.deal-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    z-index: 2;
    pointer-events: none;
}

.view-all-btn {
    background: #ffffff;
    color: #107c10; /* Xbox Groen */
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid transparent;
}

.view-all-btn:hover {
    background: transparent;
    color: #ffffff;
    border-color: #ffffff;
    transform: translateY(-2px);
}

.row-label {
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    display: block;
}

/* --- Kleuren Logica --- */
.bg-ultimate { background: linear-gradient(135deg, #107c10, #062e06) !important; }
.bg-pc-game-pass { background: linear-gradient(135deg, #808080, #333) !important; }
.bg-essential { background: linear-gradient(135deg, #0078d4, #003e6e) !important; }
.bg-premium { background: linear-gradient(135deg, #b400ff, #4b006b) !important; }

@media (min-width: 1024px) {
    .deal-grid {
        display: grid;
        grid-template-columns: repeat(5, 1fr); /* De gevraagde 6 kolommen */
        gap: 15px;
        overflow: visible;
    }

    .deal-item {
        flex: none;
        width: 100%;
    }

    .btn-text-desktop { display: inline; }
    .btn-text-mobile { display: none; }
}

@media (max-width: 768px) {
    .btn-text-desktop { display: none; }
    .btn-text-mobile { display: inline; }
    
    .view-all-btn {
        padding: 8px 16px;
        font-size: 0.75rem;
    }
}

@media (max-width: 600px) {
    /* 1. Verklein de marge onder de Hot Drops banner */
    .deals-banner {
        margin-bottom: 20px !important; 
    }

    /* 2. Trek de Top 3 sectie strakker tegen het bovenliggende blok aan */
    .top3-section { 
        padding-top: 5px !important;   /* Bijna geen ruimte boven de titel */
        padding-bottom: 15px; 
        margin-top: 0 !important;      /* Haal de margin-top helemaal weg */
    }

    /* 3. Maak de marge onder de "Winners" titel ook kleiner op mobiel */
    .top3-title {
        margin-bottom: 25px !important; 
    }
}

/* ==========================================================================
   4. TOP 3 - THE WINNERS (Optimized)
   ========================================================================== */
.top3-section {
    /* De achtergrond geeft het blok vorm */
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(16,124,16,0.08) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    
    /* Ruimte rondom en binnen het blok */
    margin: 40px 0; 
    padding: 50px 20px; 
    
    text-align: center;
    width: 100%;
    
    /* Zorgt dat de zwevende nummers niet afgekapt worden */
    overflow: visible; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}

.top3-title {
    font-size: 1.8rem; /* Iets kleiner oogt vaak luxer */
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 70px; /* Belangrijk: extra ruimte voor de zwevende cijfers */
    border-left: none !important; 
    padding-left: 0 !important;
    color: #fff;
    letter-spacing: 1px;
}

.top3-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-end; /* Iedereen op de grondlijn */
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.top3-card {
    position: relative;
    flex: 0 1 250px; /* Kan iets krimpen als het moet */
    transition: all 0.3s ease;
}

/* Nummer 1: De Grootste in het midden */
.top3-card.rank-2 {
    width: 260px; /* Vastgesteld formaat voor desktop */
    flex: 0 0 auto;
    z-index: 2;
}

/* Nummer 1 (Midden) - Grootst */
.top3-card.rank-1 {
    width: 340px; /* Lekker groot en dominant */
    flex: 0 0 auto;
    z-index: 10;
}

/* Nummer 3 (Rechts) - Kleinst */
.top3-card.rank-3 {
    width: 210px; /* Iets kleiner dan nummer 2 */
    flex: 0 0 auto;
    z-index: 1;
}

.top3-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
}

.top3-card.rank-1 img {
    border: 2px solid #107c10;
    box-shadow: 0 0 30px rgba(16, 124, 16, 0.3);
}

/* De Cijfers */
.rank-number {
    position: absolute;
    /* Horizontaal in het midden */
    left: 50%;
    transform: translateX(-50%); 
    
    /* Verticaal: net over de bovenrand heen */
    top: -35px; 
    
    z-index: 25; /* Hoog genoeg om boven naburige kaarten te zweven */
    font-weight: 900;
    font-style: italic;
    line-height: 1;
    
    /* Schaduw voor diepte en leesbaarheid op donkere achtergronden */
    text-shadow: 4px 4px 0px rgba(0,0,0,1);
    pointer-events: none;
    margin: 0;
}

/* Formaten per rank */
.rank-1 .rank-number { 
    font-size: 8rem; 
    color: #ffcf00; 
    top: -55px; /* De 1 is groter, dus moet iets meer omhoog */
}

.rank-2 .rank-number { 
    font-size: 5rem; 
    color: #c0c0c0; 
}

.rank-3 .rank-number { 
    font-size: 4rem; 
    color: #cd7f32; 
}

.top3-card img {
    position: relative;
    z-index: 1; /* De afbeelding zit laag */
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

/* --- RESPONSIVE / MOBIEL (Samengevoegd) --- */

/* Tablet & Kleine Desktop */
@media (max-width: 900px) {
    .rank-1 .rank-number { font-size: 5rem; top: -30px; }
    .rank-2 .rank-number { font-size: 3.5rem; top: -20px; }
    .rank-3 .rank-number { font-size: 3rem; top: -15px; }
}

@media (max-width: 600px) {
    .rank-1 .rank-number { font-size: 4rem; top: -25px; }
    .rank-2 .rank-number { font-size: 2.8rem; top: -18px; }
    .rank-3 .rank-number { font-size: 2.4rem; top: -15px; }
}

@media (max-width: 900px) {
    .top3-section { 
        padding: 30px 0; 
    }
    
    .top3-title { 
        font-size: 1.6rem; 
        margin-bottom: 30px; 
    }

    .top3-card.rank-1, 
    .top3-card.rank-2, 
    .top3-card.rank-3 {
        width: auto; 
        flex: 1 1 30%;
    }

    /* Nummers schalen voor tablet (blijven gecentreerd door de eerdere CSS) */
    .rank-1 .rank-number { font-size: 6rem; }
    .rank-2 .rank-number { font-size: 4.5rem; }
    .rank-3 .rank-number { font-size: 4rem; }
}

/* Mobiel */
@media (max-width: 600px) {
    .top3-section { 
        padding: 15px 0; 
    }

    .top3-grid { 
        gap: 8px; 
        padding: 0 10px; 
    }
    
    /* De drie verschillende formaten behouden op heel klein scherm */
    .top3-card.rank-1 { flex: 0 1 38%; }
    .top3-card.rank-2 { flex: 0 1 31%; }
    .top3-card.rank-3 { flex: 0 1 27%; }

    /* Nummers nog iets compacter op mobiel */
    .rank-1 .rank-number { font-size: 4.5rem; }
    .rank-2 .rank-number { font-size: 3rem; }
    .rank-3 .rank-number { font-size: 2.5rem; }
}

/* ==========================================================================
   5. MINI ARTICLE CARDS (16:9 Cinematic Overlay)
   ========================================================================== */
.articles-mini-grid {
    display: flex; /* We wisselen naar flex voor de slider-mogelijkheid */
    gap: 20px;
    margin: 30px 0;
    overflow-x: visible; /* Desktop: geen scroll nodig */
}

.article-card-mini {
    position: relative;
    flex: 1; /* Verdeelt de ruimte op desktop */
    min-width: 0; /* Voorkomt flex-fouten */
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #1a1a1a;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease;
}

.article-img-wrapper {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

/* De luxe frosted glass balk */
.article-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* Gradient toegevoegd achter de blur voor betere leesbaarheid */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px 20px;
    z-index: 2;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.article-title-overlay h4 {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    line-height: 1.3;
}

/* Hover effecten */
.article-card-mini:hover {
    transform: translateY(-5px); /* Omhoog bewegen ipv alleen groter worden */
    border-color: var(--xbox-green);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}

.article-card-mini:hover .article-img-wrapper {
    transform: scale(1.08); /* Iets krachtigere zoom */
}

@media (max-width: 768px) {
    .articles-mini-grid {
        overflow-x: auto; /* Maakt swipen mogelijk */
        scroll-snap-type: x mandatory; /* Plakt netjes aan de randjes */
        padding-bottom: 20px; /* Ruimte voor eventuele scrollbar */
        padding-left: 20px; /* Zorgt dat de eerste kaart niet tegen de rand plakt */
        margin-left: -20px; /* Trekt de grid naar de rand van het scherm */
        margin-right: -20px;
        scrollbar-width: none; /* Verberg scrollbar op Firefox */
    }

    .articles-mini-grid::-webkit-scrollbar {
        display: none; /* Verberg scrollbar op Chrome/Safari */
    }

    .article-card-mini {
        flex: 0 0 85%; /* Toont 1 kaart volledig en een stukje van de volgende */
        scroll-snap-align: center;
    }
}

/* ==========================================================================
   6. LIBRARY CATALOG & SIDEBAR
   ========================================================================== */
.library-section { display: flex; flex-direction: column; gap: 30px; }

@media (min-width: 1024px) {
    .library-section { flex-direction: row; }
    .filter-sidebar {
        width: 280px; /* Vaste breedte op desktop */
        flex-shrink: 0;
        background: #151515; 
        padding: 25px;
        border-radius: 12px;
        border: 1px solid #222;
        position: sticky;
        top: 80px;
        height: fit-content;
    }
}

.catalog-grid { 
    flex-grow: 1; 
    display: grid; 
    /* AANGEPAST: min-waarde naar 140px zodat er 2 naast elkaar passen op mobiel */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
    gap: 15px; /* Iets compactere gap is fijner op mobiel */
    
    /* FIX: Ruimte bovenin voor het groene lijntje */
    padding: 10px 5px; 
    margin-top: -10px;
}

.catalog-grid .game-card { 
    width: 100%; 
    box-sizing: border-box;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group label {
    display: block;
    color: var(--xbox-green);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.filter-group select {
    width: 100%;
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
}

.filter-group select:hover {
    border-color: #444;
}

.filter-group input[type="range"] {
    width: 100%;
    accent-color: var(--xbox-green);
    margin-top: 10px;
}

.catalog-grid.collapsed {
    max-height: 410px;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
}

.show-more-container {
    position: sticky;
    bottom: 20px; 
    display: flex;
    justify-content: center;
    margin: 30px 0 60px 0;
    padding: 20px 0;
    z-index: 100;
    pointer-events: none;
}

.btn-outline {
    pointer-events: auto;
    background: #111;
    border: 2px solid #333;
    color: #fff;
    padding: 12px 40px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5)
}


.btn-outline:hover {
    border-color: var(--xbox-green);
    background: rgba(16, 124, 16, 0.1);
    transform: translateY(-2px);
}

/* --- Desktop: Alles normaal --- */
.filter-toggle-btn { display: none; } /* Verberg knop op desktop */

@media (min-width: 769px) {
    .library-section { display: flex; gap: 30px; }
    .filter-sidebar { flex: 0 0 250px; display: block !important; }
}

/* --- Mobiel: Filters inklapbaar maken --- */
@media (max-width: 768px) {
    .library-section { display: flex; flex-direction: column; }

    .filter-toggle-btn {
        display: block;
        width: 100%;
        padding: 12px;
        background: #222;
        border: 1px solid #107c10;
        color: white;
        border-radius: 8px;
        margin-bottom: 15px;
        font-weight: bold;
        cursor: pointer;
    }

    .filter-sidebar {
        display: none; /* Standaard dicht op mobiel */
        background: #1a1a1a;
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 20px;
        border: 1px solid rgba(255,255,255,0.1);
    }

    /* Wanneer geopend via JS */
    .filter-sidebar.is-open {
        display: block;
    }
}