/**
 * Glossaire Alpha - Styles Frontend
 * Design moderne inspiré de Mayasquad
 */

/* Variables CSS */
:root {
    --glossaire-primary: #EB5B1D;
    --glossaire-primary-dark: #d14e17;
    --glossaire-primary-light: #ef794c;
    --glossaire-secondary: #f1f5f9;
    --glossaire-text: #1e293b;
    --glossaire-text-light: #64748b;
    --glossaire-border: #e2e8f0;
    --glossaire-bg: #ffffff;
    --glossaire-bg-hover: #f8fafc;
    --glossaire-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --glossaire-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --glossaire-radius: 12px;
    --glossaire-radius-sm: 8px;
    --glossaire-transition: all 0.3s ease;
}

/* Container principal */
.glossaire-alpha-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.glossaire-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--glossaire-border);
}

.glossaire-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--glossaire-text);
    margin: 0 0 15px 0;
    background: linear-gradient(135deg, var(--glossaire-primary), var(--glossaire-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glossaire-description {
    font-size: 1.125rem;
    color: var(--glossaire-text-light);
    margin: 0 0 10px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.glossaire-count {
    font-size: 0.875rem;
    color: var(--glossaire-text-light);
    margin: 0;
    padding: 8px 16px;
    background: var(--glossaire-secondary);
    border-radius: 20px;
    display: inline-block;
}

/* Navigation alphabétique */
.glossaire-alphabet-nav {
    padding: 20px;
    margin-bottom: 40px;
}

.glossaire-alphabet-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
}

.glossaire-alphabet-list li {
    margin: 0;
    padding: 0;
}

.glossaire-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--glossaire-radius-sm);
    transition: var(--glossaire-transition);
}

.glossaire-letter.available {
    background: var(--glossaire-secondary);
    color: var(--glossaire-text);
    cursor: pointer;
}

.glossaire-letter.available:hover {
    background: var(--glossaire-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--glossaire-shadow);
}

.glossaire-letter.available.active {
    background: var(--glossaire-primary);
    color: white;
    box-shadow: 0 0 0 2px rgba(235, 91, 29, 0.3);
}

.glossaire-letter.disabled {
    background: transparent;
    color: var(--glossaire-border);
    cursor: not-allowed;
}

/* Sections de lettres */
.glossaire-letter-section {
    margin-bottom: 50px;
    scroll-margin-top: 100px;
}

.glossaire-letter-title {
    display: flex;
    align-items: center;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--glossaire-border);
}

.letter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--glossaire-primary), var(--glossaire-primary-dark));
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: var(--glossaire-radius);
    box-shadow: var(--glossaire-shadow);
}

/* Liste des termes */
.glossaire-content {
    column-count: 3;
    column-gap: 20px;
}

.glossaire-letter-section {
    break-inside: avoid;
    margin-bottom: 30px;
    background: #fff;
    border-radius: var(--glossaire-radius);
    display: inline-block;
    /* Fix pour garder le bloc entier */
    width: 100%;
}

.glossaire-terms-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* On supprime les anciennes classes de colonnes car c'est maintenant le conteneur parent qui gère */

.glossaire-term-item {
    margin: 0;
    padding: 0;
}

.glossaire-term-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    /* Réduction du padding car plus de bordure */
    background: transparent;
    /* Fond transparent par défaut */
    border: none;
    /* Suppression de la bordure */
    border-bottom: 1px solid var(--glossaire-border);
    /* Petit séparateur optionnel, sinon supprimer */
    border-radius: 0;
    text-decoration: none;
    color: var(--glossaire-text);
    font-weight: 500;
    transition: var(--glossaire-transition);
}

.glossaire-term-link:hover {
    background: transparent;
    color: var(--glossaire-primary);
    /* Texte orange au survol */
    transform: translateX(5px);
    /* Plus d'ombre ni de fond orange */
}

.glossaire-term-link .term-title {
    flex: 1;
}

.glossaire-term-link .term-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: var(--glossaire-transition);
    font-size: 1.2rem;
}

.glossaire-term-link:hover .term-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Bouton retour en haut */
.glossaire-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--glossaire-primary), var(--glossaire-primary-dark));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--glossaire-transition);
    box-shadow: var(--glossaire-shadow-lg);
    z-index: 1000;
}

.glossaire-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.glossaire-back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(235, 91, 29, 0.4);
}

.glossaire-back-to-top .back-to-top-arrow {
    font-size: 1.2rem;
    font-weight: bold;
}

.glossaire-back-to-top .back-to-top-text {
    font-size: 0.625rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Style Classic */
.glossaire-style-classic .glossaire-alphabet-nav {
    background: #f8f9fa;
    border: none;
    border-radius: 0;
    box-shadow: none;
    border-bottom: 2px solid var(--glossaire-border);
}

.glossaire-style-classic .glossaire-letter.available {
    background: transparent;
    border: 1px solid var(--glossaire-border);
}

.glossaire-style-classic .glossaire-term-link {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--glossaire-border);
    border-radius: 0;
    padding: 12px 0;
}

.glossaire-style-classic .glossaire-term-link:hover {
    background: transparent;
    color: var(--glossaire-primary);
    transform: none;
    padding-left: 10px;
    box-shadow: none;
}

.glossaire-style-classic .letter-badge {
    background: var(--glossaire-text);
    border-radius: 0;
}

/* Style Minimal */
.glossaire-style-minimal .glossaire-alphabet-nav {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 10px 0;
}

.glossaire-style-minimal .glossaire-letter {
    width: 30px;
    height: 30px;
    font-size: 0.875rem;
}

.glossaire-style-minimal .glossaire-letter.available {
    background: transparent;
}

.glossaire-style-minimal .glossaire-term-link {
    background: transparent;
    border: none;
    padding: 8px 0;
}

.glossaire-style-minimal .glossaire-term-link:hover {
    background: transparent;
    color: var(--glossaire-primary);
    transform: none;
    box-shadow: none;
}

.glossaire-style-minimal .letter-badge {
    width: 40px;
    height: 40px;
    background: transparent;
    color: var(--glossaire-primary);
    border: 2px solid var(--glossaire-primary);
    box-shadow: none;
    font-size: 1.25rem;
}

.glossaire-style-minimal .glossaire-letter-title {
    border-bottom: 1px solid var(--glossaire-border);
}

/* Responsive */
@media (max-width: 1024px) {}

@media (max-width: 768px) {
    .glossaire-alpha-container {
        padding: 20px 15px;
    }

    .glossaire-title {
        font-size: 1.75rem;
    }

    .glossaire-description {
        font-size: 1rem;
    }

    .glossaire-alphabet-nav {
        padding: 15px;
        position: static;
    }

    .glossaire-letter {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }

    .glossaire-content {
        column-count: 2;
    }

    .glossaire-term-link {
        padding: 12px 15px;
        font-size: 0.9rem;
    }

    .letter-badge {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }

    .glossaire-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {

    .glossaire-content {
        column-count: 1;
    }

    .glossaire-alphabet-list {
        gap: 5px;
    }

    .glossaire-letter {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
}

/* Animation d'apparition */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.glossaire-letter-section {
    animation: fadeInUp 0.5s ease forwards;
}

.glossaire-letter-section:nth-child(1) {
    animation-delay: 0.05s;
}

.glossaire-letter-section:nth-child(2) {
    animation-delay: 0.1s;
}

.glossaire-letter-section:nth-child(3) {
    animation-delay: 0.15s;
}

.glossaire-letter-section:nth-child(4) {
    animation-delay: 0.2s;
}

.glossaire-letter-section:nth-child(5) {
    animation-delay: 0.25s;
}

.glossaire-letter-section:nth-child(6) {
    animation-delay: 0.3s;
}

/* Focus states pour l'accessibilité */
.glossaire-letter.available:focus {
    outline: 2px solid var(--glossaire-primary);
    outline-offset: 2px;
}

.glossaire-term-link:focus {
    outline: 2px solid var(--glossaire-primary);
    outline-offset: 2px;
}

.glossaire-back-to-top:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Print styles */
@media print {

    .glossaire-alphabet-nav,
    .glossaire-back-to-top {
        display: none;
    }

    .glossaire-term-link {
        color: #000;
    }

    .glossaire-term-link::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}