/* =========================================================
   ArabicLearn - Page Learn Vocabulary
   Version clean complète
   ========================================================= */


/* =========================================================
   Page générale
   ========================================================= */

.vocabulary-learn-page {
    display: flex;
    flex-direction: column;
    gap: 22px;
}


/* =========================================================
   Bande titre
   ========================================================= */

.vocabulary-hero {
    padding: 24px 28px;

    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
        linear-gradient(135deg, #e8fbff, #fff5df);

    border: 1px solid #dcebf5;
    border-radius: 24px;
    box-shadow: 0 8px 24px rgba(31, 60, 90, 0.08);
}

.vocabulary-hero-kicker {
    margin-bottom: 8px;

    color: #109c9b;
    font-size: 0.95rem;
    font-weight: 900;
}

.vocabulary-hero h2 {
    margin: 0;

    color: #102b56;
    font-size: clamp(1.8rem, 3.2vw, 2.7rem);
    font-weight: 900;
    letter-spacing: -1px;
}

.vocabulary-hero p {
    max-width: 720px;
    margin: 12px 0 0;

    color: #44546a;
    font-size: 1.05rem;
    line-height: 1.5;
}


/* =========================================================
   Layout principal
   ========================================================= */

.vocabulary-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 230px;
    gap: 18px;
    align-items: start;
}

.theme-sidebar,
.vocabulary-main-panel,
.tips-panel {
    min-width: 0;
}

.theme-sidebar,
.vocabulary-main-panel,
.tips-card,
.encouragement-card {
    background: white;
    border: 1px solid #e1e8ef;
    border-radius: 22px;
    box-shadow: 0 6px 18px rgba(31, 60, 90, 0.08);
}


/* =========================================================
   Colonne thèmes
   ========================================================= */

.theme-sidebar {
    position: sticky;
    top: 110px;

    padding: 18px;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-bottom: 12px;
}

.panel-title h3 {
    margin: 0;

    color: #102b56;
    font-size: 1.1rem;
    font-weight: 900;
}

.theme-choice-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.theme-choice-card {
    width: 100%;
    padding: 12px 13px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;

    border: 1px solid #dde7f0;
    border-radius: 15px;
    background: #ffffff;
    color: #102b56;

    text-align: left;
    cursor: pointer;

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        border-color 0.12s ease,
        background 0.12s ease;
}

.theme-choice-card:hover {
    transform: translateX(3px);
    border-color: #b8d7ea;
    background: #f7fbff;
    box-shadow: 0 6px 16px rgba(31, 60, 90, 0.12);
}

.theme-choice-card.active {
    border-color: #109c9b;
    background: #eefafa;
    box-shadow: 0 6px 16px rgba(16, 156, 155, 0.16);
}

.theme-choice-content {
    min-width: 0;
}

.theme-choice-title {
    display: block;

    color: #102b56;
    font-size: 0.95rem;
    font-weight: 900;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-choice-arrow {
    color: #109c9b;
    font-weight: 900;
}

.theme-choice-emoji,
.theme-choice-count {
    display: none !important;
}


/* =========================================================
   Panneau central vocabulaire
   ========================================================= */

.vocabulary-main-panel {
    padding: 20px;
}

.vocabulary-main-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;

    margin-bottom: 18px;
}

.selected-theme-label {
    color: #109c9b;
    font-size: 0.9rem;
    font-weight: 900;
}

.vocabulary-main-header h3 {
    margin: 4px 0 0;

    color: #102b56;
    font-size: 1.6rem;
    font-weight: 900;
}

.vocabulary-count {
    padding: 8px 12px;

    border-radius: 999px;
    background: #eefafa;
    color: #109c9b;

    font-weight: 900;
    white-space: nowrap;
}

/* =========================================================
   Sélection du niveau
   ========================================================= */

.vocabulary-level-section {
    display: none;

    margin: 0 0 20px;
    padding: 14px 16px;

    background: #f8fbfd;
    border: 1px solid #e1e8ef;
    border-radius: 16px;
}

.vocabulary-level-label {
    margin-bottom: 9px;

    color: #657286;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vocabulary-level-choices {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.vocabulary-level-button {
    min-height: 38px;
    padding: 7px 14px;

    border: 1px solid #d5e3ec;
    border-radius: 999px;

    background: #ffffff;
    color: #102b56;

    font: inherit;
    font-size: 0.9rem;
    font-weight: 900;

    cursor: pointer;

    transition:
        background 0.12s ease,
        color 0.12s ease,
        border-color 0.12s ease,
        transform 0.12s ease;
}

.vocabulary-level-button:hover {
    transform: translateY(-1px);

    border-color: #109c9b;
    background: #eefafa;
}

.vocabulary-level-button.active {
    border-color: #109c9b;
    background: #109c9b;
    color: #ffffff;
}

.vocabulary-level-button-all {
    margin-left: 4px;

    border-style: dashed;
}


/* =========================================================
   Message vide / chargement
   ========================================================= */

.learn-message {
    margin: 12px 0;
    color: #666;
}

.learn-message-empty {
    min-height: 260px;
    padding: 28px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    text-align: center;
    background: #f8fbfd;
    border: 1px dashed #c8d7e4;
    border-radius: 18px;
    color: #44546a;
}

.learn-message-empty strong {
    color: #102b56;
}

.empty-icon {
    font-size: 2.6rem;
}


/* =========================================================
   Sections par catégorie
   ========================================================= */

.vocabulary-category-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.vocabulary-category-section {
    padding: 16px;

    background: #fbfdff;
    border: 1px solid #e4edf5;
    border-radius: 22px;
}

.vocabulary-category-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;

    margin-bottom: 14px;
    padding-bottom: 10px;

    border-bottom: 1px solid #e4edf5;
}

.vocabulary-category-header h4 {
    margin: 0;

    color: #102b56;
    font-size: 1.25rem;
    font-weight: 900;
}

.vocabulary-category-header span {
    padding: 6px 10px;

    border-radius: 999px;
    background: #eefafa;
    color: #109c9b;

    font-size: 0.85rem;
    font-weight: 900;
    white-space: nowrap;
}


/* =========================================================
   Grille vocabulaire
   ========================================================= */

.vocabulary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.vocabulary-card {
    position: relative;

    padding: 12px;

    background: white;
    border: 1px solid #dde7f0;
    border-radius: 20px;
    box-shadow: 0 5px 16px rgba(31, 60, 90, 0.08);

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease;
}

.vocabulary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(31, 60, 90, 0.13);
}

/* =========================================================
   Niveau du mot
   ========================================================= */

.vocabulary-level-stars {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;

    padding: 3px 7px;

    border-radius: 999px;

    background: rgba(255, 255, 255, 0.92);

    color: #f2b01e;

    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;

    letter-spacing: 1px;

    box-shadow: 0 2px 7px rgba(31, 60, 90, 0.10);

    cursor: default;
}


/* =========================================================
   Carte simple
   ========================================================= */

.vocabulary-card-horizontal {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding-top: 26px;
    min-height: 138px;
}

.vocabulary-media {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.vocabulary-image-button {
    width: 82px;
    height: 82px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    border: none;
    border-radius: 16px;
    background: #f4f8fb;

    overflow: hidden;
    cursor: zoom-in;
}

.vocabulary-image-button:hover {
    outline: 3px solid rgba(16, 156, 155, 0.22);
}

.vocabulary-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vocabulary-gender-icon {
    width: 28px;
    height: 28px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
}

.vocabulary-gender-icon.gender-masculine {
    color: #1f6fd1;
    background: #e9f2ff;
}

.vocabulary-gender-icon.gender-feminine {
    color: #d13f8c;
    background: #ffeaf4;
}

.vocabulary-card-content {
    min-width: 0;
    width: 100%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.vocabulary-arabic {
    margin: 0;

    width: 100%;

    direction: rtl;
    text-align: center;

    color: #102b56;
    font-size: 2.55rem;
    font-weight: 900;
    line-height: 1.05;
}

.vocabulary-french {
    margin-top: 5px;

    width: 100%;

    color: #44546a;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
}


/* =========================================================
   Bouton détails
   ========================================================= */

.vocabulary-details-button {
    margin-top: 8px;
    padding: 5px 11px;

    border: 1px solid #d6e5ef;
    border-radius: 999px;
    background: #f7fbff;
    color: #102b56;

    font-size: 0.78rem;
    font-weight: 900;

    cursor: pointer;
    transition:
        background 0.12s ease,
        border-color 0.12s ease,
        transform 0.12s ease;
}

.vocabulary-details-button:hover {
    transform: translateY(-1px);
    border-color: #109c9b;
    background: #eefafa;
}


/* =========================================================
   Carte split masculin / féminin
   ========================================================= */

.vocabulary-card-split {
    grid-column: span 2;
}

.vocabulary-split-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.vocabulary-split-side {
    min-width: 0;
    padding: 10px;

    background: #f9fcff;
    border: 1px solid #eef3f7;
    border-radius: 16px;
}

.vocabulary-gender-label {
    display: none;
}

.vocabulary-split-row {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    min-height: 120px;
}

.vocabulary-split-side .vocabulary-image-button {
    width: 72px;
    height: 72px;
    border-radius: 14px;
}

.vocabulary-card-split .vocabulary-arabic {
    font-size: 2.05rem;
}


/* =========================================================
   Panneau astuces
   ========================================================= */

.tips-panel {
    position: sticky;
    top: 110px;

    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tips-card,
.encouragement-card {
    padding: 20px;
}

.tips-icon {
    margin-bottom: 6px;
    font-size: 2rem;
}

.tips-card h3 {
    margin: 0 0 12px;

    color: #102b56;
    font-weight: 900;
}

.tips-card p {
    color: #44546a;
    line-height: 1.45;
}

.encouragement-card {
    text-align: center;
    background: linear-gradient(135deg, #fff8e8, #ffffff);
}

.encouragement-face {
    font-size: 3rem;
}

.encouragement-card strong {
    display: block;
    margin-top: 8px;

    color: #102b56;
}

.encouragement-card span {
    display: block;
    margin-top: 5px;

    color: #44546a;
}


/* =========================================================
   Modal image plein écran
   ========================================================= */

.vocabulary-image-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.vocabulary-image-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;

    background: rgba(16, 43, 86, 0.86);
}

.vocabulary-image-modal-box {
    position: fixed;
    inset: 0;
    z-index: 10001;

    width: 100vw;
    height: 100vh;

    padding: 76px 28px 28px;
    box-sizing: border-box;

    display: flex;
    /* align-items: center; */
    justify-content: center;
}

.vocabulary-image-modal-box img {
    display: block;

    max-width: calc(100vw - 56px);
    max-height: calc(100vh - 110px);

    width: auto;
    height: auto;

    object-fit: contain;
    border-radius: 22px;
    background: white;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
}


/* =========================================================
   Modal détails
   ========================================================= */

.vocabulary-details-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10100;
}

.vocabulary-details-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10100;

    background: rgba(16, 43, 86, 0.52);
}

.vocabulary-details-modal-box {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 10101;

    width: min(860px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);

    transform: translate(-50%, -50%);

    overflow: auto;

    background: #ffffff;
    border-radius: 26px;
    box-shadow: 0 22px 65px rgba(0, 0, 0, 0.28);
}

.vocabulary-details-modal-body {
    padding: 28px;
}

.vocabulary-details-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.vocabulary-details-image-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.vocabulary-details-image {
    width: 180px;
    height: 180px;

    object-fit: cover;
    border-radius: 24px;
    background: #f4f8fb;
    box-shadow: 0 8px 22px rgba(31, 60, 90, 0.12);
}

.vocabulary-details-gender {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    padding: 7px 13px;
    border-radius: 999px;

    font-weight: 900;
}

.vocabulary-details-gender span {
    font-size: 1.3rem;
}

.vocabulary-details-gender.gender-masculine {
    color: #1f6fd1;
    background: #e9f2ff;
}

.vocabulary-details-gender.gender-feminine {
    color: #d13f8c;
    background: #ffeaf4;
}

.vocabulary-details-kicker {
    color: #109c9b;
    font-size: 0.9rem;
    font-weight: 900;
}

.vocabulary-details-arabic {
    margin-top: 6px;
    text-align: center;
    direction: rtl;
    color: #102b56;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
}

.vocabulary-details-french {
    margin-top: 6px;

    color: #44546a;
    font-size: 1.4rem;
    font-weight: 800;
}

.vocabulary-details-table {
    margin-top: 24px;

    display: flex;
    flex-direction: column;
    gap: 9px;
}

.vocabulary-details-row {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: center;

    padding: 12px;

    background: #f8fbfd;
    border: 1px solid #e5eef5;
    border-radius: 16px;
}

.vocabulary-details-row-label {
    color: #109c9b;
    font-size: 0.9rem;
    font-weight: 900;
}

.vocabulary-details-row-arabic {
    direction: rtl;
    color: #102b56;
    font-size: 1.45rem;
    font-weight: 900;
}

.vocabulary-details-row-french {
    color: #44546a;
    font-weight: 800;
}


/* =========================================================
   Croix modales
   ========================================================= */

.vocabulary-modal-close,
.vocabulary-image-modal-close,
#btnCloseVocabularyImageModal,
#btnCloseVocabularyDetailsModal {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: #ffffff;
    color: #102b56;

    font-size: 1.7rem;
    font-weight: 900;
    line-height: 1;

    cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.vocabulary-modal-close:hover,
.vocabulary-image-modal-close:hover,
#btnCloseVocabularyImageModal:hover,
#btnCloseVocabularyDetailsModal:hover {
    background: #eefafa;
    color: #109c9b;
}

/* Croix de l'image : toujours visible dans l'écran */
.vocabulary-image-modal .vocabulary-modal-close,
.vocabulary-image-modal-close,
#btnCloseVocabularyImageModal {
    position: fixed;
    top: 22px;
    right: 26px;
    z-index: 10003;
}

/* Croix des détails : attachée à la boîte */
.vocabulary-details-modal .vocabulary-modal-close,
#btnCloseVocabularyDetailsModal {
    position: absolute;
    top: 16px;
    right: 18px;
    z-index: 10102;
}


/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1450px) {
    .vocabulary-layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .tips-panel {
        grid-column: 1 / -1;
        position: static;

        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .vocabulary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1250px) {
    .vocabulary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1050px) {
    .vocabulary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .vocabulary-layout {
        grid-template-columns: 1fr;
    }

    .theme-sidebar,
    .tips-panel {
        position: static;
    }

    .theme-choice-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tips-panel {
        grid-template-columns: 1fr;
    }

    .vocabulary-card-split {
        grid-column: span 2;
    }
}

@media (max-width: 700px) {
    .vocabulary-details-layout {
        grid-template-columns: 1fr;
    }

    .vocabulary-details-image {
        width: 150px;
        height: 150px;
    }

    .vocabulary-details-arabic {
        text-align: center;
        font-size: 3rem;
    }

    .vocabulary-details-french,
    .vocabulary-details-kicker {
        text-align: center;
    }

    .vocabulary-details-row {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .vocabulary-details-row-arabic {
        text-align: center;
    }
}

@media (max-width: 650px) {
    .theme-choice-list,
    .vocabulary-grid {
        grid-template-columns: 1fr;
    }

    .vocabulary-card-split {
        grid-column: span 1;
    }

    .vocabulary-split-content {
        grid-template-columns: 1fr;
    }

    .vocabulary-card-horizontal,
    .vocabulary-split-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .vocabulary-image-button,
    .vocabulary-split-side .vocabulary-image-button {
        width: 72px;
        height: 72px;
    }

    .vocabulary-main-header {
        display: block;
    }

    .vocabulary-count {
        display: inline-block;
        margin-top: 10px;
    }

    .vocabulary-image-modal-box {
        padding: 74px 16px 20px;
    }

    .vocabulary-image-modal-box img {
        max-width: calc(100vw - 32px);
        max-height: calc(100vh - 100px);
        border-radius: 18px;
    }

    .vocabulary-image-modal .vocabulary-modal-close,
    .vocabulary-image-modal-close,
    #btnCloseVocabularyImageModal {
        top: 18px;
        right: 18px;
    }
}