/* ============================================
   TTX Platform — Intel Theme
   Deep Navy + Blue (#60a5fa)
   Based on cyber1.css design language
   ============================================ */

:root {
    --bg-primary:    #0a1421;
    --bg-secondary:  #0f1e38;
    --bg-tertiary:   #132340;
    --bg-card:       #0f1e38;
    --bg-card-hover: #1e3a5f;
    --border-color:  #2b4f7c;
    --border-glow:   #60a5fa;
    --text-primary:  #e2e8f0;
    --text-secondary:#94a3b8;
    --text-muted:    #4a6080;
    --accent-green:  #6ee7b7;
    --accent-cyan:   #7dd3fc;
    --accent-blue:   #60a5fa;
    --accent-purple: #c4b5fd;
    --accent-red:    #fca5a5;
    --accent-orange: #fcd34d;
    --accent-yellow: #fde68a;
    --glow-green:    0 0 16px rgba(110,231,183,0.2);
    --glow-cyan:     0 0 16px rgba(125,211,252,0.2);
    --glow-red:      0 0 16px rgba(252,165,165,0.2);
    --font-display:  'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, SFMono-Regular, monospace;
    --font-body:     -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono:     'SF Mono', 'Fira Code', 'Cascadia Code', ui-monospace, SFMono-Regular, monospace;
    --sidebar-width: 260px;
    --header-height: 60px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: rgba(59,130,246,0.3); color: #e2e8f0; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0b1120; }
::-webkit-scrollbar-thumb { background: #1e3a5f; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #2b4f7c; }

a { color: var(--accent-blue); text-decoration: none; transition: all .15s; }
a:hover { color: var(--accent-cyan); }

/* ── LAYOUT ────────────────────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ───────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    position: fixed; top: 0; bottom: 0; left: 0;
    display: flex; flex-direction: column;
    z-index: 100; transition: transform 0.3s;
}

.sidebar-brand {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-brand h1 {
    font-family: var(--font-mono);
    font-size: 13px; font-weight: 700;
    color: var(--accent-blue);
    letter-spacing: 3px; text-transform: uppercase;
}

.sidebar-brand .tagline {
    font-family: var(--font-mono);
    font-size: 10px; color: var(--text-muted);
    letter-spacing: 2px; margin-top: 4px;
}

.sidebar-nav { flex: 1; padding: 15px 0; overflow-y: auto; }
.nav-section { padding: 0 15px; margin-bottom: 5px; }

.nav-section-label {
    font-family: var(--font-mono);
    font-size: 9px; color: var(--text-muted);
    letter-spacing: 2px; text-transform: uppercase;
    padding: 10px 12px 5px;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px; border-radius: 2px;
    color: var(--text-secondary);
    font-weight: 500; font-size: 13px;
    font-family: var(--font-mono);
    transition: all .15s; margin: 2px 0;
}
.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active {
    background: rgba(59,130,246,0.15);
    color: var(--accent-blue);
    border-left: 2px solid var(--accent-blue);
}
.nav-item i { width: 20px; text-align: center; font-size: 13px; }

.nav-badge {
    margin-left: auto; background: var(--accent-red);
    color: #0f1e38; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 2px;
    font-family: var(--font-mono);
}

.sidebar-footer { padding: 15px; border-top: 1px solid var(--border-color); }

.user-card {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: 2px;
    background: var(--bg-tertiary);
}

.user-avatar {
    width: 36px; height: 36px; border-radius: 2px;
    background: linear-gradient(135deg, #1d4ed8, #60a5fa);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono);
    font-size: 12px; font-weight: 700; color: white;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ── MAIN CONTENT ──────────────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* ── HEADER ────────────────────────────────────────────────────── */
.top-header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 25px; position: sticky; top: 0; z-index: 50;
}
.header-left { display: flex; align-items: center; gap: 15px; }
.breadcrumb { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { color: var(--accent-blue); }
.header-right { display: flex; align-items: center; gap: 15px; }

.header-search { position: relative; }
.header-search input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 2px; padding: 7px 12px 7px 34px;
    color: var(--text-primary);
    font-family: var(--font-mono); font-size: 13px; width: 220px;
    transition: all 0.3s;
}
.header-search input:focus {
    outline: none; border-color: var(--accent-blue);
    box-shadow: 0 0 8px rgba(59,130,246,0.2); width: 300px;
}
.header-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }

.header-btn {
    width: 36px; height: 36px; border-radius: 2px;
    background: var(--bg-tertiary); border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; transition: all .2s;
}
.header-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.header-btn .badge {
    position: absolute; top: -4px; right: -4px;
    width: 16px; height: 16px; background: var(--accent-red);
    border-radius: 50%; font-size: 9px;
    display: flex; align-items: center; justify-content: center; font-weight: 700;
}

/* ── PAGE CONTENT ──────────────────────────────────────────────── */
.page-content { flex: 1; padding: 25px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.page-title { font-family: var(--font-mono); font-size: 14px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

/* ── CARDS ─────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 2px; overflow: hidden; transition: all .2s;
}
.card:hover { border-color: rgba(96,165,250,0.4); box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
.card-header {
    padding: 12px 18px; border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,0.02);
}
.card-header h3 { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-blue); }
.card-body { padding: 18px; }

/* ── GRID ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── STAT CARDS ────────────────────────────────────────────────── */
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 2px; padding: 18px; position: relative; overflow: hidden;
}
.stat-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, #1d4ed8, #60a5fa);
}
.stat-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.stat-value { font-family: var(--font-mono); font-size: 26px; font-weight: 800; color: var(--accent-blue); }
.stat-detail { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── BUTTONS ───────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 2px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 600;
    cursor: pointer; border: 1px solid transparent;
    transition: all .15s; text-decoration: none;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.btn-primary { background: #3b82f6; color: white; border-color: rgba(29,78,216,0.5); }
.btn-primary:hover { background: #1d4ed8; color: white; }
.btn-secondary { background: #1e3a5f; color: #cbd5e1; border-color: #2b4f7c; }
.btn-secondary:hover { border-color: #3b82f6; background: #2b4f7c; color: var(--text-primary); }
.btn-danger { background: transparent; color: var(--accent-red); border-color: rgba(252,165,165,0.3); }
.btn-danger:hover { background: rgba(252,165,165,0.1); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 13px; }

/* ── FORMS ─────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 8px 12px;
    background: #0f1e38; border: 1px solid #2b4f7c;
    border-radius: 2px; color: var(--text-primary);
    font-family: var(--font-mono); font-size: 13px; transition: all .2s;
}
.form-control::placeholder { color: #6b7280; }
.form-control:focus { outline: none; border-color: #60a5fa; box-shadow: 0 0 6px rgba(96,165,250,0.2); }
select.form-control { cursor: pointer; }
textarea.form-control { min-height: 100px; resize: vertical; }

/* ── TABLES ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border-color); background: rgba(255,255,255,0.01); }
td { padding: 10px 14px; border-bottom: 1px solid rgba(43,79,124,0.4); font-size: 13px; }
tr:hover td { background: var(--bg-card-hover); }

/* ── BADGES ────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 2px; font-family: var(--font-mono); font-size: 11px; font-weight: 500; border-width: 1px; border-style: solid; }
.badge-green  { background: rgba(5,150,105,0.15);  color: #6ee7b7; border-color: rgba(5,150,105,0.3); }
.badge-cyan   { background: rgba(6,182,212,0.15);  color: #7dd3fc; border-color: rgba(6,182,212,0.3); }
.badge-blue   { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.3); }
.badge-purple { background: rgba(139,92,246,0.15); color: #c4b5fd; border-color: rgba(139,92,246,0.3); }
.badge-red    { background: rgba(185,28,28,0.15);  color: #fca5a5; border-color: rgba(185,28,28,0.3); }
.badge-orange { background: rgba(217,119,6,0.15);  color: #fcd34d; border-color: rgba(217,119,6,0.3); }
.badge-yellow { background: rgba(217,119,6,0.1);   color: #fde68a; border-color: rgba(217,119,6,0.25); }

.tag { display: inline-block; padding: 1px 7px; background: var(--bg-tertiary); border: 1px solid var(--border-color); border-radius: 2px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin: 2px; }

/* ── ALERTS ────────────────────────────────────────────────────── */
.flash-messages { padding: 0 25px; }
.alert {
    padding: 10px 16px; border-radius: 2px; margin-bottom: 12px;
    font-size: 13px; display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); animation: slideDown 0.3s ease;
    border-width: 1px; border-style: solid;
}
.alert-success { background: rgba(5,150,105,0.1);  border-color: rgba(5,150,105,0.3);  color: #6ee7b7; }
.alert-error   { background: rgba(185,28,28,0.1);  border-color: rgba(185,28,28,0.3);  color: #fca5a5; }
.alert-warning { background: rgba(217,119,6,0.1);  border-color: rgba(217,119,6,0.3);  color: #fde68a; }
.alert-info    { background: rgba(6,182,212,0.1);  border-color: rgba(6,182,212,0.3);  color: #7dd3fc; }

/* ── SEVERITY ──────────────────────────────────────────────────── */
.severity-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.severity-info     { background: var(--accent-cyan); }
.severity-low      { background: var(--accent-green); }
.severity-medium   { background: var(--accent-yellow); }
.severity-high     { background: var(--accent-orange); }
.severity-critical { background: var(--accent-red); animation: pulse 1.5s infinite; }

/* ── PROGRESS ──────────────────────────────────────────────────── */
.progress-bar { height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #1d4ed8, #60a5fa); transition: width 0.5s ease; }

/* ── DIFF ──────────────────────────────────────────────────────── */
.diff-beginner    { color: var(--accent-green); }
.diff-intermediate { color: var(--accent-cyan); }
.diff-advanced    { color: var(--accent-orange); }
.diff-expert      { color: var(--accent-red); }

/* ── EMPTY STATE ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 40px; margin-bottom: 15px; opacity: 0.2; display: block; }
.empty-state h3 { font-family: var(--font-mono); font-size: 13px; margin-bottom: 8px; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; }

/* ── TABS ──────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 20px; }
.tab { padding: 8px 18px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
.tab:hover { color: var(--text-secondary); }
.tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

/* ── ANIMATIONS ────────────────────────────────────────────────── */
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ── RESPONSIVE ────────────────────────────────────────────────── */
.mobile-toggle { display: none; }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 15px; align-items: flex-start; }
}
