/**
 * ============================================
 * CSS OPTIMISÉ - Interface compacte
 * Éléments plus petits, meilleure lisibilité
 * ============================================
 */

/* ===========================
   VARIABLES
   =========================== */
:root {
    --primary: #4a90e2;
    --secondary: #7b68ee;
    --success: #52c41a;
    --warning: #faad14;
    --danger: #f5222d;
    --text: #2c3e50;
    --text-light: #6c757d;
    --bg: #f8f9fa;
    --elev: #ffffff;
    --border: #e1e8ed;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
}

/* ===========================
   TYPOGRAPHIE COMPACTE
   =========================== */
body {
    font-size: 14px;
    line-height: 1.5;
}

h3 {
    font-size: 18px;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

h4 {
    font-size: 16px;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

h5 {
    font-size: 14px;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

p {
    margin-bottom: var(--spacing-sm);
    font-size: 13px;
}

.muted {
    font-size: 12px;
    color: var(--text-light);
}

/* ===========================
   CARDS COMPACTES
   =========================== */
.card {
    background: var(--elev);
    border-radius: var(--radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: 0 2px 8px var(--shadow);
}

.card h3 {
    font-size: 16px;
    margin-bottom: var(--spacing-md);
}

/* ===========================
   INDICATEUR DE STADE
   =========================== */
.stageIndicator {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius);
    font-size: 12px;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.stageIndicator strong {
    font-size: 13px;
}

/* ===========================
   EXERCICE DU JOUR - COMPACT
   =========================== */
.dailyExercise {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-md);
}

.exerciseIcon {
    font-size: 32px;
    flex-shrink: 0;
}

.exerciseInfo {
    flex: 1;
}

.exerciseInfo h4 {
    color: white;
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 15px;
}

.exerciseInfo p {
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 12px;
}

.exerciseMeta {
    display: flex;
    gap: var(--spacing-md);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
}

.exerciseMeta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===========================
   LISTE D'EXERCICES COMPACTE
   =========================== */
.exerciseList {
    display: grid;
    gap: var(--spacing-sm);
}

.exerciseCard {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.exerciseCard:hover {
    background: white;
    box-shadow: 0 2px 8px var(--shadow);
    transform: translateX(4px);
}

.exerciseCardIcon {
    font-size: 28px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
}

.exerciseCardContent {
    flex: 1;
}

.exerciseCardContent h5 {
    margin: 0 0 2px 0;
    font-size: 14px;
    color: var(--text);
}

.exerciseCardContent p {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: var(--text-light);
}

.exerciseCardContent .exerciseMeta {
    font-size: 11px;
    color: var(--text-light);
    gap: var(--spacing-sm);
}

.exerciseCardArrow {
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

/* ===========================
   BOUTONS COMPACTS
   =========================== */
.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 13px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn.full {
    width: 100%;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-lg);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.btn:active {
    transform: translateY(0);
}

.btnRow {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.btnRow .btn {
    flex: 1;
}

/* ===========================
   ZONE D'EXERCICE COMPACTE
   =========================== */
#exerciseArea {
    position: relative;
    margin-top: var(--spacing-lg);
}

.closeBtn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.closeBtn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

#exerciseTitle {
    font-size: 18px;
    margin-bottom: var(--spacing-md);
    padding-right: 40px;
}

/* ===========================
   BARRE DE PROGRESSION
   =========================== */
.exerciseProgress {
    margin-bottom: var(--spacing-lg);
}

.progress {
    height: 6px;
    background: var(--bg);
    border-radius: 10px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* ===========================
   INSTRUCTIONS COMPACTES
   =========================== */
.exerciseInstructions {
    background: #f0f7ff;
    padding: var(--spacing-md);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
    margin-bottom: var(--spacing-lg);
}

.exerciseInstructions p {
    margin: 0;
    font-size: 13px;
    color: var(--text);
}

.exerciseInstructions strong {
    font-size: 14px;
}

/* ===========================
   GRILLES COMPACTES
   =========================== */
.faceGrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.faceCard {
    background: var(--bg);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.faceCard:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.faceCard.selected {
    border-color: var(--success);
    background: #f6ffed;
}

.faceCard img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: var(--spacing-sm);
}

.faceName {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.faceHint {
    font-size: 11px;
    color: var(--text-light);
}

/* ===========================
   GRILLE EMOJI COMPACTE
   =========================== */
.emojiGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.emojiBtn {
    font-size: 32px;
    padding: var(--spacing-lg);
    background: var(--bg);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.emojiBtn:hover {
    transform: scale(1.05);
    background: white;
    box-shadow: 0 2px 8px var(--shadow);
}

.emojiBtn.selected {
    border-color: var(--success);
    background: #f6ffed;
}

/* ===========================
   TIMER COMPACT
   =========================== */
.timer {
    text-align: center;
    padding: var(--spacing-md);
    background: var(--bg);
    border-radius: var(--radius);
    font-size: 13px;
}

.timer strong {
    font-size: 20px;
    color: var(--primary);
    margin: 0 4px;
}

.intervalTimer {
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    color: var(--primary);
    margin: var(--spacing-xl) 0;
}

/* ===========================
   RÉCUPÉRATION ESPACÉE
   =========================== */
.spacedRetrievalContent {
    text-align: center;
}

.spacedQuestion {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--spacing-lg);
}

.spacedImage {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    border-radius: var(--radius);
    margin: var(--spacing-lg) 0;
    object-fit: cover;
}

.spacedAnswer {
    font-size: 15px;
    font-weight: 600;
    padding: var(--spacing-md);
    background: #fff7e6;
    border-radius: var(--radius);
    margin: var(--spacing-lg) 0;
    border: 2px solid var(--warning);
}

/* ===========================
   TÂCHE QUOTIDIENNE COMPACTE
   =========================== */
.taskSteps {
    margin-bottom: var(--spacing-lg);
}

.taskStep {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.taskStep.active {
    opacity: 1;
    background: #f0f7ff;
    border: 2px solid var(--primary);
}

.taskStep.completed {
    opacity: 0.7;
    background: #f6ffed;
    border: 2px solid var(--success);
}

.taskStepNumber {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.taskStep.active .taskStepNumber {
    background: var(--primary);
    color: white;
}

.taskStep.completed .taskStepNumber {
    background: var(--success);
    color: white;
}

.taskStep.completed .taskStepNumber::before {
    content: '✓';
}

.taskStepContent {
    flex: 1;
}

.taskStepContent strong {
    display: block;
    font-size: 13px;
    margin-bottom: var(--spacing-xs);
}

.taskStepContent img {
    max-width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: var(--spacing-xs);
}

/* ===========================
   TRI MONTESSORI COMPACT
   =========================== */
.sortingContainer {
    padding: var(--spacing-md) 0;
}

.sortingContainer > p {
    text-align: center;
    font-size: 14px;
    margin-bottom: var(--spacing-lg);
    font-weight: 500;
}

.sortingItems {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--bg);
    border-radius: var(--radius);
}

.sortingItem {
    background: white;
    border-radius: var(--radius);
    padding: var(--spacing-sm);
    text-align: center;
    cursor: move;
    transition: all 0.2s ease;
    border: 2px solid var(--border);
}

.sortingItem:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 10;
}

.sortingItem.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.sortingItem img {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    object-fit: cover;
    margin-bottom: var(--spacing-xs);
}

.sortingItem div {
    font-size: 12px;
    font-weight: 500;
}

.sortingCategories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.sortingCategory {
    background: var(--bg);
    border-radius: var(--radius);
    padding: var(--spacing-md);
    min-height: 150px;
    border: 2px dashed var(--border);
    transition: all 0.2s ease;
}

.sortingCategory.dragover {
    background: #f0f7ff;
    border-color: var(--primary);
    border-style: solid;
}

.categoryLabel {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-xs);
    background: white;
    border-radius: 6px;
}

.categoryItems {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* ===========================
   MUSICOTHÉRAPIE COMPACTE
   =========================== */
.musicTherapyContent {
    padding: var(--spacing-md) 0;
}

.musicPlayer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: var(--spacing-lg);
    border-radius: var(--radius);
    color: white;
    margin-bottom: var(--spacing-lg);
}

.musicPlayer h4 {
    font-size: 16px;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.playlistSongs {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.songItem {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 6px;
    backdrop-filter: blur(10px);
}

.songInfo {
    flex: 1;
}

.songInfo strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.songInfo span {
    font-size: 11px;
    opacity: 0.8;
}

.playButton {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
}

.playButton:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.moodTracking {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-md);
}

.moodTracking p {
    font-size: 14px;
    margin-bottom: var(--spacing-md);
}

.moodTracker {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.moodOption {
    font-size: 40px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.5;
    filter: grayscale(100%);
}

.moodOption:hover {
    transform: scale(1.2);
    opacity: 1;
    filter: grayscale(0%);
}

.moodOption.selected {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.3);
}

/* ===========================
   RÉMINISCENCE COMPACTE
   =========================== */
.reminiscenceContent {
    padding: var(--spacing-md) 0;
}

.reminiscenceImage {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: var(--spacing-lg);
}

.reminiscenceQuestions {
    background: #f0f7ff;
    padding: var(--spacing-lg);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-lg);
}

.reminiscenceQuestion {
    font-size: 14px;
    font-weight: 500;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border);
}

.reminiscenceQuestion:last-child {
    border-bottom: none;
}

.reminiscencePrompts {
    background: #fff7e6;
    padding: var(--spacing-md);
    border-radius: var(--radius);
    margin-bottom: var(--spacing-md);
}

.reminiscencePrompts h5 {
    font-size: 13px;
    margin-bottom: var(--spacing-sm);
}

.reminiscencePrompts p {
    font-size: 12px;
    margin-bottom: 4px;
}

/* ===========================
   CHAMPS DE SAISIE COMPACTS
   =========================== */
.field {
    margin-bottom: var(--spacing-md);
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    color: var(--text);
}

.input,
textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* ===========================
   PILLS COMPACTES
   =========================== */
.pillRow {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.pill {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill:hover {
    background: white;
    border-color: var(--primary);
    color: var(--primary);
}

.pill.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===========================
   SÉQUENCE D'ACTIONS
   =========================== */
.sequenceItems {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.sequenceItem {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: move;
    transition: all 0.2s ease;
}

.sequenceItem:hover {
    box-shadow: 0 2px 8px var(--shadow);
}

.sequenceHandle {
    color: var(--text-light);
    font-size: 16px;
    cursor: grab;
}

.sequenceItem img {
    width: 60px;
    height: 45px;
    border-radius: 6px;
    object-fit: cover;
}

.sequenceItem span:last-child {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

/* ===========================
   RÉSULTAT COMPACT
   =========================== */
#exerciseResult {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.resultAnimation {
    font-size: 48px;
    animation: bounce 0.6s ease;
    margin-bottom: var(--spacing-md);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.resultScore {
    font-size: 56px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--spacing-sm);
}

.resultStars {
    font-size: 32px;
    margin-bottom: var(--spacing-md);
}

.resultFeedback {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: var(--spacing-md);
}

/* ===========================
   RESPONSIVE COMPACT
   =========================== */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }

    .card {
        padding: var(--spacing-md);
    }

    .faceGrid,
    .sortingItems,
    .sortingCategories {
        grid-template-columns: repeat(2, 1fr);
    }

    .emojiGrid {
        grid-template-columns: repeat(2, 1fr);
    }

    .exerciseCard {
        padding: var(--spacing-sm);
    }

    .exerciseCardIcon {
        width: 36px;
        height: 36px;
        font-size: 24px;
    }

    .dailyExercise .exerciseIcon {
        font-size: 28px;
    }

    .resultScore {
        font-size: 48px;
    }

    .intervalTimer {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .faceGrid,
    .sortingItems,
    .sortingCategories {
        grid-template-columns: 1fr;
    }

    .btnRow {
        flex-direction: column;
    }

    .exerciseList {
        gap: var(--spacing-xs);
    }
}