/* ===========================================
   NIVEAU DATA - Zen Workspace Design
   =========================================== */

/* ===== ROOT VARIABLES ===== */
:root {
    /* Brand Colors - Zen Mode */
    --primary: #0f172a;
    /* Slate 900 */
    --accent: #2563eb;
    /* Blue 600 */
    --success: #16a34a;
    /* Green 600 */
    --error: #dc2626;
    /* Red 600 */
    --warning: #d97706;
    /* Amber 600 */

    /* Backgrounds */
    --bg-app: #ffffff;
    --bg-panel: #f8fafc;
    /* Slate 50 */
    --bg-editor: #ffffff;
    --bg-hover: #f1f5f9;
    /* Slate 100 */

    /* Borders & Lines */
    --border-subtle: #e2e8f0;
    /* Slate 200 */
    --border-focus: #94a3b8;
    /* Slate 400 */

    /* Text */
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */

    /* Category Colors */
    --cat-python: #2563eb;
    --cat-pandas: #db2777;
    --cat-numpy: #7c3aed;
    --cat-viz: #d97706;
    --cat-stats: #059669;
}

/* ===== BASE STYLES ===== */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-app);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Zen Layout Engine */
.zen-wrapper {
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100vh;
    max-width: 100vw;
}

.zen-header {
    height: 48px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-app);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 10;
}

.zen-workspace {
    display: grid;
    grid-template-columns: 40% 60%;
    overflow: hidden;
    height: 100%;
}

.panel-left {
    background: var(--bg-panel);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    padding: 2rem;
}

.panel-right {
    background: var(--bg-editor);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Typography Overrides */
h1,
h2,
h3 {
    letter-spacing: -0.02em;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animation Utils */
.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ===== COMPONENTS ===== */

/* Glass Cards */
/* Glass Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    border-radius: 24px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.glass-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

/* Typography Gradient - Subtle Dark Shift */
.text-gradient {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

/* Buttons */
/* Buttons */
.btn-primary {
    background: #000000;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    background: #1e293b;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}



.btn-success {
    background: #10b981;
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2);
    transition: all 0.2s ease;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-ready {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

.badge-needs-review {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Progress Bar */
.progress-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 9999px;
    height: 6px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #ec4899);
    border-radius: 9999px;
    transition: width 0.6s var(--ease-elastic);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.5);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 10px;
    background: white;
    filter: blur(4px);
    opacity: 0.5;
}

/* Option Cards (QCM) */
.option-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.option-card:hover {
    background: rgba(99, 102, 241, 0.08);
    /* slight primary tint */
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(4px);
}

.option-card.selected {
    background: rgba(99, 102, 241, 0.15);
    border-color: #818cf8;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15) inset;
}

.option-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.option-card:hover .option-circle {
    border-color: var(--primary-glow);
    color: var(--primary-glow);
}

.option-card.selected .option-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

/* Monaco Editor */
/* Monaco Editor */
.monaco-container {
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.05);
}

.monaco-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2), inset 0 0 20px rgba(0, 0, 0, 0.05);
}

/* Console Output */
.console-output {
    background: #1e293b;
    /* Keep dark for terminal feel, but smoother */
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    max-height: 250px;
    overflow-y: auto;
    color: #f1f5f9;
    /* Light text for dark terminal */
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.console-output .success {
    color: #4ade80;
}

.console-output .error {
    color: #f87171;
}

.console-output .info {
    color: #94a3b8;
    font-style: italic;
}

/* Test Results */
.test-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border-left: 3px solid transparent;
}

.test-result.passed {
    border-left-color: var(--success);
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
}

.test-result.failed {
    border-left-color: var(--danger);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), transparent);
}

/* Admin Specific */
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.kpi-value {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #0f172a, #475569);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 1rem;
    text-align: left;
}

.data-table tr:not(thead tr) {
    background: rgba(30, 41, 59, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.data-table tr:not(thead tr):hover {
    background: rgba(30, 41, 59, 0.8);
    transform: scale(1.01);
}

.data-table td {
    padding: 1rem;
}

.data-table td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.data-table td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Category Colors */
.category-python {
    color: #818cf8;
}

.category-pandas {
    color: #34d399;
}

.category-numpy {
    color: #fbbf24;
}

.category-visualization {
    color: #f472b6;
}

.category-statistics {
    color: #c084fc;
}

.bg-category-python {
    background-color: #818cf8;
}

.bg-category-pandas {
    background-color: #34d399;
}

/* Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* Modal Drawer Style */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: flex-end;
    /* Align right */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #0f172a;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    border-left: 1px solid var(--glass-border);
    padding: 2rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-elastic);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal-content {
    transform: translateX(0);
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        max-width: 100%;
    }

    .kpi-value {
        font-size: 2.5rem;
    }
}