/* Matematik-sida specifik styling - FÖRBÄTTRAD VERSION */

/* Hero section för matematik */
.matematik-hero {
    background: linear-gradient(135deg, rgba(255, 154, 86, 0.15), rgba(15, 15, 15, 0.9));
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="40" opacity="0.1">📊</text></svg>');
    padding: 120px 50px 30px;
    margin-top: 80px;
}

.matematik-hero h1 {
    background: linear-gradient(135deg, #ff9a56, #ff6b95);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
/* Hero navigation DENNA KOD ÄR BAKÅTKNAPPEN FRÅN STARTSIDAN SAMT DEN VID KURSER */
.hero-nav {
    position: absolute;
    top: 20px;
    left: 50px;
    z-index: 10;
}

.hero-back-btn {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid rgba(255,255,255,0.2);
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-back-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

/* Hero navigation DENNA KOD ÄR BAKÅTKNAPPEN FRÅN STARTSIDAN SAMT DEN VID KURSER */




/* MPOBIL ANPASSAD  DENNA KOD ÄR BAKÅTKNAPPEN FRÅN STARTSIDAN SAMT DEN VID KURSER */
@media (max-width: 768px) {
    .hero-nav {
        top: 15px;
        left: 20px;
    }
    
    .hero-back-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Breadcrumb navigation */
.breadcrumb {
    padding: 20px 50px 20px;
    margin-top: 80px;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 20px;
}

.breadcrumb-nav a {
    color: #ff9a56;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb-nav a:hover {
    color: white;
}

.breadcrumb-nav span {
    color: rgba(255,255,255,0.4);
}

/* Content section - FIXAT MELLANRUM */
.content {
    padding: 10px 40px;
    margin-top: -10px;
}

/* Hero stats - FÖRBÄTTRAT */
.hero-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 25px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    font-weight: 500;
}

/* Kurser grid */
.kurser-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

/* Kurskort - FÖRBÄTTRAT */
.kurs-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 154, 86, 0.2);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 320px;
}

.kurs-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(255, 154, 86, 0.2);
    border-color: rgba(255, 154, 86, 0.5);
}

.kurs-card:focus {
    outline: 2px solid #ff9a56;
    outline-offset: 2px;
}

.kurs-header {
    height: 160px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
    border-radius: 12px 12px 0 0;
}

.kurs-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    display: none; /* Dölj kurs badge */
}

.kurs-level {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: none; /* Dölj kurs level badge */
}

.kurs-content {
    padding: 25px;
    height: 160px;
    display: flex;
    flex-direction: column;
}

.kurs-title {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
    line-height: 1.2;
}

.kurs-description {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
    flex: 1;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kurs-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: rgba(255,255,255,0.6);
}

.kurs-stats {
    display: flex;
    gap: 15px;
}

.kurs-duration {
    background: rgba(255, 154, 86, 0.2);
    color: #ff9a56;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

/* Section headers - FÖRBÄTTRAT */
.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section actions för tillbaka-knapp */
.section-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-sekundär {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    border: 2px solid rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-sekundär:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Kategori filter */
.category-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 40px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #ff9a56, #ff6b95);
    border-color: #ff9a56;
    color: white;
    transform: translateY(-1px);
}

.filter-btn:focus {
    outline: 2px solid #ff9a56;
    outline-offset: 2px;
}

.filter-btn.active {
    box-shadow: 0 4px 15px rgba(255, 154, 86, 0.2);
}

/* Matematik video cards - FÖRBÄTTRAT */
.matematik-video-card {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 1px solid rgba(255, 154, 86, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 360px;
    width: 300px;
    max-width: 300px;
    min-width: 300px;
    flex: none;
}

.matematik-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(255, 154, 86, 0.15);
    border-color: rgba(255, 154, 86, 0.4);
}

.matematik-video-card:focus {
    outline: 2px solid #ff9a56;
    outline-offset: 2px;
}

.matematik-video-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.matematik-video-card.loading .matematik-video-thumbnail {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.matematik-video-thumbnail {
    height: 200px;
    background: linear-gradient(45deg, #ff9a56, #ff6b95);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    border-radius: 12px 12px 0 0;
}

/* Play button overlay - NYTT */
.matematik-video-thumbnail::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
}

.matematik-video-card:hover .matematik-video-thumbnail::after {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}


.matematik-video-card .progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(229, 9, 20, 0.8);
    border-radius: 0 0 8px 8px;
    transition: width 0.3s ease;
    z-index: 2;
}



/* Video badges - FÖRBÄTTRAT */
.video-category-badge, .video-difficulty-badge {
    backdrop-filter: blur(10px);
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.1);
    font-size: 11px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
}

.video-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    color: white;
}

.video-difficulty-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    text-transform: uppercase;
    display: none; /* Dölj difficulty badges */
}

.video-difficulty-badge.difficulty-beginner {
    background: rgba(34, 197, 94, 0.8);
    color: white;
    border-color: rgba(34, 197, 94, 0.3);
    display: none; /* Dölj beginner badge */
}

.video-difficulty-badge.difficulty-intermediate {
    background: rgba(251, 146, 60, 0.8);
    color: white;
    border-color: rgba(251, 146, 60, 0.3);
    display: none; /* Dölj intermediate badge */
}

.video-difficulty-badge.difficulty-advanced {
    background: rgba(239, 68, 68, 0.8);
    color: white;
    border-color: rgba(239, 68, 68, 0.3);
    display: none; /* Dölj advanced badge */
}

.matematik-video-content {
    padding: 16px;
    height: 160px;
    display: flex;
    flex-direction: column;
}

.matematik-video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: white;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.matematik-video-description {
    font-size: 13px;
    color: rgba(255,255,255,0.7);
    margin-bottom: 12px;
    flex: 1;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.matematik-video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    margin-top: auto;
}

.video-stats {
    display: flex;
    gap: 15px;
}

.video-duration {
    background: rgba(255, 154, 86, 0.2);
    color: #ff9a56;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Kategorisektioner */
.kategori-sektion {
    margin-bottom: 50px;
}

.kategori-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 15px;
    border-left: 4px solid #ff9a56;
}

.kategori-icon {
    font-size: 32px;
}

.kategori-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.kategori-info p {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

/* Video grid för kategorier - FÖRBÄTTRAT */
.kategori-videos {
    display: grid;
    grid-template-columns: repeat(auto-fill, 300px);
    gap: 20px;
    justify-content: center;
    padding: 0 20px;
}

/* Section spacing */
.section {
    margin-bottom: 40px;
}

.section:first-child {
    margin-top: 0;
}

/* Ladda mer knapp */
.load-more-btn {
    display: block;
    margin: 40px auto;
    padding: 15px 40px;
    background: linear-gradient(135deg, #ff9a56, #ff6b95);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 154, 86, 0.4);
}

/* Sökresultat - FÖRBÄTTRAT */
.search-results {
    margin-bottom: 30px;
}

.search-results-header {
    font-size: 18px;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
}

.search-highlight {
    background: linear-gradient(135deg, rgba(255, 154, 86, 0.3), rgba(255, 107, 149, 0.3));
    color: #ff9a56;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* Ytterligare säkerhet - Överstyr eventuella konflikter */
.content .kategori-videos .matematik-video-card {
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
    flex: none !important;
}

.section .kategori-videos {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, 300px) !important;
    justify-content: center !important;
}

.section .matematik-video-card {
    width: 300px !important;
    max-width: 300px !important;
}

/* Mobile responsiv - FÖRBÄTTRAT */
@media (max-width: 768px) {
    .matematik-hero {
        padding: 100px 20px 20px;
    }
    
    .breadcrumb {
        padding: 100px 20px 20px;
    }
    
    .content {
        padding: 5px 20px;
        margin-top: -5px;
    }
    
    .kurser-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .kurs-card {
        height: 260px;
    }
    
    .kurs-header {
        height: 130px;
        font-size: 40px;
        border-radius: 12px 12px 0 0;
    }
    
    .kurs-content {
        padding: 16px;
        height: 130px;
    }
    
    .kurs-title {
        font-size: 20px;
    }
    
    .section-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-filter {
        padding: 10px 20px;
        margin-left: -20px;
        margin-right: -20px;
    }
    
    .filter-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .kategori-videos {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 300px;
        margin: 0 auto;
        padding: 0 10px;
    }
    
    .matematik-video-card {
        width: 100%;
        max-width: 300px;
        height: 340px;
        margin: 0 auto;
    }
    
    .matematik-video-thumbnail {
        height: 180px;
    }
    
    .matematik-video-content {
        height: 160px;
        padding: 14px;
    }
    
    .kategori-header {
        padding: 15px;
        flex-direction: column;
        text-align: center;
    }
    
    .kategori-icon {
        font-size: 28px;
    }
}

/* Tablet-storlek */
@media (min-width: 769px) and (max-width: 1024px) {
    .kategori-videos {
        grid-template-columns: repeat(auto-fill, minmax(300px, 300px));
        justify-content: center;
        gap: 20px;
    }
}

/* Animation för kort som laddas in */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation för flera kort */
.matematik-video-card:nth-child(1) { animation-delay: 0.1s !important; }
.matematik-video-card:nth-child(2) { animation-delay: 0.15s !important; }
.matematik-video-card:nth-child(3) { animation-delay: 0.2s !important; }
.matematik-video-card:nth-child(4) { animation-delay: 0.25s !important; }
.matematik-video-card:nth-child(5) { animation-delay: 0.3s !important; }
.matematik-video-card:nth-child(6) { animation-delay: 0.35s !important; }

/* Smooth section title transition */
#sectionTitle, #videoCount {
    transition: all 0.3s ease-in-out !important;
}

/* Global smooth transitions */
* {
    transition: all 0.3s ease;
}