/* Modern Design System - Teleprompter */

/* Design Tokens */
:root {
    /* Palette */
    --surface-0: #0b1020;
    --surface-1: #101627;
    --surface-2: #131b31;
    --surface-3: #1b2542;
    --text-0: #e8eefc;
    --text-1: #b7c3e0;
    --primary-0: #5b8cff;
    --primary-1: #3c73ff;
    --success-0: #16bd6f;
    --warning-0: #f7b733;
    --danger-0: #ef476f;

    /* Accent gradients */
    --grad-primary: linear-gradient(135deg, #5b8cff 0%, #3c73ff 100%);
    --grad-surface: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0));

    /* Effects */
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.35);
    --ring: 0 0 0 2px rgba(91,140,255,0.35);
    --radius: 10px;
    --radius-sm: 8px;
    --radius-lg: 14px;
    --transition: 160ms cubic-bezier(.2,.7,.1,1);
}

/* Back-compat variable aliases for legacy zune theme tokens */
:root {
    --zune-black: var(--surface-0);
    --zune-dark: var(--surface-1);
    --zune-gray: rgba(183,195,224,0.16);
    --zune-light-gray: rgba(183,195,224,0.28);
    --zune-accent: var(--primary-0);
    --zune-accent-hover: var(--primary-1);
    --zune-white: var(--text-0);
    --zune-text: var(--text-0);
    --zune-text-dim: var(--text-1);

    /* Tile brand colors */
    --tile-blue: #3c73ff;
    --tile-green: #16bd6f;
    --tile-orange: #f7b733;
    --tile-purple: #9b6dff;
    --tile-red: #ef476f;
    --tile-teal: #40e0d0;

    --tile-gap: 12px;
    --tile-padding: 20px;
    --border-radius: 10px;
}

/* Base */
body {
    background: radial-gradient(1200px 600px at 10% -10%, rgba(91,140,255,0.10), transparent),
                radial-gradient(900px 500px at 100% 0%, rgba(22,189,111,0.08), transparent),
                var(--surface-0);
    color: var(--text-0);
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.container { max-width: 1280px; padding: 24px; }

/* Header */
.header { background: transparent; margin-bottom: 24px; border-bottom: none; }
.header-content { padding: 0 8px; }
.logo { color: var(--text-0); font-weight: 600; }
.logo-icon { background: var(--grad-primary); box-shadow: var(--shadow-sm); border-radius: 10px; }

/* Nav */
.nav { gap: 10px; }
.nav-item {
    background: transparent;
    color: var(--text-1);
    border: 1px solid rgba(183,195,224,0.15);
    backdrop-filter: blur(6px);
    border-radius: var(--radius-sm);
}
.nav-item:hover, .nav-item.active {
    color: var(--text-0);
    background: rgba(91,140,255,0.12);
    border-color: rgba(91,140,255,0.45);
}

/* Tiles grid */
.tiles-grid { gap: 16px; }

/* Tile Base mapped to existing classes */
.tile {
    background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00)) , var(--surface-1);
    border: 1px solid rgba(183,195,224,0.12);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    cursor: default;
}
.tile:hover { border-color: rgba(91,140,255,0.35); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* Size helpers remain */
.tile-small { min-height: 100px; }
.tile-medium { min-height: 140px; }
.tile-large { min-height: 180px; grid-column: span 2; }
.tile-wide { grid-column: span 2; }

/* Color tags repurposed as subtle accents instead of gradients */
.tile-blue { border-color: rgba(91,140,255,0.35); }
.tile-green { border-color: rgba(22,189,111,0.35); }
.tile-orange { border-color: rgba(247,183,51,0.35); }
.tile-purple { border-color: rgba(155,109,255,0.35); }
.tile-red { border-color: rgba(239,71,111,0.35); }
.tile-teal { border-color: rgba(64,224,208,0.35); }

.tile-header { margin-bottom: 10px; }
.tile-title { color: var(--text-0); font-weight: 700; letter-spacing: 0.2px; }
.tile-subtitle { color: var(--text-1); }
.tile-description { color: var(--text-1); }

/* Action tiles */
.action-tile { background: var(--surface-2); border: 1px dashed rgba(183,195,224,0.25); }
.action-tile:hover { background: var(--surface-3); border-color: rgba(91,140,255,0.45); }
.action-tile-icon { color: var(--primary-0); }
.action-tile-text { color: var(--text-0); }

/* Status tiles */
.status-tile { background: var(--surface-1); }
.status-indicator { border: 1px solid rgba(183,195,224,0.2); }
.status-online { background: rgba(22,189,111,0.15); color: #4be28f; border-color: rgba(22,189,111,0.35); }
.status-offline { background: rgba(239,71,111,0.15); color: #ff8fa5; border-color: rgba(239,71,111,0.35); }

/* Buttons (maps to existing .btn classes) */
.btn {
    background: var(--grad-primary);
    color: white;
    border-radius: 10px;
    border: 0;
    box-shadow: 0 4px 14px rgba(91,140,255,0.35);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(91,140,255,0.45); }
.btn-secondary { background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.00)) , var(--surface-2); color: var(--text-0); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-small { border-radius: 8px; }

/* Forms */
.form-label { color: var(--text-1); }
.form-input {
    background: var(--surface-2);
    border: 1px solid rgba(183,195,224,0.16);
    color: var(--text-0);
}
.form-input:focus { outline: none; box-shadow: var(--ring); border-color: rgba(91,140,255,0.45); }
.form-textarea { background: var(--surface-2); }

/* Modals */
.modal { background: rgba(5, 8, 16, 0.72); backdrop-filter: blur(8px); }
.modal-content { background: var(--surface-1); border: 1px solid rgba(183,195,224,0.14); border-radius: var(--radius-lg); }
.modal-header, .modal-footer { border-color: rgba(183,195,224,0.12); }
.modal-title { color: var(--text-0); }
.modal-close { color: var(--text-1); }

/* Display page specifics mapping existing classes */
.display-page { background: var(--surface-0); color: var(--text-0); }
.teleprompter-controls { background: var(--surface-1); border-color: rgba(183,195,224,0.14); border-radius: var(--radius-sm); }
.teleprompter-controls button { background: var(--surface-2); border-color: rgba(183,195,224,0.16); color: var(--text-0); }
.teleprompter-controls button:hover, .teleprompter-controls button.active { background: var(--grad-primary); border-color: transparent; }
.teleprompter-status { background: var(--surface-1); border-color: rgba(183,195,224,0.14); color: var(--text-1); }
.teleprompter-settings { background: var(--surface-1); border-color: rgba(183,195,224,0.14); color: var(--text-0); }
.teleprompter-text { color: var(--text-0); }

/* Footer connection bar */
.connection-footer { background: var(--surface-1); color: var(--text-1); border-top: 1px solid rgba(183,195,224,0.14); }
.connection-footer .status-dot { background-color: var(--danger-0); }
.connection-footer .status-dot.ok { background-color: var(--success-0); }
.connection-footer .status-dot.warn { background-color: var(--warning-0); }
.connection-footer .status-dot.err { background-color: var(--danger-0); }

/* Operator toolbar */
.operator-toolbar {
    position: sticky;
    top: 0;
    z-index: 1500;
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    margin: 0 0 12px 0;
    background: rgba(16,22,39,0.85);
    border: 1px solid rgba(183,195,224,0.14);
    border-radius: 12px;
    backdrop-filter: blur(8px);
}
.operator-toolbar .toolbar-group { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; }
.operator-toolbar label { color: var(--text-1); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.operator-toolbar input[type="range"] { width: 100%; }

/* Responsive tweaks */
@media (max-width: 768px) {
    .tiles-grid { grid-template-columns: 1fr; }
    .tile-large, .tile-wide { grid-column: span 1; }
    .operator-toolbar { grid-template-columns: 1fr; }
}

