/* CINEMATIC DASHBOARD PANEL - ÉTAT INITIAL : CACHÉ */
.cinematic-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 0;
    height: 100vh;
    background-color: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
    visibility: hidden;
}

.cinematic-panel.hidden {
    width: 0;
    opacity: 0;
    visibility: hidden;
}

/* SPLIT-MODE : Dashboard visible à 30% */
body.split-mode .cinematic-panel,
.split-mode .cinematic-panel {
    width: 30%;
    opacity: 1;
    visibility: visible;
}

body.split-mode .cinematic-panel.hidden,
.split-mode .cinematic-panel.hidden {
    width: 0;
    opacity: 0;
    visibility: hidden;
}

.dashboard-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), transparent);
    position: relative; /* Pour positionner le bouton de fermeture */
}

/* 🎬 BOUTON DE FERMETURE MANUEL */
.dashboard-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: #e6eef6;
    font-size: 24px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
}

.dashboard-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.dashboard-close-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

.logo-mini {
    width: 30px;
    height: 30px;
    background: #3b82f6;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.dashboard-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    color: white;
    flex: 1;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.section-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* Timeline Override for Mini View */
.timeline {
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    padding-left: 1.5rem;
}

.step-item {
    margin-bottom: 1.5rem;
    position: relative;
    opacity: 0.5;
    transition: all 0.3s;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 0.7;
}

.step-marker {
    position: absolute;
    left: -1.9rem;
    width: 12px;
    height: 12px;
    background: #1e293b;
    border: 2px solid #64748b;
    border-radius: 50%;
}

.step-item.active .step-marker {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 0 10px #3b82f6;
}

.step-content h4 {
    font-size: 0.9rem;
    color: #e2e8f0;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-agent {
    font-size: 0.6rem;
    padding: 2px 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* LOGS MINI */
.terminal-body {
    background: #000;
    border-radius: 6px;
    padding: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    overflow-y: auto;
}


.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.top-bar h2 {
    font-weight: 300;
    font-size: 1.5rem;
}

.mission-meta {
    font-family: var(--font-code);
    color: var(--text-dim);
    display: flex;
    gap: 2rem;
}

/* DASHBOARD GRID */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    height: 100%;
    min-height: 0;
    /* Fix grid overflow */
}

/* CARDS */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.02);
}

.card-header h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}

.card-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* TIMELINE */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border);
}

.step-item {
    position: relative;
    margin-bottom: 2rem;
    opacity: 0.4;
    transition: all 0.3s;
}

.step-item.active {
    opacity: 1;
}

.step-item.completed {
    opacity: 0.8;
}

.step-marker {
    position: absolute;
    left: -2.45rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 2px solid var(--text-dim);
    z-index: 2;
}

.step-item.active .step-marker {
    border-color: var(--primary);
    background-color: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.step-item.completed .step-marker {
    border-color: var(--success);
    background-color: var(--success);
}

.step-item.failed .step-marker {
    border-color: var(--danger);
    background-color: var(--danger);
}

.step-content h4 {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-agent {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    font-family: var(--font-code);
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.step-output-files {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.file-chip {
    font-size: 0.75rem;
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(59, 130, 246, 0.2);
    text-decoration: none;
    transition: all 0.2s;
}

.file-chip:hover {
    background-color: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

/* RIGHT COLUMN */
.right-column {
    display: grid;
    grid-template-rows: 1fr 2fr;
    gap: 1.5rem;
    height: 100%;
}

/* TERMINAL / LOGS */
.terminal-body {
    background-color: #0d0d0d;
    font-family: var(--font-code);
    font-size: 0.85rem;
    color: #cccccc;
    padding: 1rem;
}

.log-entry {
    margin-bottom: 0.4rem;
    border-left: 2px solid transparent;
    padding-left: 0.5rem;
}

.log-entry.system {
    color: var(--accent);
    border-color: var(--accent);
}

.log-entry.gamma {
    color: var(--primary);
}

.log-entry.beta {
    color: var(--warning);
}

.log-entry.error {
    color: var(--danger);
    border-color: var(--danger);
}

.log-entry.success {
    color: var(--success);
    border-color: var(--success);
}

/* FOCUS CARD & SCANNING */
.focus-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 2rem;
}

.scanning-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 3s infinite linear;
    opacity: 0.5;
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

.empty-state {
    color: var(--text-dim);
    font-style: italic;
    padding: 2rem;
    text-align: center;
}