/* ==========================================
   CATEGORY FILTER STYLES
   Version: 1.2 - Överskriver engelska.css !important
   ========================================== */

/* ⚠️ VIKTIGT: Överskrid .section .kategori-videos !important regler */
.section .kategori-videos:has(.category-filter-container) {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    grid-template-columns: none !important;
}

/* Filter container */
.category-filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

/* Filter-knappar */
.category-filter-btn {
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.category-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    transform: translateY(-2px);
}

/* Aktiv filter-knapp */
.category-filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.category-filter-btn.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Videos grid inner wrapper - DET FAKTISKA GRIDET */
.videos-grid-inner {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 300px) !important;
    gap: 20px !important;
    justify-content: center !important;
    width: 100%;
    padding: 0 20px;
}

/* Videokort i inner grid */
.videos-grid-inner .engelska-video-card {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
}

/* ==========================================
   LIGHT MODE
   ========================================== */

body.light-mode .category-filter-container {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .category-filter-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.6);
}

body.light-mode .category-filter-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.25);
    color: #1d1d1f;
}

body.light-mode .category-filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-color: transparent;
    color: #fff;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet */
@media (max-width: 768px) {
    .category-filter-container {
        gap: 8px;
        padding: 12px 0;
        justify-content: center;
    }
    
    .category-filter-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .videos-grid-inner {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        max-width: 300px;
        margin: 0 auto;
        padding: 0 10px;
    }
    
    .videos-grid-inner .engelska-video-card {
        width: 100% !important;
        max-width: 300px !important;
        min-width: auto !important;
    }
}

/* Mobil */
@media (max-width: 480px) {
    .category-filter-container {
        gap: 6px;
    }
    
    .category-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ==========================================
   ÄMNESSPECIFIKA FÄRGER
   ========================================== */

/* Engelska - Lila */
.engelska-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* Matematik - Orange/Rosa */
.matematik-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #ff9a56, #ff6b95);
}

/* Svenska - Cyan/Blå */
.svenska-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

/* Historia - Rosa */
.historia-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

/* Naturkunskap - Grön */
.naturkunskap-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

/* Religion - Rosa/Gul */
.religion-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

/* Samhällskunskap - Cyan/Lila */
.samhallskunskap-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #30cfd0, #330867);
}

/* Filosofi - Ljusblå/Rosa */
.filosofi-hero ~ .content .category-filter-btn.active {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}
