/* ACT — Dark Theme */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-tertiary: #242836;
    --text-primary: #e4e4e7;
    --text-muted: #a1a1aa;
    --accent: #6366f1;
    --green: #22c55e;
    --yellow: #eab308;
    --red: #ef4444;
    --border: #2e3348;
}

/* Base */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Utility classes */
.bg-act-primary { background-color: var(--bg-primary); }
.bg-act-secondary { background-color: var(--bg-secondary); }
.bg-act-tertiary { background-color: var(--bg-tertiary); }
.text-act-text { color: var(--text-primary); }
.text-act-muted { color: var(--text-muted); }
.text-act-accent { color: var(--accent); }
.bg-act-accent { background-color: var(--accent); }
.border-act-border { border-color: var(--border); }

/* Alert badges */
.alert-green {
    background-color: rgba(34, 197, 94, 0.15);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.alert-yellow {
    background-color: rgba(234, 179, 8, 0.15);
    color: var(--yellow);
    border: 1px solid rgba(234, 179, 8, 0.2);
}
.alert-red {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
    animation: pulse-red 2s ease-in-out infinite;
}
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.15); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Focus */
textarea:focus, input:focus, select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 1px var(--accent);
    outline: none;
}

/* Heatmap cell */
.heatmap-cell {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    line-height: 1;
    color: white;
    margin: 1px;
    transition: transform 0.15s, box-shadow 0.15s;
}
.heatmap-cell:hover {
    transform: scale(1.4);
    z-index: 10;
    box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

/* Session row */
.session-row {
    padding: 10px 10px 10px 1px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s;
    display: flex;
    margin-left: 1px;
}
.session-row:hover {
    background-color: rgba(99, 102, 241, 0.05);
}
.session-check {
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 5px;
    margin-left: 5px;
}
.session-check:hover, .toggle-check:hover {
    border-color: var(--indigo) !important;
    opacity: 1 !important;
}
.toggle-check {
    cursor: pointer;
    transition: all 0.15s ease;
}

/* Loading spinner */
.spinner {
    border: 2px solid var(--border);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Page transition */
main {
    animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card hover effects */
.group:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

/* Turn detail expand */
.turn-item {
    border-radius: 8px;
    transition: background-color 0.15s;
}
.turn-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Monospace for numbers */
.font-mono {
    font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

/* Dashboard grid — wide center column, fixed sidebars */
.dashboard-grid {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
}
.dash-left { min-width: 0; }
.dash-center { min-width: 0; overflow-x: auto; }
.dash-right { min-width: 0; }

/* Tablet: 2-column layout, stack right panel below */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 300px 1fr;
    }
    .dash-right {
        grid-column: 1 / -1;
    }
}

/* Small tablet: stack all */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .dash-left, .dash-center, .dash-right {
        grid-column: span 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .grid-cols-12 { grid-template-columns: 1fr !important; }
    .col-span-12, .col-span-5, .col-span-7,
    .col-span-8, .col-span-4 {
        grid-column: span 1 / span 1 !important;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px !important;
    }
    nav { padding: 12px 16px; }
    main { padding: 16px; }
    .text-6xl, .text-7xl { font-size: 3rem !important; }
    .hidden-mobile { display: none !important; }
}

/* Extra small screens */
@media (max-width: 480px) {
    main { padding: 8px; }
    .dashboard-grid { gap: 12px !important; }
    .heatmap-cell { width: 22px; height: 22px; }
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-tertiary) 25%,
        rgba(99, 102, 241, 0.05) 50%,
        var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Batch upload dropzone */
.batch-dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.batch-dropzone:hover,
.batch-dropzone.drag-over {
    border-color: var(--accent);
    background-color: rgba(99, 102, 241, 0.05);
}

/* Batch progress bar */
.batch-progress-bar {
    transition: width 0.3s ease-out;
}

/* Batch summary stats */
.batch-summary-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}
.batch-summary-stat .label { color: var(--text-muted); }
.batch-summary-stat .value { color: var(--text-primary); font-family: 'SF Mono', 'Cascadia Code', monospace; }
