/* 
 * Cyber-space Dark Mode and Glassmorphic Design System
 * Built for AI-Powered Project & Design Assistance Platform
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-base: #06070a;
    --bg-darker: #030406;
    --bg-card: rgba(17, 20, 28, 0.55);
    --bg-card-hover: rgba(26, 31, 44, 0.7);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-focused: rgba(99, 102, 241, 0.3);
    
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --secondary: #8b5cf6;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 241, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6, .font-display {
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

/* Custom Scrollbar */
::-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);
}

/* Glassmorphism Utility */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-interactive {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-interactive:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

/* Container */
.app-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    flex-grow: 1;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    margin-bottom: 30px;
    height: 80px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
    box-shadow: 0 0 15px var(--primary-glow);
}

.nav-brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid rgba(255,255,255,0.1);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

/* Typography Gradient */
.text-gradient {
    background: linear-gradient(135deg, #a5b4fc 0%, #c084fc 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-cyan {
    background: linear-gradient(135deg, #67e8f9 0%, #38bdf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Dynamic Grid Layouts */
.grid-cols-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.grid-main-aside {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

@media (max-width: 1024px) {
    .grid-main-aside {
        grid-template-columns: 1fr;
    }
}

/* KPI Statistics Cards */
.kpi-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.3;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 20px;
}

.kpi-icon.primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.kpi-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.kpi-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }

.kpi-title {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    opacity: 0.95;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: var(--accent-rose);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.25);
}

.btn-icon-only {
    padding: 10px;
    border-radius: 10px;
}

/* Badges / Status tags */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-pending { background: rgba(245, 158, 11, 0.1); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-active { background: rgba(59, 130, 246, 0.1); color: var(--accent-cyan); border: 1px solid rgba(59, 130, 246, 0.2); }
.badge-completed { background: rgba(16, 185, 129, 0.1); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-control, .form-select, textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 100%;
}

.form-control:focus, .form-select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder, textarea::placeholder {
    color: var(--text-muted);
}

.form-error {
    color: var(--accent-rose);
    font-size: 12px;
    margin-top: 4px;
}

/* Auth Cards */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 40px 20px;
}

.auth-card {
    max-width: 480px;
    width: 100%;
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Projects Table / Lists */
.project-card {
    padding: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.project-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.project-card-client {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.project-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent-cyan));
    border-radius: 3px;
}

.project-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
    margin-top: auto;
}

.project-meta-dates {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Detailed Project Workspace */
.detail-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.detail-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 6px;
}

.sidebar-card {
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
    color: var(--text-primary);
}

/* Documents list */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 10px;
}

.doc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon {
    font-size: 18px;
    color: var(--accent-cyan);
}

.doc-title {
    font-size: 13px;
    font-weight: 600;
}

.doc-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* UI Gallery Showcase */
.concept-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.concept-card {
    padding: 20px;
}

.concept-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.concept-card-prompt {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.color-palette-bar {
    display: flex;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    margin-bottom: 16px;
}

.color-swatch {
    flex-grow: 1;
    height: 100%;
}

/* Playground UI - Prompt playground */
.playground-workspace {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 28px;
    min-height: calc(100vh - 200px);
}

@media (max-width: 900px) {
    .playground-workspace {
        grid-template-columns: 1fr;
    }
}

.playground-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.playground-main {
    display: flex;
    flex-direction: column;
}

.prompt-area {
    padding: 24px;
    margin-bottom: 24px;
}

.prompt-textbox {
    min-height: 120px;
    resize: none;
    margin-bottom: 16px;
}

.output-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.preview-tab-headers {
    display: flex;
    gap: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.preview-tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 14px;
    padding: 4px 8px;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.preview-tab-btn.active {
    color: var(--text-primary);
}

.preview-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -13px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.preview-details {
    margin-bottom: 20px;
}

.preview-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.preview-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.color-swatch-list {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.color-swatch-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.color-swatch-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.color-swatch-hex {
    font-size: 10px;
    color: var(--text-muted);
}

/* Responsive Custom Sandbox Iframe */
.iframe-container {
    flex-grow: 1;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    overflow: hidden;
    background: white;
    min-height: 500px;
    position: relative;
}

.sandbox-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.iframe-container.code-active {
    background: #0f172a;
}

.code-block-container {
    background: #0f172a;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 600px;
    border: 1px solid rgba(255,255,255,0.06);
}

/* Spinner */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.animate-spin-slow {
    animation: spin-slow 10s infinite linear;
}

/* Alerts Toast Notifications */
.alert-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-toast {
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

@keyframes slideIn {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

.alert-toast.success { background: #064e3b; color: #a7f3d0; border-color: #047857; }
.alert-toast.error { background: #7f1d1d; color: #fca5a5; border-color: #b91c1c; }
.alert-toast.warning { background: #78350f; color: #fde68a; border-color: #d97706; }
.alert-toast.info { background: #1e3a8a; color: #bfdbfe; border-color: #1d4ed8; }

/* Landing Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 100px 20px 60px;
    position: relative;
}

.hero-tagline {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    margin-bottom: 20px;
}

.hero-title {
    font-size: 54px;
    font-weight: 800;
    max-width: 800px;
    line-height: 1.1;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 38px;
    }
}

.hero-desc {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 40px;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 60px;
    width: 100%;
}

.landing-card {
    padding: 32px;
    text-align: left;
}

.landing-card-icon {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 24px;
}

.landing-card-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.landing-card-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* General Layout utilities */
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-gap-2 { display: flex; gap: 8px; align-items: center; }
.flex-gap-3 { display: flex; gap: 12px; align-items: center; }
.margin-top-md { margin-top: 20px; }
.margin-bottom-md { margin-bottom: 20px; }
.margin-bottom-lg { margin-bottom: 30px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.w-full { width: 100%; }

/* Premium Glassmorphic Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 4, 6, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(17, 20, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.1);
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}

.modal-header {
    padding: 24px 28px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 28px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 16px 28px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* Dynamic display utility classes */
.d-none {
    display: none !important;
}
.d-flex {
    display: flex !important;
}
