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

:root {
    --primary-blue: #4285F4;
    --sky-light: #87CEEB;
    --sky-lighter: #B0E0E6;
    --positive-green: #4CAF50;
    --negative-red: #F44336;
    --text-dark: #1a1a2e;
    --text-muted: #6b7280;
    --card-bg: rgba(255, 255, 255, 0.95);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Bricolage Grotesque', sans-serif;
    background: linear-gradient(135deg, var(--sky-light) 0%, var(--sky-lighter) 100%);
    min-height: 100vh;
    overflow: hidden;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
}

/* Header */
#header {
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-blue), #34A853, #FBBC05, #EA4335);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.25rem;
}

/* Controls Panel */
#controls-panel {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.input-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

#ticker-input {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    width: 200px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    background: white;
}

#ticker-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(66, 133, 244, 0.15);
}

#ticker-input::placeholder {
    text-transform: none;
    color: #9ca3af;
}

#generate-btn {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-blue), #1a73e8);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

#generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

#generate-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2rem;
}

.quick-select {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.quick-btn {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.quick-btn:hover {
    border-color: var(--primary-blue);
    background: #f0f7ff;
    transform: translateY(-1px);
}

/* Scene Container */
#scene-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

#scene-container canvas {
    display: block;
}

/* Loading Overlay */
#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(135, 206, 235, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 20;
    transition: opacity 0.3s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading-overlay p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Stock Overlay */
#stock-overlay {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#stock-overlay.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    pointer-events: none;
}

.stock-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
    min-width: 260px;
}

.stock-card h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.price-section {
    margin-bottom: 0.75rem;
}

.price-section .label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
}

.price {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.trend-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.mini-chart {
    height: 30px;
}

.trend-arrow {
    font-size: 1.5rem;
    font-weight: 800;
}

.trend-arrow.up {
    color: var(--positive-green);
}

.trend-arrow.down {
    color: var(--negative-red);
}

.change-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.change-badge.positive {
    background: rgba(76, 175, 80, 0.15);
    color: var(--positive-green);
}

.change-badge.negative {
    background: rgba(244, 67, 54, 0.15);
    color: var(--negative-red);
}

/* Footer */
#footer {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.footer-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    color: var(--text-dark);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn:not(:disabled):hover {
    border-color: var(--primary-blue);
    background: #f0f7ff;
}

.credit {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.credit a {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
}

.credit a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .title {
        font-size: 1.5rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    #ticker-input {
        width: 140px;
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }
    
    #generate-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .quick-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    
    .stock-card {
        min-width: 220px;
        padding: 0.75rem 1rem;
    }
    
    .stock-card h2 {
        font-size: 1.1rem;
    }
    
    .price {
        font-size: 1rem;
    }
    
    .action-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 380px) {
    .quick-select {
        gap: 0.3rem;
    }
    
    .quick-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.7rem;
    }
}