/* --- CSS SYSTEM CORE DESIGN & TOKEN MATRIX --- */
:root {
    --bg-base: #06060c;
    --bg-surface: rgba(13, 13, 24, 0.7);
    --bg-surface-solid: #0d0d18;
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-glow: rgba(99, 102, 241, 0.2);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #a855f7;
    --accent: #06b6d4;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --glass-blur: blur(16px);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-sans: 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* Ambient Background Glow System */
.ambient-glow-1 {
    position: fixed;
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}
.ambient-glow-2 {
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(168,85,247,0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Scrollbar Interface */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- GLOBAL PREMIUM COMPONENTS --- */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}
.glass-panel:hover {
    border-color: var(--border-glass-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    font-size: 0.95rem;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}
.btn-accent {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
}
.btn-accent:hover {
    background: rgba(6, 182, 212, 0.1);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.badge-premium { background: rgba(168,85,247,0.2); color: var(--secondary); border: 1px solid rgba(168,85,247,0.4); }
.badge-success { background: rgba(16,185,129,0.2); color: var(--success); }

/* Structured Inputs */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition-smooth);
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.06);
}

/* --- APP SCREEN ROUTING ANIMATIONS --- */
.app-view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}
.app-view.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- LANDING DISPLAY DESIGN FRAMEWORKS --- */
header.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 8%;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 6, 12, 0.8);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-glass);
}
.logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}
.logo i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero {
    padding: 100px 8% 120px 8%;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}
.hero-headline {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1.15;
    margin-bottom: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.hero-headline span {
    background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 40px auto;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 60px 8%;
}
.feature-card { padding: 40px 30px; text-align: left; }
.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

/* --- AUTH DESIGN LAYERS --- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.auth-card { width: 100%; max-width: 450px; padding: 40px; }

/* --- CORE SAAS VIEWPORT ARCHITECTURE --- */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}
aside.sidebar {
    background: var(--bg-surface-solid);
    border-right: 1px solid var(--border-glass);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.sidebar-menu { list-style: none; margin-top: 40px; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-weight: 500;
    transition: var(--transition-smooth);
    cursor: pointer;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
}
.sidebar-link.active {
    border-left: 3px solid var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

main.main-content {
    padding: 40px;
    overflow-y: auto;
    max-height: 100vh;
}
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-glass);
}

/* Platform Evaluation Score Metrics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.stat-card { padding: 24px; }
.stat-value {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 8px;
}

/* Generator & Split-Pane Layout Engine Rules */
.generator-workspace {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    align-items: start;
}
.editor-workspace {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.editor-pane, .preview-pane {
    height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
}
.pane-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}
.code-textarea {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: 'Courier New', Courier, monospace;
    resize: none;
    outline: none;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Micro Document Realtime Preview Core Sheet */
.preview-render {
    background: #fff;
    color: #111827;
    padding: 40px;
    border-radius: 4px;
    min-height: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.preview-render h1 { font-family: var(--font-display); color: #4f46e5; margin-bottom: 8px; font-size: 2.5rem; border-bottom: 3px solid #4f46e5; padding-bottom: 10px; }
.preview-render h2 { font-family: var(--font-sans); color: #7c3aed; margin-top: 24px; margin-bottom: 12px; font-size: 1.6rem; }
.preview-render p { margin-bottom: 16px; font-size: 1.05rem; line-height: 1.6; }
.preview-render ul { margin-bottom: 16px; padding-left: 20px; }
.preview-render li { margin-bottom: 8px; }

.score-row { display: flex; gap: 16px; margin-bottom: 20px; }
.score-widget { flex: 1; padding: 16px; text-align: center; }
.score-num { font-size: 1.8rem; font-weight: 700; color: var(--accent); font-family: var(--font-display); }

/* Utility Classes */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mb-20 { margin-bottom: 20px; }
.gap-10 { gap: 10px; }

/* Toast Notifications Platform Component */
#toast-container { position: fixed; bottom: 30px; right: 30px; z-index: 9999; }
.toast {
    background: var(--bg-surface-solid);
    border: 1px solid var(--primary);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out forwards;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Asset Item Card Containers grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }
.project-card { padding: 24px; position: relative; }
.project-actions { position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; }
.action-icon { cursor: pointer; color: var(--text-dim); transition: var(--transition-smooth); }
.action-icon:hover { color: var(--text-main); }

/* --- RESPONSIVE MOBILE OVERLAYS & RULES --- */
@media (max-width: 1024px) {
    .generator-workspace, .editor-workspace { grid-template-columns: 1fr; }
    .dashboard-layout { grid-template-columns: 1fr; }
    aside.sidebar { display: none; }
    .hero-headline { font-size: 2.5rem; }
}