/* ============================================
   ORBIT CSS v3.0 - Enhanced Edition
   ============================================ */

/* CSS Variables - Default Theme (Midnight) */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #4facfe;
    --accent-secondary: #00f2fe;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --sidebar-bg: rgba(10, 10, 15, 0.95);
    --sidebar-width: 240px;
    --sidebar-collapsed: 70px;
    --base-font-size: 16px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-glow: 0 0 20px rgba(79, 172, 254, 0.3);
    --transition: all 0.3s ease;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: var(--base-font-size);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ============================================
   BACKGROUND EFFECTS
   ============================================ */

.vortex-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.vortex {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1000px;
    height: 1000px;
    margin: -500px 0 0 -500px;
    background: conic-gradient(from 0deg, transparent, rgba(79, 172, 254, 0.08), transparent, rgba(0, 242, 254, 0.08), transparent);
    border-radius: 50%;
    animation: rotate 25s linear infinite;
    filter: blur(1px);
}

.vortex:nth-child(2) {
    width: 700px;
    height: 700px;
    margin: -350px 0 0 -350px;
    animation: rotate 18s linear infinite reverse;
    opacity: 0.6;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(79, 172, 254, 0.03) 2px,
        rgba(79, 172, 254, 0.03) 4px
    );
    animation: rain 0.5s linear infinite;
    opacity: 0.4;
}

@keyframes rain {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100vh); }
}

.thunder-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.1s;
}

.thunder-flash.active {
    opacity: 1;
    animation: flash 0.3s ease-out;
}

@keyframes flash {
    0%, 100% { opacity: 0; }
    50% { opacity: 0.3; }
}

/* Particle Container */
.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% { 
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ============================================
   LAYOUT - SIDEBAR + MAIN CONTENT
   ============================================ */

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    transition: var(--transition);
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    margin-left: auto;
}

.sidebar.collapsed .sidebar-toggle {
    margin-left: 0;
    transform: rotate(180deg);
}

.sidebar-toggle:hover {
    background: rgba(79, 172, 254, 0.2);
    border-color: var(--accent);
}

/* User Info in Sidebar */
.sidebar-user {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
    transition: var(--transition);
}

.sidebar.collapsed .user-info {
    opacity: 0;
    width: 0;
}

.user-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 12px;
    color: #22c55e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.sidebar-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-secondary));
    opacity: 0;
    transition: var(--transition);
}

.sidebar-nav-item:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: rgba(79, 172, 254, 0.15);
    color: var(--accent);
}

.sidebar-nav-item.active::before {
    opacity: 1;
}

.sidebar-nav-item .material-icons {
    font-size: 24px;
    flex-shrink: 0;
}

.nav-label {
    white-space: nowrap;
    transition: var(--transition);
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    width: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
}

.sidebar-btn:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
    border-color: var(--accent);
}

.sidebar.collapsed .sidebar-btn span:last-child {
    display: none;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* Top Bar (Minimal) */
.top-bar {
    height: 60px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(79, 172, 254, 0.2);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Cards */
.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(79, 172, 254, 0.3);
    transform: translateY(-2px);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(79, 172, 254, 0.1);
    border-color: var(--accent);
}

/* Toggle Switch */
.toggle {
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.toggle.active {
    background: var(--accent);
}

.toggle-thumb {
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: var(--transition);
}

.toggle.active .toggle-thumb {
    left: 26px;
}

/* Inputs */
.input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
}

.input::placeholder {
    color: var(--text-secondary);
}

/* Search Box */
.search-box {
    position: relative;
    max-width: 400px;
}

.search-box .material-icons {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
}

.search-box input {
    padding-left: 44px;
    height: 44px;
}

/* Grid Layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.grid-compact {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

/* ============================================
   PROTECT SCREEN
   ============================================ */

.protect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.protect-content {
    text-align: center;
    padding: 40px;
}

.protect-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 64px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.protect-text {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
}

.protect-hint {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    font-family: monospace;
    font-size: 16px;
}

.protect-hint kbd {
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ============================================
   LOGIN MODAL
   ============================================ */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    backdrop-filter: blur(20px);
}

.login-modal h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-modal p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.login-input-group {
    margin-bottom: 24px;
}

.login-input-group input {
    text-align: center;
    font-size: 18px;
    padding: 16px;
}

/* ============================================
   SETTINGS PANEL
   ============================================ */

.settings-panel {
    position: fixed;
    right: 20px;
    top: 80px;
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    z-index: 100;
    min-width: 280px;
    backdrop-filter: blur(20px);
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-panel h3 {
    margin-bottom: 16px;
    color: var(--accent);
    font-size: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item span {
    font-size: 14px;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 172, 254, 0.3);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-in {
    animation: slideIn 0.3s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar.collapsed + .main-content {
        margin-left: 0;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-bar {
        padding: 0 16px;
    }
    
    .content-area {
        padding: 16px;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.text-gradient {
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
