/*
 * Shader Forge - Base Styles
 * Variables, reset, typography
 */

:root {
    /* Deep, rich backgrounds */
    --bg-void: #08080c;
    --bg-deep: #0c0c12;
    --bg-surface: #121218;
    --bg-elevated: #1a1a22;
    --bg-hover: #22222c;

    /* Sophisticated accent palette */
    --accent-primary: #a78bfa;
    --accent-secondary: #818cf8;
    --accent-tertiary: #f472b6;
    --accent-warm: #fb923c;
    --accent-cool: #22d3ee;

    /* Text hierarchy */
    --text-primary: #f4f4f6;
    --text-secondary: #a1a1aa;
    --text-muted: #52525b;
    --text-ghost: #3f3f46;

    /* Borders & lines */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(167, 139, 250, 0.3);

    /* Shadows */
    --shadow-soft: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(167, 139, 250, 0.15);

    /* Typography */
    --font-display: 'Instrument Serif', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-smooth: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

/* Allow scrolling on mobile */
@media (max-width: 768px) {
    html, body {
        overflow: auto;
        overflow-x: hidden;
    }
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-void);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-ghost);
}

/* Subtle grain texture overlay */
.app-container::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 1000;
}

/* Welcome Modal */
.welcome-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease-out;
    padding: var(--space-md);
}

.welcome-modal-overlay.hidden {
    animation: modalFadeOut 0.25s ease-out forwards;
    pointer-events: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.welcome-modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: var(--space-xl);
    text-align: center;
    max-width: 320px;
    box-shadow: var(--shadow-soft), 0 0 60px rgba(167, 139, 250, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

.welcome-modal-overlay.hidden .welcome-modal {
    animation: modalSlideOut 0.25s ease-out forwards;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes modalSlideOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
}

.welcome-modal-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.welcome-modal-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.welcome-modal-text strong {
    color: var(--accent-primary);
    font-weight: 500;
}

.welcome-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.welcome-modal-btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
}

.welcome-modal-btn:active {
    transform: translateY(0);
}
