:root {
    --bg-color: #1a1a1a;
    --surface-color: #2b2b2b;
    --primary-color: #0d6efd;
    --text-color: #e0e0e0;
    --text-muted-color: #888;
    --border-color: #444;
    --danger-color: #dc3545;
    --font-family: 'Inter', sans-serif;
}

body { 
    font-family: var(--font-family); 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    margin: 0; 
    padding: 0; 
    height: 100vh; 
    overflow: hidden; 
    user-select: none;
}
.app-container { display: flex; flex-direction: column; height: 100%; }
.main-workspace { display: flex; flex-grow: 1; overflow: hidden; }
.command-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 15px; border-bottom: 1px solid var(--border-color); background-color: var(--surface-color); flex-shrink: 0; }
.tool-group { display: flex; align-items: center; gap: 5px; }
.tool-subgroup { display: flex; align-items: center; gap: 5px; }
.separator { width: 1px; height: 24px; background-color: var(--border-color); margin: 0 10px; }
.tool-button { background: none; border: none; color: var(--text-muted-color); font-size: 18px; padding: 8px; width: 40px; height: 40px; border-radius: 6px; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.tool-button:hover:not(:disabled) { background-color: #555; color: var(--text-color); }
.tool-button.active { background-color: var(--primary-color); color: white; }
.tool-button:disabled { opacity: 0.4; cursor: not-allowed; }

.left-column { position: relative; width: 50%; min-width:300px; max-width: calc(100% - 300px); padding: 10px; display: flex; box-sizing: border-box; }
.resizer { position: absolute; top:0; right: -2.5px; width: 5px; height: 100%; cursor: col-resize; z-index: 100; }
.right-column { flex-grow: 1; padding: 10px; display: flex; box-sizing: border-box; }

.panel { display: flex; flex-direction: column; width:100%; height: 100%; background-color: var(--surface-color); border-radius: 8px; overflow: hidden; transition: opacity 0.2s ease-in-out; }
.panel.panel-loading { opacity: 0.5; pointer-events: none; }

#preview-panel { overflow: hidden; }

#fullscreen-wrapper { 
    position: relative;
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
    min-height: 0; 
    padding-bottom: 100px;
    box-sizing: border-box;
}

.panel-header { padding: 12px 15px; border-bottom: 1px solid var(--border-color); font-weight: 500; font-size: 14px; flex-shrink: 0; display: flex; justify-content: space-between; align-items: center; }
.panel-content { flex-grow: 1; background-color: #1e1e1e; position: relative; }
.panel-content .placeholder { display: flex; justify-content: center; align-items: center; height:100%; color: var(--text-muted-color); pointer-events: none; }
.view-controls .tool-button { font-size: 16px; width: 35px; height: 35px; }

.preview-player-container { 
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    background-color: var(--surface-color);
    padding: 15px; 
    border-top: 1px solid var(--border-color);
    box-sizing: border-box;
}

.progress-bar-wrapper { display: flex; align-items: center; gap: 10px; position:relative; }
.loader-bar { position: absolute; top: 50%; left:0; transform: translateY(-50%); width: 100%; height: 6px; background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-color) 20%, #444 20%, #444 100%); background-size: 500% 100%; animation: loading 1.5s infinite linear; border-radius: 5px; display: none; }
@keyframes loading { 0% { background-position: 125% 0; } 100% { background-position: -25% 0; } }
.player-controls { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.player-buttons, .right-controls { display: flex; align-items: center; gap: 5px; }
.time-indicator { font-size: 12px; color: var(--text-muted-color); min-width: 45px; text-align: center; }
input[type="range"].video-progress { appearance: none; width: 100%; height: 6px; background: #444; border-radius: 5px; outline: none; cursor: pointer; }
input[type="range"].video-progress::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; background: var(--primary-color); border-radius: 50%; border: 2px solid white; }
input[type="range"].video-progress:disabled::-webkit-slider-thumb { background: #888; }
.player-button { background: none; border: none; color: var(--text-color); font-size: 16px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; }
.play-pause-btn { font-size: 20px; background-color: var(--primary-color); color: white; }
.export-button { background-color: #198754; color: white; border: none; padding: 10px 15px; border-radius: 6px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; }

.global-footer { flex-shrink: 0; border-top: 1px solid var(--border-color); padding: 15px; background-color: var(--surface-color); }
.timeline-container { display: flex; align-items: center; gap: 15px; width: 100%; }
.timeline-label { font-size: 14px; color: var(--text-muted-color); font-weight: 500; }
.timeline-items { display: flex; align-items: flex-start; overflow-x: auto; flex-grow: 1; padding-top:10px; padding-bottom: 40px; }
.timeline-segment { display: flex; align-items: center; position: relative; flex-shrink: 0; }
.timeline-item { position: relative; width: 120px; height: 70px; background-color: var(--bg-color); border: 2px solid var(--border-color); border-radius: 6px; cursor: pointer; display: flex; justify-content: center; align-items: center; color: var(--text-muted-color); font-size: 14px; }
.timeline-item.active { border-color: var(--primary-color); }
.timeline-item img { width:100%; height:100%; object-fit: cover; }
.delete-thumb-btn { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; background-color: var(--danger-color); color: white; border: none; border-radius: 50%; font-size: 12px; cursor: pointer; z-index: 10; display: flex; justify-content: center; align-items: center;}
.duration-tag { position: absolute; top: 75px; left: 50%; transform: translateX(-50%); background-color: var(--surface-color); border: 1px solid var(--border-color); color: var(--text-color); padding: 2px 8px; border-radius: 4px; font-size: 12px; display: flex; align-items: center; gap: 4px; cursor: text; z-index: 5; }
.transition-connector { display: flex; justify-content: center; align-items: center; width: 60px; height: 70px; position:relative; }
.transition-control { width: 40px; height: 40px; border: 1px dashed var(--border-color); border-radius: 50%; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; color: var(--text-muted-color); }
.transition-control i { font-size: 12px; }
.transition-control .duration { font-size: 11px; font-weight: 700; cursor: text; }
.add-item-btn { width: 70px; height: 70px; border-style: dashed; font-size: 28px; margin-left: 25px; position:relative; }
.add-item-btn input { position:absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor:pointer; }

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 26, 26, 0.7);
    display: flex;
    z-index: 5;
    border-radius: 4px;
    overflow: hidden;
    pointer-events: none;
}

#bg-opacity-slider {
    cursor: pointer;
}

/* EXPORT OVERLAY */
#export-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.7); z-index: 2000; display: none; justify-content: center; align-items: center; }
#export-modal { background-color: var(--surface-color); padding: 30px; border-radius: 8px; width: 400px; text-align: center; }
#export-modal h3 { margin-top: 0; color: var(--primary-color); }
.progress-bar-export-container { width: 100%; height: 10px; background-color: var(--bg-color); border-radius: 5px; margin: 20px 0 10px; }
#export-progress-bar { width: 0%; height: 100%; background-color: var(--primary-color); border-radius: 5px; transition: width 0.1s linear; }
#export-modal button { margin-top: 20px; padding: 8px 16px; border: 1px solid var(--border-color); background-color: var(--danger-color); color: white; border-radius: 5px; cursor: pointer; font-weight: 500; }
#export-modal button:hover { opacity: 0.9; }
#export-modal { display: flex; flex-direction: column; align-items: center; }

/* Styles pour la marque de l'application */
.brand-display { display: flex; align-items: baseline; gap: 15px; margin-left: 15px; }
.brand-name { font-family: 'Bungee', sans-serif; font-size: 26px; color: var(--text-color); }
.beta-tag { width: 32px; height: 32px; background-color: var(--danger-color); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; font-family: var(--font-family); text-transform: uppercase; position: relative; top: -7px; }

/* Styles pour l'overlay de chargement de projet */
#project-loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 5000; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 25px; background-color: rgba(26, 26, 26, 0.7); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease-in-out; }
#project-loader-overlay.visible { opacity: 1; pointer-events: all; }
#project-loader-overlay .morph-shape { width: 60px; height: 60px; background-color: var(--primary-color); animation: morph 3s linear infinite; }
#project-loader-overlay .loading-text { color: var(--text-color); font-size: 1.1rem; font-weight: 500; }
@keyframes morph { 0%, 100% { border-radius: 50% 50% 30% 70% / 60% 40% 60% 40%; transform: rotate(0deg); } 33% { border-radius: 20% 80% 80% 20% / 80% 80% 20% 20%; } 66% { border-radius: 80% 20% 20% 80% / 20% 80% 80% 20%; transform: rotate(180deg); } }

/* Styles pour l'overlay d'aide */
#help-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 6000; opacity: 0; pointer-events: none; transition: opacity 0.3s ease-in-out; }
#help-overlay.visible { opacity: 1; pointer-events: all; }
#help-spotlight { position: absolute; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(26, 26, 26, 0.7); transition: top 0.4s ease-in-out, left 0.4s ease-in-out, width 0.4s ease-in-out, height 0.4s ease-in-out; pointer-events: none; }
#help-close-btn { position: fixed; top: 20px; right: 20px; width: 45px; height: 45px; background-color: var(--danger-color); color: white; border: none; border-radius: 50%; font-size: 24px; font-family: 'Inter', sans-serif; line-height: 1; cursor: pointer; z-index: 10; }
.help-step { position: absolute; opacity: 0; pointer-events: none; transition: opacity 0.4s ease-in-out; z-index: 5; }
.help-step.active { opacity: 1; pointer-events: all; }
.help-bubble { padding: 15px 20px; background-color: #3a3a3a; border: 2px solid var(--primary-color); border-radius: 10px; color: var(--text-color); font-family: 'Caveat', cursive; width: 250px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.help-bubble h3 { font-size: 1.6rem; margin: 0 0 8px 0; color: var(--primary-color); }
.help-bubble p { font-size: 1.2rem; line-height: 1.4; margin: 0; }
.help-nav { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background-color: var(--surface-color); padding: 10px 20px; border-radius: 50em; display: flex; align-items: center; gap: 15px; z-index: 10; box-shadow: 0 5px 20px rgba(0,0,0,0.4); }
.help-nav button { background: var(--primary-color); color: white; border: none; padding: 8px 16px; border-radius: 50em; cursor: pointer; font-weight: 500; font-size: 14px; }
.help-nav button:disabled { background: #555; cursor: not-allowed; }
.help-step-counter { font-size: 14px; color: var(--text-muted-color); min-width: 50px; text-align: center; }

/* Styles pour le sélecteur de langue */
#lang-switcher { position: relative; margin: 0 10px; }
#lang-current { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background-color: #3c3c3c; border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; min-width: 100px; }
.lang-flag { font-size: 18px; }
.lang-name { font-size: 14px; font-weight: 500; }

#lang-options {
    position: absolute;
    top: 110%;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 5px;
    background-color: #3c3c3c;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    min-width: 100%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    z-index: 10;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

#lang-switcher.open #lang-options { display: block; }
#lang-options li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 4px; cursor: pointer; }
#lang-options li:hover { background-color: var(--primary-color); }

/* ==================================================================== */
/* CORRECTION : Style spécifique pour le bouton feedback (balise <a>)
/* pour garantir un alignement parfait avec les autres boutons.
/* ==================================================================== */
#btn-feedback {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none; /* Enlève le soulignement des liens */
}

[dir="rtl"] .export-button,
[dir="rtl"] .duration-tag,
[dir="rtl"] #lang-current,
[dir="rtl"] #lang-options li {
    flex-direction: row;
}

#outro-compositor-wrapper {
    position: absolute;
    top: -9999px;
    left: -9999px;
    z-index: -1;
    opacity: 0;
    pointer-events: none;
}

.loader-overlay .ai-icon {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 20px;
    color: var(--primary-color);
    animation: pump 1.5s ease-in-out infinite;
    transform-origin: center;
}

@keyframes pump {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}