/* AI Computer Doctor — Global Styles */
:root {
    --bg: #0a0f1e;
    --bg-card: #111827;
    --bg-card-hover: #1a2332;
    --border: #1e293b;
    --text: #e2e8f0;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --green: #22c55e;
    --yellow: #f59e0b;
    --red: #ef4444;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    background: rgba(10, 15, 30, 0.95);
    backdrop-filter: blur(12px);
    z-index: 100;
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

nav { display: flex; gap: 24px; align-items: center; }
nav a { color: var(--text-muted); font-size: 0.9rem; transition: color .2s; }
nav a:hover { color: var(--text); text-decoration: none; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* === Hero === */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p { color: var(--text-muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto 32px; }

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color .2s;
}

.card:hover { border-color: var(--accent); }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 40px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }

.card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.card p { color: var(--text-muted); font-size: 0.9rem; }

/* === Pricing === */
.pricing { padding: 60px 0; }
.pricing h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; }

.price-card {
    text-align: center;
    padding: 32px 24px;
}

.price-card .price {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 16px 0 8px;
}

.price-card .period { color: var(--text-muted); font-size: 0.85rem; }

.price-card ul {
    list-style: none;
    margin: 20px 0;
    text-align: left;
}

.price-card li {
    padding: 6px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.price-card li::before { content: "✓ "; color: var(--green); font-weight: bold; }

.price-popular {
    border-color: var(--accent);
    position: relative;
}

.price-popular::before {
    content: "Популярный";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 2px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* === Forms === */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color .2s;
}

.form-group input:focus { border-color: var(--accent); }

/* === Dashboard === */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0 24px;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-card .label { font-size: 0.8rem; color: var(--text-muted); }
.stat-card .value { font-size: 1.8rem; font-weight: 700; margin-top: 4px; }
.stat-card .value.good { color: var(--green); }
.stat-card .value.warn { color: var(--yellow); }
.stat-card .value.bad { color: var(--red); }

/* === Health Score === */
.health-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 auto 16px;
}

.health-good { background: conic-gradient(var(--green) var(--pct), var(--border) 0); }
.health-warn { background: conic-gradient(var(--yellow) var(--pct), var(--border) 0); }
.health-bad { background: conic-gradient(var(--red) var(--pct), var(--border) 0); }

.health-ring .inner {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* === Issues List === */
.issue {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.issue:last-child { border-bottom: none; }

.issue .badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    height: fit-content;
}

.badge-critical { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-medium { background: rgba(245,158,11,0.15); color: var(--yellow); }
.badge-low { background: rgba(59,130,246,0.15); color: var(--accent); }

/* === Tabs === */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }

.tab {
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .2s;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* === Modal === */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 440px;
}

.modal h2 { margin-bottom: 20px; font-size: 1.3rem; }

/* === Toast === */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
    z-index: 300;
    animation: slideIn .3s ease;
}

.toast.success { background: var(--green); color: #000; display: block; }
.toast.error { background: var(--red); color: #fff; display: block; }

@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } }

/* === Footer === */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    margin-top: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* === Notification Bell === */
.notif-bell {
    position: relative;
    cursor: pointer;
    color: var(--text-muted);
    transition: color .2s;
    display: flex;
    align-items: center;
}

.notif-bell:hover { color: var(--accent); }

/* Language switcher */
.lang-switch {
    display: flex;
    gap: 2px;
    background: var(--bg);
    border-radius: 6px;
    padding: 2px;
    border: 1px solid var(--border);
}
.lang-link {
    display: block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 4px;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}
.lang-link:hover { color: var(--text); background: var(--bg-card-hover); }
.lang-link.active { color: #fff; background: var(--accent); }

.notif-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: var(--red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* === Notification Item === */
.notif-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: border-color .2s;
}

.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-item:hover { border-color: var(--accent); }

/* === API Key Item === */
.apikey-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

/* === Fleet Endpoint Card === */
.fleet-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fleet-card:hover { border-color: var(--accent); }

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-healthy { background: var(--green); }
.status-warning { background: var(--yellow); }
.status-critical { background: var(--red); }
.status-unknown { background: var(--text-muted); }

/* === Plan Card === */
.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: border-color .2s;
}

.plan-card:hover { border-color: var(--accent); }
.plan-card.current { border-color: var(--green); }

.plan-card .plan-price {
    font-size: 2rem;
    font-weight: 800;
    margin: 12px 0 4px;
}

/* === WebSocket Progress === */
.ws-progress {
    margin-top: 16px;
}

.ws-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.ws-step.active { color: var(--accent); }
.ws-step.done { color: var(--green); }

.ws-progress-bar {
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.ws-progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width .3s ease;
}

/* === Checkbox styling === */
input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent);
}

/* === Tabs overflow === */
.tabs { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; }

/* === Responsive === */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
    nav { gap: 12px; }
    .tabs { gap: 0; }
    .tab { padding: 8px 12px; font-size: 0.8rem; }
}
