/* 
 * DevEnd Portal Design System v2.0
 * Aesthetic: High-Tech Glassmorphism / Command Center
 */

:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #f43f5e;
    --bg-dark: #050505;
    --card-bg: rgba(15, 15, 15, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --sidebar-width: 280px;
}

/* Base Reset & Background */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    min-height: 100vh;
    padding-top: 70px;
}

/* Grid Background Optimization */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: -1;
    animation: grid-move 120s linear infinite;
    transform: perspective(1000px) rotateX(60deg);
    pointer-events: none;
    backface-visibility: hidden;
}

@keyframes grid-move {
    from { transform: perspective(1000px) rotateX(60deg) translateY(0); }
    to { transform: perspective(1000px) rotateX(60deg) translateY(-600px); }
}

/* Typed Effect Simulation */
.typing::after {
    content: '|';
    animation: blink 0.7s infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Universal Layout Containers */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

.glass-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Typography */
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; }
.mono { font-family: var(--font-mono); }

/* Buttons */
.dev-btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--primary-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); }

/* Common Navbar (Injected via dev_core.js) */
.dev-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .dev-nav {
        padding: 0.8rem 1.2rem;
    }
    .nav-brand span, .nav-logo {
        font-size: 1rem;
    }
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand, .nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;           /* AR = always white */
    font-weight: 800;
    font-size: 1.6rem;
    letter-spacing: -0.5px;
    line-height: 1;
}

.nav-brand img, .nav-logo img { width: 32px; height: 32px; object-fit: contain; }
.nav-logo .dot, .nav-brand .dot { color: #6366f1; font-weight: 800; } /* . = always purple */

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.3s;
}
.nav-link:hover { color: #fff; }

/* Dashboard Specific Layout */
.dashboard-layout { display: flex; min-height: 100vh; }

.dash-sidebar {
    width: var(--sidebar-width);
    background: rgba(8, 8, 8, 0.95);
    backdrop-filter: blur(30px);
    border-right: 1px solid var(--border);
    height: 100vh;
    position: fixed;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.3s ease;
}

.dash-main {
    margin-left: var(--sidebar-width);
    padding: 3rem;
    width: 100%;
    max-width: 100%;
}

/* Animations */
.fade-in { opacity: 0; transform: translateY(15px); animation: fade-up 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fade-up { to { opacity: 1; transform: translateY(0); } }

/* Universal Loader Logic */
#loader-wrapper {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark); z-index: 10000;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader-spinner {
    width: 50px; height: 50px;
    border: 3px solid rgba(99, 102, 241, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive Grid System */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }

/* REQUISITE: Mobile Adjustments */
@media (max-width: 1024px) {
    --sidebar-width: 80px;
    .dash-sidebar { padding: 2rem 1rem; align-items: center; }
    .side-btn span, .side-logo span, .nav-brand span { display: none; }
    .dash-main { margin-left: var(--sidebar-width); padding: 2rem; }
    .col-8, .col-4 { grid-column: span 12; }
}

@media (max-width: 768px) {
    .dashboard-layout { flex-direction: column; }
    .dash-sidebar {
        position: fixed; bottom: 0; left: 0; width: 100%; height: 75px;
        flex-direction: row; justify-content: space-around; padding: 0 1rem;
        border-right: none; border-top: 1px solid var(--border);
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(25px);
        align-items: center;
    }
    .side-logo { display: none; }
    .nav-menu { flex-direction: row; display: flex; width: 100%; justify-content: space-around; margin: 0; padding: 0; }
    .side-item { margin-bottom: 0 !important; }
    .side-btn { padding: 0.8rem; border: none !important; flex-direction: column; gap: 4px; font-size: 0.6rem; }
    .side-btn i { font-size: 1.2rem; }
    .side-btn span { display: block !important; }
    .sidebar-footer { display: none; }

    .dash-main { margin-left: 0; margin-bottom: 85px; padding: 1.2rem; }
    .dash-main header { flex-direction: column; align-items: flex-start; gap: 1rem; margin-bottom: 2.5rem !important; }
    .dash-main header h1 { font-size: 2.2rem !important; }
    
    .widget-grid { gap: 1rem; }
    .col-8, .col-4, .col-6 { grid-column: span 12 !important; }
    .metric-val { font-size: 1.5rem !important; }
    .glass-card { padding: 1.5rem !important; }
}

@media (max-width: 480px) {
    body { padding-top: 65px; }
    .container { padding: 0 1rem; }
    .section-title { font-size: 2rem !important; }
    .dev-btn { width: 100%; justify-content: center; }
}
