/* ===== ATechDown: OBSIDIAN COMMAND DASHBOARD ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-void: #020617;
    /* Deepest Slate */
    --panel-bg: rgba(15, 23, 42, 0.7);
    --panel-border: rgba(255, 255, 255, 0.08);
    --panel-border-hover: rgba(255, 255, 255, 0.2);

    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #06b6d4;
    --success: #10b981;
    --error: #ef4444;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-void);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* --- 1. Background Atmosphere --- */
.mesh-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: radial-gradient(circle at 10% 10%, #1e1b4b 0%, #020617 100%);
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* --- 2. Sidebar (Glass) --- */
.sidebar {
    width: var(--sidebar-width);
    height: 100%;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    margin-bottom: 40px;
    padding-left: 12px;
}

.brand img {
    height: 32px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: 0.2s;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.nav-item:hover svg {
    color: white;
}

.nav-item.active {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: white;
}

.nav-item.active svg {
    color: var(--primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--panel-border);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

/* --- 3. Main Content --- */
.main-wrapper {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    position: relative;
    z-index: 5;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 24px;
}

/* Cards */
.glass-card {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: var(--panel-border-hover);
}

/* Hero Download (The Command Input) */
.hero-card {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 280px;
}

.input-commander {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 20px;
    color: white;
    padding: 20px 0;
    border-bottom: 2px solid var(--panel-border);
    font-family: 'Inter', sans-serif;
    transition: 0.3s;
}

.input-commander:focus {
    outline: none;
    border-bottom-color: var(--primary);
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--primary-glow);
}

/* Stats Cards */
.stats-column {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: white;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* AI Tools */
.tools-card {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.tool-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.tool-icon {
    margin-bottom: 12px;
    color: var(--primary);
}

.tool-name {
    font-size: 14px;
    font-weight: 600;
    color: #ddd;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #0f172a;
    border: 1px solid var(--panel-border);
    width: 500px;
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* Mobile */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-column {
        grid-row: auto;
    }

    .sidebar {
        position: fixed;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-wrapper {
        padding: 20px;
    }
}

/* ===== NOTIFICATION COMPONENT ===== */
.notification-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.notification-bell {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #f8fafc;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notification-bell:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(6, 182, 212, 0.3);
}

.notification-bell .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-height: 480px;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    z-index: 1000;
}

.notification-dropdown.hidden {
    display: none;
}

.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.notif-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #f8fafc;
    margin: 0;
}

.btn-mark-all {
    background: transparent;
    border: none;
    color: #06b6d4;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-mark-all:hover {
    color: #22d3ee;
}

.notif-list {
    max-height: 400px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.notif-item.unread {
    background: rgba(6, 182, 212, 0.05);
}

.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
}

.notif-icon.success {
    background: rgba(16, 185, 129, 0.15);
}

.notif-icon.warning {
    background: rgba(245, 158, 11, 0.15);
}

.notif-icon.error {
    background: rgba(239, 68, 68, 0.15);
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 14px;
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 4px;
}

.notif-message {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-time {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
}

.notif-item .dot {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #06b6d4;
    border-radius: 50%;
}

.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-top-color: #06b6d4;
    border-radius: 50%;
    margin: 40px auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Notification */
@media (max-width: 768px) {
    .notification-dropdown {
        position: fixed;
        top: 70px;
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* Utility: Hidden */
.hidden {
    display: none !important;
}