/**
 * CSS pour les détails des leçons d'expression orale TCF
 * Interface avec boutons Tâche 2 et Tâche 3 et dropdowns
 */

/* Variables CSS */
:root {
    --tcf-primary-blue: #2563eb;
    --tcf-primary-green: #10b981;
    --tcf-secondary-blue: #3b82f6;
    --tcf-text-primary: #1f2937;
    --tcf-text-secondary: #6b7280;
    --tcf-text-muted: #9ca3af;
    --tcf-bg-light: #f8fafc;
    --tcf-border-light: #e5e7eb;
    --tcf-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --tcf-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --tcf-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --tcf-radius-sm: 0.375rem;
    --tcf-radius-md: 0.5rem;
    --tcf-radius-lg: 0.75rem;
    --tcf-spacing-xs: 0.5rem;
    --tcf-spacing-sm: 0.75rem;
    --tcf-spacing-md: 1rem;
    --tcf-spacing-lg: 1.5rem;
    --tcf-spacing-xl: 2rem;
    --tcf-spacing-2xl: 3rem;
}

/* Container principal */
.tcf-speaking-lesson-details-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* background: #EEF2F7; */
    line-height: 1.6;
    color: var(--tcf-text-primary);
}

/* Bouton de retour */
.tcf-back-button-container {
    margin-bottom: 32px;
}

.tcf-back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #ffffff;
    color: var(--tcf-text-secondary);
    text-decoration: none;
    border-radius: var(--tcf-radius-md);
    box-shadow: var(--tcf-shadow-sm);
    transition: all 0.2s ease;
    font-weight: 500;
}

.tcf-back-button:hover {
    background: var(--tcf-bg-light);
    color: var(--tcf-text-primary);
    box-shadow: var(--tcf-shadow-md);
    transform: translateY(-1px);
}

.tcf-back-button i {
    width: 20px;
    height: 20px;
}

/* En-tête de la leçon */
.tcf-lesson-header {
    text-align: center;
    margin-bottom: 48px;
}

.tcf-lesson-title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--tcf-text-primary);
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.tcf-lesson-description {
    font-size: 1.125rem;
    color: var(--tcf-text-secondary);
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Nouveau header avec titre à gauche et boutons à droite */
.tcf-lesson-header-new {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* margin-bottom: 48px; */
    background: #ffffff;
    /* border-radius: var(--tcf-radius-lg); */
    padding: 32px;
    /* box-shadow: var(--tcf-shadow-md); */
}

.tcf-lesson-header-left {
    flex: 1;
    max-width: 60%;
}

.tcf-lesson-title-new {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0rem 0;
    color: #1a1a1a;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

.tcf-lesson-subtitle {
    font-size: 1.09rem;
    color: var(--tcf-text-secondary);
    margin: 0;
    line-height: 1.5;
}

.tcf-lesson-header-new .tcf-tasks-navigation {
    margin: 0;
    flex-shrink: 0;
}

/* Navigation des tâches */
.tcf-tasks-navigation {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 48px;
}

.tcf-task-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 16px;
    background: #ffffff;
    /* border: 1px solid var(--tcf-border-light); */
    border: 0;
    border-radius: 10px;
    color: var(--tcf-text-secondary);
    font-size: 0.95rem;
    /* font-weight: 500; */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--tcf-shadow-sm);
}

.tcf-task-button svg {
    width: 18px;
}

.tcf-task-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--tcf-shadow-md);
}

.tcf-task-button.active {
    color: #ffffff;
    background: linear-gradient(135deg, #1363DF 0%, #1e40af 100%);
    box-shadow: var(--tcf-shadow-lg);
}

.tcf-task-button i {
    width: 24px;
    height: 24px;
}

/* Contenu des tâches */
.tcf-tasks-content {
    background: #ffffff;
    border-radius: var(--tcf-radius-lg);
    box-shadow: var(--tcf-shadow-lg);
    overflow: hidden;
    padding: 40px;
}

.tcf-task-content {
    padding: 0;
}

.tcf-task-header {
    background: linear-gradient(135deg, var(--tcf-primary-blue), var(--tcf-secondary-blue));
    color: #ffffff;
    padding: 32px;
    text-align: center;
}

.tcf-task-title {
    font-size: 2rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    font-family: 'Poppins', sans-serif;
}

.tcf-task-description {
    font-size: 1.125rem;
    margin: 0;
    opacity: 0.9;
}

.tcf-task-body {
    padding: 32px;
}

/* Parties de la tâche */
.tcf-task-part {
    margin-bottom: 48px;
}

.tcf-task-part:last-child {
    margin-bottom: 0;
}

.tcf-part-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tcf-text-primary);
    margin: 0 0 24px 0;
    padding-bottom: 6px;
    border-bottom: 3px solid var(--tcf-primary-blue);
    display: inline-block;
}

/* Container des sujets */
.tcf-subjects-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Élément sujet individuel */
.tcf-subject-item {
    background: var(--tcf-bg-light);
    border-radius: var(--tcf-radius-md);
    overflow: hidden;
    box-shadow: var(--tcf-shadow-sm);
    transition: all 0.3s ease;
}

.tcf-subject-item:hover {
    /* box-shadow: var(--tcf-shadow-md); */
    transform: translateY(-1px);
}

.tcf-subject-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: #ffffff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid var(--tcf-border-light);
    align-items: flex-start !important;
}

.tcf-subject-header:hover {
    background: var(--tcf-bg-light);
}

.tcf-subject-title {
    font-size: 1.02rem;
    font-weight: 500;
    color: var(--tcf-text-primary);
    margin: 0;
    line-height: 1.5;
}

.tcf-subject-toggle svg {
    width: 28px;
    height: 28px;
    color: gray;
}

.tcf-subject-toggle {
    display: flex;
    align-items: center;
    color: var(--tcf-text-muted);
    transition: transform 0.3s ease;
}

.tcf-subject-toggle i {
    width: 20px;
    height: 20px;
}

.tcf-subject-item.expanded .tcf-subject-toggle {
    transform: rotate(180deg);
}

/* Contenu du sujet */
.tcf-subject-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #ffffff;
}

.tcf-subject-item.expanded .tcf-subject-content {
    padding: 24px;
    max-height: unset;
}

.tcf-subject-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--tcf-text-primary);
    margin-bottom: 24px;
}

/* Corrections */
.tcf-subject-corrections {

    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--tcf-color-gray) var(--tcf-color-light-gray);

}

/* Style de la scrollbar pour Webkit (Chrome, Safari, Edge) */
.tcf-subject-corrections::-webkit-scrollbar {
    width: 8px;
}

.tcf-subject-corrections::-webkit-scrollbar-track {
    background: var(--tcf-color-light-gray);
    border-radius: 4px;
}

.tcf-subject-corrections::-webkit-scrollbar-thumb {
    background: var(--tcf-color-gray);
    border-radius: 4px;
}

.tcf-subject-corrections::-webkit-scrollbar-thumb:hover {
    background: var(--tcf-color-dark-gray);
}

.tcf-corrections-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tcf-text-primary);
    margin: 0 0 16px 0;
}

.tgmobile__menu .navigation li > a{
    text-transform: uppercase;
    font-size: 15px;
}

/* Corrections tâche 2 (lignes numérotées) */
.tcf-corrections-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* background: var(--tcf-bg-light); */
    padding: 15px 10px;
    border-radius: 8px;
}

.tcf-correction-line {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0px 16px;
    background: var(--tcf-bg-light);
}

.tcf-correction-number {
    font-weight: 600;
    color: var(--tcf-primary-blue);
    min-width: 24px;
}

.tcf-correction-text {
    color: var(--tcf-text-primary);
    line-height: 1.6;
    font-weight: 500;
    font-size: 1rem;
    font-family: "Poppins", sans-serif !important;
}

/* Message d'avertissement quand pas de corrections */
.tcf-no-corrections-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: #fef3c7;
    /* border: 1px solid #f59e0b; */
    border-radius: var(--tcf-radius-md);
    color: #92400e;
    justify-content: center;
}

.tcf-warning-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tcf-no-corrections-warning p {
    margin: 0;
    font-weight: 500;
}

/* Corrections tâche 3 (favorable/défavorable avec arguments) */
.tcf-corrections-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tcf-correction-section {
    padding: 20px;
    /* border-radius: var(--tcf-radius-md);
    border-left: 4px solid; */
}

.tcf-correction-section.tcf-favorable {
    /* background: #f0f9ff;
    border-left-color: #f0f9ff; */
}

.tcf-correction-section.tcf-defavorable {
    /* background: #f0f9ff;
    border-left-color: #f0f9ff; */
}

.tcf-correction-section-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0 0 16px 0;

}

.tcf-correction-section.tcf-favorable .tcf-correction-section-title {
    color: var(--tcf-primary-green);
}

.tcf-correction-section.tcf-defavorable .tcf-correction-section-title {
    color: var(--tcf-primary-green);
}

/* Liste des arguments */
.tcf-arguments-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.tcf-argument {
    padding: 8px 8px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: var(--tcf-radius-sm);
    border-left: 3px solid;
}

.tcf-correction-section.tcf-favorable .tcf-argument {
    /* border-left-color: var(--tcf-primary-green); */
    border-left-color: rgba(255, 255, 255, 0.7);
}

.tcf-correction-section.tcf-defavorable .tcf-argument {
    /* border-left-color: var(--tcf-primary-green); */
    border-left-color: rgba(255, 255, 255, 0.7);
}

.tcf-argument-text {
    font-weight: 600;
    color: var(--tcf-text-primary);
    line-height: 1.6;
    /* margin-bottom: 8px; */
    font-size: 0.95rem;
    font-family: "Montserrat", sans-serif;
}

.tcf-argument-explication {
    color: var(--tcf-text-secondary);
    font-style: italic;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

.tcf-correction-section.tcf-favorable .tcf-argument-explication {
    border-left-color: transparent;
}

.tcf-correction-section.tcf-defavorable .tcf-argument-explication {
    border-left-color: transparent;
}

/* Section audio */
.tcf-audio-section {
    margin-top: 20px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--tcf-radius-sm);
    border: 1px solid var(--tcf-border-light);
    display: flex;
    background: #0F4FB2 !important;
    border-radius: 5px !important;
    ;
}



.tcf-audio-section {
    display: flex;
    flex-direction: column;
    /* Pour que l'audio et les contrôles soient empilés si besoin */
    align-items: center;
    width: 100%;
}

.custom-audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    /* background-color: #004d99; */
    border-radius: 10px;
    padding: 10px 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Boutons Lecture/Pause */
.custom-audio-controls .play-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 15px;
    /* Taille du bouton */
    height: 15px;
    /* Utilisation d'un triangle CSS pour le bouton lecture */
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid white;
    /* Couleur blanche pour l'icône de lecture */
    padding: 0;
    margin-right: 5px;
}

/* Bouton Pause (sera appliqué via JS) */
.custom-audio-controls .play-btn.pause-btn {
    width: 15px;
    /* Taille légèrement différente pour l'icône pause */
    height: 15px;
    border-left: 6px solid white;
    border-right: 6px solid white;
    border-top: none;
    border-bottom: none;
}

/* Affichage du temps */
.custom-audio-controls .time {
    color: white;
    /* Couleur du texte */
    font-family: sans-serif;
    font-size: 0.9em;
    min-width: 40px;
    /* Pour éviter que le texte ne saute */
    text-align: center;
}

/* Barre de progression */
.custom-audio-controls .progress-bar {
    flex-grow: 1;
    /* Prend l'espace disponible */
    -webkit-appearance: none;
    /* Supprime l'apparence par défaut de WebKit */
    appearance: none;
    height: 8px;
    /* Hauteur de la barre */
    background: #6699cc;
    /* Couleur de fond de la barre (non remplie) */
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

/* Style du "pouce" (le point de contrôle) de la barre de progression */
.custom-audio-controls .progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    /* Taille du pouce */
    height: 14px;
    background: white;
    /* Couleur du pouce */
    border-radius: 50%;
    /* Rond */
    cursor: pointer;
    margin-top: -3px;
    /* Centrer le pouce verticalement */
}

.custom-audio-controls .progress-bar::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

/* Bouton Mute/Unmute (Icône de volume) */
.custom-audio-controls .volume-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 15px;
    height: 15px;
    position: relative;
    margin-left: 5px;
}

.custom-audio-controls .volume-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid white;
    /* Forme de l'icône de volume */
}

.custom-audio-controls .volume-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: calc(50% + 4px);
    /* Positionner la "vague" */
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 2px solid white;
    /* Vagues du volume */
    border-left: none;
    border-right: none;
    opacity: 1;
    transition: opacity 0.2s ease-in-out;
}

/* Icône de volume coupé */
.custom-audio-controls .volume-btn.muted::after {
    opacity: 0;
    /* Masquer les vagues */
}

.custom-audio-controls .volume-btn.muted::before {
    /* Ajouter une barre diagonale pour le muet */
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 2px;
    height: 20px;
    background: white;
    border-radius: 2px;
}


/* Barre de volume */
.custom-audio-controls .volume-bar {
    width: 60px;
    /* Largeur de la barre de volume */
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: #6699cc;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    margin-left: 5px;
}

.custom-audio-controls .volume-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}

.custom-audio-controls .volume-bar::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}


.tcf-audio-section audio {
    width: 100%;
    border-radius: var(--tcf-radius-sm);
}

/* Amélioration du style du lecteur audio */
.tcf-audio-section audio::-webkit-media-controls-panel {
    background-color: white;
}

.tcf-audio-section audio::-webkit-media-controls-play-button {
    background-color: var(--tcf-primary-blue);
    color: white;
    /* background: linear-gradient(135deg, #1363DF 0%, #1e40af 100%); */
    border-radius: 50%;
}

/* Forcer la couleur blanche de l'icône play */
.tcf-audio-section audio::-webkit-media-controls-play-button {
    filter: brightness(0) invert(1) !important;
}

/* Alternative avec des filtres plus spécifiques */
.tcf-audio-section audio::-webkit-media-controls-play-button svg {
    filter: brightness(0) invert(1) !important;
}

.tcf-audio-section audio::-webkit-media-controls-play-button::before {
    filter: brightness(0) invert(1) !important;
}

.tcf-audio-section audio::-webkit-media-controls-play-button:hover {
    background-color: #059669;
}

/* Masquer les 3 points (menu contextuel) */
.tcf-audio-section audio::-webkit-media-controls-more-button {
    display: none !important;
}

/* Masquer le bouton de téléchargement */
.tcf-audio-section audio::-webkit-media-controls-download-button {
    display: none !important;
}

/* Masquer le bouton de plein écran */
.tcf-audio-section audio::-webkit-media-controls-fullscreen-button {
    display: none !important;
}

.tcf-transcript-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    /* padding: 20px; */
    margin-top: 20px;
}

/* Ensure volume button never displays the play triangle */
.custom-audio-controls .volume-btn {
    background: none !important;
    border: none !important;
    width: 15px;
    height: 15px;
    position: relative;
  }
  
  /* Explicitly wipe any triangle borders that could leak from generic rules */
  .custom-audio-controls .volume-btn {
    border-left: 0 !important;
    border-top: 0 !important;
    border-bottom: 0 !important;
  }

.tcf-transcript-toggle {
    margin: 0 auto;
    font-weight: 700;
    margin-top: 10px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-size: 13px;
}
.tcf-transcript-content .section__title {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 1rem;
    color: black;
    margin-top: 25px;
    margin-bottom: 0px;
}
.tcf-transcript-content {
    font-family: 'Montserrat';
    /* font-family: 'Poppins'; */
    line-height: 1.8rem;
    font-weight: 400;
    /* font-size: 0.95rem; */
}
/* Responsive */
@media (max-width: 768px) {
    .tcf-speaking-lesson-details-container {
        padding: 0;

    }
    .tcf-correction-text {
        margin-bottom: 8px;
    }

    .tcf-correction-section {
        padding: 0px;
    }

    .custom-audio-controls .volume-bar {
        width: 40px;
    }
    .tcf-corrections-container {
        gap: 50px;
    }
    .tcf-argument-explication {
        margin-bottom: 15px;
    }
    .tcf-tasks-content,
    .tcf-subject-header,
    .tcf-subject-content {
        padding: 0;
    }

    .tcf-lesson-title {
        font-size: 2rem;
    }

    /* Responsive pour le nouveau header */
    .tcf-lesson-header-new {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
        gap: 24px;
    }

    .tcf-lesson-header-left {
        max-width: 100%;
        text-align: center;
    }

    .tcf-lesson-title-new {
        font-size: 1.5rem;
    }
    .tcf-task-button {
        padding: 10px 16px;
    }
    .tcf-correction-line {
        gap: 0;
    }

    .tcf-lesson-header-new .tcf-tasks-navigation {
        flex-direction: column;
        align-items: center;
    }

    .tcf-tasks-navigation {
        flex-direction: column;
        align-items: center;
    }

    .tcf-task-button {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .tcf-task-header {
        padding: 24px 10px;
    }

    .tcf-task-body {
        padding:20px;

    }
    .tcf-argument {
        padding: 0;
    }

    .tcf-subject-header {
        padding: 16px 0 !important;
    }

    .tcf-subject-item.expanded .tcf-subject-content {
        padding: 20px 0 !important;
    }
}

/* Animation pour les dropdowns */
@keyframes slideDown {
    from {
        max-height: 0;
        opacity: 0;
    }

    to {
        max-height: 1000px;
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        max-height: 1000px;
        opacity: 1;
    }

    to {
        max-height: 0;
        opacity: 0;
    }
}

.tcf-subject-content {
    animation: slideUp 0.3s ease;
}

.tcf-subject-item.expanded .tcf-subject-content {
    animation: slideDown 0.3s ease;
}

/* --- Hard override: ensure volume button shows ONLY the SVG, no pseudo-elements --- */
.custom-audio-controls button.volume-btn {
    background: none !important;
    border: 0 !important;
    padding: 0 !important;
    width: 18px !important;
    height: 18px !important;
    position: relative;
}
.custom-audio-controls button.volume-btn::before,
.custom-audio-controls button.volume-btn::after {
    content: none !important;
    display: none !important;
    border: 0 !important;
    width: 0 !important;
    height: 0 !important;
}
.custom-audio-controls button.volume-btn .icon-volume {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}
.custom-audio-controls button.volume-btn.muted .icon-volume path:nth-of-type(2) {
    opacity: 0;
}