/* TOOLBOX VIDEO – Styles complets v2 */

:root {
    --bg-deep: #F5F7FB;
    --bg-surface: #FFFFFF;
    --bg-card: #F9FAFE;
    --bg-hover: #EEF2FF;
    --accent: #4F46E5;
    --accent-dim: rgba(79,70,229,.11);
    --teal: #0891B2;
    --teal-dim: rgba(8,145,178,.10);
    --red: #E11D48;
    --amber: #D97706;
    --green: #16A34A;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #8A94A6;
    --border: rgba(79,70,229,.16);
    --border-teal: rgba(8,145,178,.22);
    --radius: 10px;
    --radius-sm: 6px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html, body {
    height: 100%;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Segoe UI',system-ui,sans-serif;
    font-size: 14px
}

a {
    text-decoration: none;
    color: inherit
}

/* ── LAYOUT ── */
.app-shell {
    display: grid;
    grid-template-rows: 54px minmax(0,1fr);
    height: 100vh;
    overflow: hidden
}

.app-body {
    display: grid;
    grid-template-columns: 220px 1fr 280px;
    overflow: hidden;
    min-height: 0;
    height: 100%
}

/* ── TOPBAR ── */
.topbar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 20px
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 24px
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center
}

    .logo-icon svg {
        width: 16px;
        height: 16px;
        fill: white
    }

.logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-transform: uppercase
}

.logo-version {
    font-size: 10px;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    font-weight: 600
}

.topbar-nav {
    display: flex;
    gap: 2px;
    flex: 1
}

.nav-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 13px;
    transition: all .15s
}

    .nav-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary)
    }

    .nav-btn.active {
        background: var(--accent-dim);
        color: var(--accent)
    }

.topbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    align-items: center
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all .15s
}

    .btn-icon:hover {
        border-color: var(--accent);
        color: var(--accent)
    }

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green)
}

/* ── SIDEBAR GAUCHE ── */
.sidebar-left {
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--border)
}

.sidebar-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600
}

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    cursor: pointer;
    text-align: center;
    transition: all .2s
}

    .tool-card:hover {
        border-color: var(--accent);
        background: var(--accent-dim)
    }

    .tool-card.active {
        border-color: var(--teal);
        background: var(--teal-dim)
    }

    .tool-card .tool-icon {
        font-size: 20px;
        margin-bottom: 4px;
        display: block
    }

    .tool-card .tool-name {
        font-size: 10px;
        color: var(--text-secondary);
        line-height: 1.2
    }

    .tool-card.active .tool-name {
        color: var(--teal)
    }

.file-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    padding: 12px
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s
}

    .file-item:hover {
        background: var(--bg-hover)
    }

    .file-item.active {
        background: var(--accent-dim);
        border-color: var(--border)
    }

.file-thumb {
    width: 36px;
    height: 24px;
    border-radius: 4px;
    background: var(--bg-deep);
    flex-shrink: 0;
    overflow: hidden
}

    .file-thumb canvas {
        width: 100%;
        height: 100%
    }

.file-info {
    flex: 1;
    min-width: 0
}

.file-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary)
}

.file-meta {
    font-size: 10px;
    color: var(--text-muted)
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 18px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    color: var(--text-muted);
    margin: 10px 12px 0
}

    .drop-zone:hover, .drop-zone.drag-over {
        border-color: var(--accent);
        color: var(--accent);
        background: var(--accent-dim)
    }

    .drop-zone .dz-icon {
        font-size: 24px;
        display: block;
        margin-bottom: 4px
    }

    .drop-zone .dz-text {
        font-size: 11px
    }

    .drop-zone .dz-sub {
        font-size: 10px;
        color: var(--text-muted);
        margin-top: 2px
    }

/* ── ZONE CENTRALE ── */
.main-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0
}

.preview-zone {
    height: 300px;
    padding: 18px;
    align-items: center;
    justify-content: center;
    background: #E8ECF5;
    position: relative;
    overflow: hidden
}

.video-preview {
    width: 100%;
    max-width: 1120px;
    max-height: 100%;
    aspect-ratio: 16/9;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    position: relative;
    overflow: hidden
}

.video-canvas {
    width: 100%;
    height: 100%;
    display: block
}

.preview-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none
}

.play-btn-big {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(79,70,229,.86);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    backdrop-filter: blur(4px);
    pointer-events: all
}

    .play-btn-big:hover {
        transform: scale(1.08);
        background: var(--accent)
    }

    .play-btn-big svg {
        width: 24px;
        height: 24px;
        fill: white;
        margin-left: 3px
    }

.tc-display {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-family: 'Courier New',monospace;
    font-size: 13px;
    color: #FFF;
    background: rgba(17,24,39,.72);
    padding: 4px 8px;
    border-radius: 4px
}

/* ── TIMELINE ── */
.timeline-area {
    height: 210px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column
}

.tl-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap
}

.tl-btn {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all .15s
}

    .tl-btn:hover {
        border-color: var(--accent);
        color: var(--accent)
    }

    .tl-btn.active {
        background: var(--accent);
        border-color: var(--accent);
        color: white
    }

.tl-tc {
    font-family: 'Courier New',monospace;
    font-size: 13px;
    color: var(--teal);
    background: var(--bg-card);
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid var(--border-teal);
    min-width: 100px;
    text-align: center
}

.tl-zoom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto
}

    .tl-zoom label {
        font-size: 10px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 1px
    }

    .tl-zoom input[type=range] {
        width: 80px;
        accent-color: var(--accent)
    }

.tl-body {
    flex: 1;
    overflow: hidden;
    padding: 4px 0
}

.tl-track-row {
    display: flex;
    align-items: center;
    height: 32px
}

.tl-track-label {
    width: 80px;
    padding: 0 10px;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    text-align: right
}

.tl-track {
    flex: 1;
    height: 26px;
    background: var(--bg-card);
    border-radius: 4px;
    margin: 0 10px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border)
}

    .tl-track:hover {
        border-color: rgba(108,99,255,.35)
    }

.tl-clip {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 3px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .5px;
    cursor: grab;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}

    .tl-clip.video {
        background: linear-gradient(90deg,#E0E7FF,#C7D2FE);
        border: 1px solid var(--accent);
        color: #312E81
    }

    .tl-clip.audio {
        background: linear-gradient(90deg,#CCFBF1,#A5F3FC);
        border: 1px solid var(--teal);
        color: #155E75
    }

    .tl-clip.fx {
        background: linear-gradient(90deg,#FEF3C7,#FDE68A);
        border: 1px solid var(--amber);
        color: #92400E
    }

.tl-playhead {
    position: absolute;
    top: 0;
    width: 2px;
    background: var(--red);
    height: 100%;
    pointer-events: none;
    z-index: 10
}

    .tl-playhead::before {
        content: '';
        display: block;
        width: 9px;
        height: 9px;
        background: var(--red);
        border-radius: 50% 50% 0 0;
        margin-left: -4px
    }

.tl-ruler {
    height: 18px;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    position: relative
}

/* ── PANNEAU DROITE ── */
.sidebar-right {
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0
}

.panel-tab {
    flex: 1;
    padding: 11px 8px;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s
}

    .panel-tab.active {
        color: var(--accent);
        border-bottom-color: var(--accent)
    }

    .panel-tab:hover {
        color: var(--text-primary)
    }

.panel-body {
    flex: 1;
    overflow-y: auto
}

.panel-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px
}

.prop-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px
}

.prop-group-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px
}

    .prop-group-title::before {
        content: '';
        display: block;
        width: 3px;
        height: 10px;
        background: var(--accent);
        border-radius: 2px
    }

.prop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px
}

    .prop-row:last-child {
        margin-bottom: 0
    }

.prop-label {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 70px
}

.prop-ctrl {
    flex: 1
}

.prop-input {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    padding: 5px 8px;
    outline: none;
    font-family: 'Courier New',monospace
}

    .prop-input:focus {
        border-color: var(--accent)
    }

.prop-range {
    width: 100%;
    accent-color: var(--accent)
}

.prop-select {
    width: 100%;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 12px;
    padding: 5px 8px;
    outline: none
}

    .prop-select:focus {
        border-color: var(--accent)
    }

.color-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s
}

    .color-swatch.active {
        border-color: var(--text-primary);
        transform: scale(1.15)
    }

.meter-bar {
    height: 8px;
    background: var(--bg-deep);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px
}

.meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .1s
}

    .meter-fill.green {
        background: var(--green)
    }

    .meter-fill.amber {
        background: var(--amber)
    }

    .meter-fill.red {
        background: var(--red)
    }

.export-btns {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: pointer;
    transition: all .2s;
    color: var(--text-primary);
    font-size: 13px
}

    .btn-export:hover {
        border-color: var(--teal);
        background: var(--teal-dim);
        color: var(--teal)
    }

    .btn-export .fmt-badge {
        font-size: 10px;
        font-weight: 700;
        padding: 2px 6px;
        border-radius: 4px;
        letter-spacing: 1px
    }

    .btn-export .fmt-info {
        font-size: 11px;
        color: var(--text-secondary);
        margin-left: auto
    }

.btn-primary {
    width: 100%;
    padding: 11px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .5px;
    transition: all .2s
}

    .btn-primary:hover {
        background: #7C75FF
    }

    .btn-primary:active {
        transform: scale(.98)
    }

.waveform-mini {
    height: 36px;
    background: var(--bg-deep);
    border-radius: 5px;
    overflow: hidden
}

.histogram-wrap {
    height: 70px;
    background: var(--bg-deep);
    border-radius: 5px;
    overflow: hidden
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: 600
}

    .badge-pill.processing {
        background: rgba(79,70,229,.12);
        color: var(--accent);
        border: 1px solid var(--accent)
    }

    .badge-pill.ready {
        background: rgba(46,204,113,.15);
        color: var(--green);
        border: 1px solid var(--green)
    }

    .badge-pill.none {
        background: var(--bg-deep);
        color: var(--text-muted);
        border: 1px solid var(--border)
    }

.info-val {
    font-family: 'Courier New',monospace;
    font-size: 11px;
    color: var(--teal)
}

/* ── PROGRESS OVERLAY ── */
.progress-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(245,247,251,.9);
    z-index: 500;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px
}

    .progress-overlay.show {
        display: flex
    }

.progress-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 40px;
    text-align: center;
    min-width: 340px
}

.progress-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px
}

.progress-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 18px
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,var(--accent),var(--teal));
    border-radius: 3px;
    width: 0;
    transition: width .3s
}

.progress-pct {
    font-family: 'Courier New',monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--teal);
    margin-top: 12px
}

.progress-eta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 8px
}

.btn-cancel {
    margin-top: 14px;
    padding: 7px 20px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px
}

    .btn-cancel:hover {
        border-color: var(--red);
        color: var(--red)
    }

/* ── TOAST ── */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    animation: slideIn .3s ease;
    min-width: 260px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08)
}

    .toast.success {
        border-left: 3px solid var(--green)
    }

    .toast.info {
        border-left: 3px solid var(--accent)
    }

    .toast.warning {
        border-left: 3px solid var(--amber)
    }

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

@keyframes fadeOut {
    to {
        transform: translateX(100%);
        opacity: 0
    }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar {
    width: 5px;
    height: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: var(--bg-hover);
    border-radius: 3px
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted)
    }

/* ── LUT GRID ── */
.lut-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px
}

.lut-item {
    padding: 7px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 10px;
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all .15s
}

    .lut-item:hover {
        border-color: var(--teal);
        color: var(--teal)
    }

    .lut-item.active {
        border-color: var(--teal);
        color: var(--teal);
        background: var(--teal-dim)
    }

/* ── CANVAS COLOR ── */
canvas {
    display: block
}

.preview-canvas-wrap {
    background: #111827;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px
}

.panel-claude {
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius2);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

    .panel-claude + .panel-claude {
        width: 100%;
        margin-top: 12px;
    }

    .panel-claude img {
        display: block;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
    }

    .panel-claude p {
        margin: 0 0 4px;
        font-size: 0.9em;
        font-weight: 600;
        color: var(--text2);
    }

    .panel-claude a {
        font-size: 0.85em;
        color: var(--text3);
        text-decoration: none;
        overflow-wrap: anywhere;
    }

        .panel-claude a:hover {
            color: var(--accent);
            text-decoration: underline;
        }
