/* Styles spécifiques pour les fiches */
.hero-fiches {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-fiches::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%236366f1" fill-opacity="0.1" fill-rule="nonzero"><circle cx="36" cy="24" r="2"/></g></svg>');
    opacity: 0.3;
}

.fiches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .fiches-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .matiere-nav-grid {
        justify-content: center;
    }

    .hero-fiches {
        padding-top: 6em !important;
        min-height: 50vh;
    }

    .hero-fiches h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .matiere-title {
        font-size: 2.2rem;
    }

    .topic-title {
        font-size: 1.5rem;
    }

    .fiche-card {
        padding: 1.5rem;
    }

    .fiche-title {
        font-size: 1.2rem;
    }

    .quick-nav {
        padding: 1.5rem;
        margin: 1.5rem 0;
    }

    .quick-nav h3 {
        font-size: 1.3rem;
    }

    .matiere-nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }

    .download-all-btn {
        padding: 1rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .hero-fiches {
        padding-top: 5em !important;
        min-height: 40vh;
    }

    .hero-fiches h1 {
        font-size: 2rem;
    }

    /* Optimize cards for very small screens */
    .fiches-grid {
        padding: 0 0.5rem;
        gap: 1rem;
    }

    .fiche-card {
        padding: 1rem;
    }

    .fiche-title {
        font-size: 1.1rem;
    }

    .matiere-title {
        font-size: 1.8rem;
    }

    .topic-title {
        font-size: 1.3rem;
    }

    .fiche-card {
        padding: 1rem;
    }

    .fiche-title {
        font-size: 1.1rem;
    }

    .quick-nav {
        padding: 1rem;
    }

    .matiere-nav-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }

    .container-modern {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

.fiche-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.fiche-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.fiche-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.fiche-card:hover::before {
    opacity: 0.1;
}

.fiche-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.year-badge {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.year-mp2i {
    background: linear-gradient(135deg, #48A9A6, #3d8a87);
}

.year-mpi {
    background: linear-gradient(135deg, #D4B483, #c4a471);
}

.fiche-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 1rem 0;
    flex-grow: 1;
}

.fiche-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.fiche-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.latex-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.latex-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    color: white;
    text-decoration: none;
}

/* Navigation rapide */
.quick-nav {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin: 2rem 0;
    backdrop-filter: blur(10px);
}

.quick-nav h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-align: center;
}

.matiere-nav-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.matiere-nav-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    white-space: nowrap;
}

.matiere-nav-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    text-decoration: none;
    transform: translateY(-2px);
}

.download-all-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.download-all-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    color: white;
    text-decoration: none;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 4rem 0;
}

.subject-section {
    margin-bottom: 4rem;
}

.subject-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.teachers-info {
    text-align: center;
    margin-bottom: 2rem;
}

.teacher-badge {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.topic-section {
    margin-bottom: 3rem;
}

.topic-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-underline-offset: 0.5rem;
}