:root {
    --bg-deep: #030305;
    --surface-glass: rgba(255, 255, 255, 0.03);
    --surface-glass-hover: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(255, 255, 255, 0.2);
    
    --primary-glow: #3b82f6;
    --secondary-glow: #8b5cf6;
    --accent: #00f0ff;
    
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    
    --font-body: 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Space Grotesk', sans-serif;
    
    --ease-elastic: cubic-bezier(0.68, -0.6, 0.32, 1.6);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    position: relative;
    overflow-x: hidden;
}

/* --- AMBIENT BACKGROUND EFFECTS --- */
.ambient-glow {
    position: fixed;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, rgba(3, 3, 5, 0) 70%);
    border-radius: 50%;
    top: -20%;
    left: -10%;
    z-index: -1;
    filter: blur(60px);
    animation: float 10s ease-in-out infinite;
}

.ambient-glow-2 {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, rgba(3, 3, 5, 0) 70%);
    border-radius: 50%;
    bottom: -10%;
    right: -10%;
    z-index: -1;
    filter: blur(80px);
    animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 50px); }
}

/* --- LAYOUT WRAPPER --- */
.app-wrapper {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    z-index: 10;
}

/* --- HEADER --- */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Updated Logo Styles */
.logo-svg {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.4));
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-badge {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #34d399;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #34d399;
    border-radius: 50%;
    box-shadow: 0 0 10px #34d399;
    animation: pulse 2s infinite;
}

@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* --- MAIN GRID --- */
.main-grid {
    display: grid;
    grid-template-columns: 1.5fr 0.8fr;
    gap: 2rem;
    align-items: start;
}

/* --- GLASS CARD (Common) --- */
.glass-panel {
    background: var(--surface-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.4);
    transition: transform 0.3s var(--ease-smooth), border-color 0.3s;
}

/* --- LEFT TOOL COLUMN --- */
.tool-card {
    padding: 2.5rem;
    min-height: 580px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* --- TYPOGRAPHY --- */
.step-indicator {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--primary-glow);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.step-indicator::before {
    content: '';
    width: 20px; height: 1px;
    background: var(--primary-glow);
}

.hero-text h1 {
    font-family: var(--font-display);
    font-size: 2.75rem;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 0 40px rgba(255,255,255,0.1);
}

.hero-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

/* --- UPLOAD ZONE --- */
.upload-box {
    border: 2px dashed var(--border-subtle);
    border-radius: 20px;
    background: rgba(0,0,0,0.2);
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
    group: 'upload';
}

.upload-box:hover {
    border-color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.upload-icon-wrapper {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid var(--border-highlight);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--text-main);
    transition: transform 0.3s var(--ease-elastic);
}

.upload-box:hover .upload-icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--primary-glow);
}

.upload-svg {
    width: 32px;
    height: 32px;
    color: var(--text-main);
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.3));
}

.upload-box:hover .upload-svg {
     color: var(--primary-glow);
     filter: drop-shadow(0 0 8px var(--primary-glow));
}

/* --- PREVIEW & RESULT --- */
.preview-container, .result-box {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    background: #000;
}

.preview-container img, .result-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.remove-btn {
    position: absolute;
    top: 15px; right: 15px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.remove-btn:hover { background: #ef4444; border-color: #ef4444; }

/* --- BUTTONS --- */
.btn {
    width: 100%;
    padding: 1.2rem;
    border-radius: 14px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    border: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.generate-btn {
    background: linear-gradient(135deg, var(--text-main), #cbd5e1);
    color: #000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.generate-btn:disabled {
    background: var(--surface-glass-hover);
    color: rgba(255,255,255,0.2);
    cursor: not-allowed;
    box-shadow: none;
}

.back-btn, .new-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
}

.back-btn:hover, .new-btn:hover {
    border-color: var(--text-main);
    background: var(--surface-glass-hover);
}

/* --- SELECT INPUT --- */
.select-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.style-select {
    width: 100%;
    padding: 1.2rem;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: 14px;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    appearance: none;
    transition: all 0.3s;
}

.style-select:focus {
    border-color: var(--primary-glow);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.select-arrow {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* --- RIGHT COLUMN (BENTO GRID) --- */
.info-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bento-card {
    background: var(--surface-glass);
    border: 1px solid var(--border-subtle);
    padding: 1.5rem;
    border-radius: 20px;
    transition: all 0.3s var(--ease-smooth);
    position: relative;
}

.bento-card:hover {
    background: var(--surface-glass-hover);
    border-color: var(--border-highlight);
    transform: scale(1.02);
}

.icon-container {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
}

.bento-svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.bento-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.bento-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tech-specs {
    background: linear-gradient(135deg, rgba(10,10,10,0.8), rgba(20,20,20,0.9));
}

.code-block {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--primary-glow);
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* --- PAGES LOGIC --- */
.page { display: none; opacity: 0; transform: translateY(20px); transition: all 0.5s var(--ease-smooth); }
.page.active { display: block; opacity: 1; transform: translateY(0); animation: fadeIn 0.6s var(--ease-smooth) forwards; }

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

/* --- LOADING OVERLAY --- */
.loading-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(3, 3, 5, 0.85);
    backdrop-filter: blur(15px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border-radius: 24px;
}

.spinner-box {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.circle-border {
    width: 100%;
    height: 100%;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    position: absolute;
}

.circle-core {
    width: 100%;
    height: 100%;
    border: 2px solid transparent;
    border-top-color: var(--accent);
    border-radius: 50%;
    position: absolute;
    animation: spin 1s linear infinite;
}

.spinner-box::after {
    content: '';
    width: 40px; height: 40px;
    background: var(--primary-glow);
    filter: blur(20px);
    opacity: 0.5;
    position: absolute;
    animation: pulse 1s ease-in-out infinite alternate;
}

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

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .tool-card { min-height: auto; }
    .hero-text h1 { font-size: 2rem; }
    body { padding: 1rem; }
}

.footer-credit {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.6;
    font-family: var(--font-display);
}
