/* VAIMAN Web Shell — стили */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #4d8eff;
    --primary-glow: rgba(77, 142, 255, 0.15);
    --bg: #0a0a1a;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.3);
    --header-h: 56px;
    --sidebar-w: 220px;
    --sidebar-collapsed: 64px;
    --mobile-tabs-h: 60px;
}

html, body {
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow: hidden;
    overflow-x: hidden;
}

/* === HEADER === */
.shell-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-back-btn {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.header-back-btn:hover { background: var(--surface-hover); }
.header-back-btn.visible { display: flex; }

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.header-logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-balance {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.header-balance:hover { background: var(--surface-hover); }

.vaim-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    margin-left: 2px;
}

.header-notify {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.header-notify:hover { color: var(--text); background: var(--surface); }

.notify-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s;
}

.header-avatar:hover { opacity: 0.85; }

/* === SIDEBAR === */
.sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: rgba(10, 10, 26, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    z-index: 90;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
}

.sidebar::-webkit-scrollbar { width: 0; }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
}

.nav-item svg { flex-shrink: 0; }

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 12px;
}

/* === CONTENT === */
.shell-content {
    position: fixed;
    top: var(--header-h);
    left: var(--sidebar-w);
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    background: var(--bg);
}

.app-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg);
}

/* === MOBILE TABS === */
.mobile-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-tabs-h);
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    z-index: 100;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 10px;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.15s;
}

.tab-item.active { color: var(--primary); }
.tab-item:active { opacity: 0.7; }

/* === NOTIFICATIONS === */
.notif-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 200;
}

.notif-overlay.show { display: block; }

.notifications-panel {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 90vw;
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    z-index: 201;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.notifications-panel.show { transform: translateX(0); }

.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.notif-header h3 { font-size: 16px; font-weight: 600; }

.notif-close {
    width: 32px;
    height: 32px;
    background: var(--surface);
    border: none;
    border-radius: 8px;
    color: var(--text-dim);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.notif-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
    font-size: 14px;
}

.notif-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.notif-card:hover { background: var(--surface-hover); }
.notif-card.unread { border-left: 3px solid var(--primary); }

.notif-card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.notif-card-body {
    font-size: 12px;
    color: var(--text-dim);
}

.notif-card-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* === TOAST === */
.shell-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30, 30, 50, 0.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 20px;
    color: var(--text);
    font-size: 14px;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.shell-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* === RESPONSIVE === */

/* Tablet: collapsed sidebar */
@media (max-width: 1024px) {
    .sidebar { width: var(--sidebar-collapsed); padding: 8px 6px; }
    .nav-label { display: none; }
    .nav-item { justify-content: center; padding: 10px; }
    .shell-content { left: var(--sidebar-collapsed); }
}

/* Mobile: no sidebar, bottom tabs */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .shell-content {
        left: 0;
        bottom: var(--mobile-tabs-h);
    }
    .mobile-tabs {
        display: flex;
    }
    .app-frame { width: 100%; max-width: 100%; }
    .header-logo-text { display: none; }
    .notifications-panel { top: 0; width: 100%; max-width: 100%; right: 0 !important; transform: translateX(100%); }
    .notifications-panel.show { transform: translateX(0) !important; }
}
