/* ========================================
   LUMINA AI — Canvas-First AI Photo Editor
   Brand: Deep Plum, Off-Black, Cool Blue
   ======================================== */

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

:root {
    --plum: #2D1B33;
    --plum-deep: #1A0F1F;
    --plum-mid: #3D2647;
    --off-black: #0D0A0F;
    --blue-accent: #5B8DEF;
    --blue-glow: #4A7AE0;
    --blue-soft: #8CB4F7;
    --cream: #F0ECE4;
    --gray-light: #A99EB0;
    --white: #FFFFFF;
    --success: #4ADE80;
    --error: #F87171;
    --warning: #FBBF24;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-black);
    color: var(--cream);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
}

/* --- NAV --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(91, 141, 239, 0.08);
    height: 60px;
}

.logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.02em;
    user-select: none;
}

.logo span {
    color: var(--blue-accent);
}

.nav-tag {
    font-size: 0.75rem;
    color: var(--gray-light);
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(169, 158, 176, 0.2);
    border-radius: 100px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-cta {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    background: var(--blue-accent);
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-cta:hover {
    background: var(--blue-glow);
    transform: translateY(-1px);
}

/* --- HERO --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 2rem 80px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    font-size: 0.8rem;
    color: var(--blue-accent);
    padding: 0.4rem 1rem;
    border: 1px solid rgba(91, 141, 239, 0.25);
    border-radius: 100px;
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
    background: rgba(91, 141, 239, 0.05);
}

.hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
}

.highlight {
    color: var(--blue-accent);
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--gray-light);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 4rem;
}

.btn-primary {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: var(--blue-accent);
    border: none;
    padding: 0.85rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-primary:hover {
    background: var(--blue-glow);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(91, 141, 239, 0.3);
}

.btn-secondary {
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-light);
    background: transparent;
    border: 1px solid rgba(169, 158, 176, 0.2);
    padding: 0.85rem 2rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.btn-secondary:hover {
    border-color: var(--blue-accent);
    color: var(--blue-accent);
}

.btn-ghost {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--gray-light);
    background: transparent;
    border: 1px solid rgba(169, 158, 176, 0.15);
    padding: 0.4rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--blue-accent);
    color: var(--blue-accent);
}

/* Hero Visual */
.hero-visual {
    width: 100%;
    max-width: 700px;
}

.demo-canvas {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.demo-before, .demo-after {
    flex: 1;
    aspect-ratio: 4/3;
    background: var(--plum-deep);
    border: 1px solid rgba(91, 141, 239, 0.1);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.demo-after.glow-border {
    border-color: rgba(91, 141, 239, 0.3);
}

.demo-label {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.7rem;
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(13, 10, 15, 0.6);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.demo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-placeholder.glow svg {
    filter: drop-shadow(0 0 20px rgba(91, 141, 239, 0.4));
}

.demo-arrow {
    flex-shrink: 0;
}

.demo-prompt-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--plum-deep);
    border: 1px solid rgba(91, 141, 239, 0.12);
    border-radius: 12px;
    padding: 1rem 1.5rem;
}

.prompt-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.prompt-text-demo {
    font-size: 0.95rem;
    color: var(--gray-light);
    font-style: italic;
}

/* --- FEATURES --- */
.features {
    padding: 100px 2rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.features h2 {
    font-size: 2.5rem;
    margin-bottom: 3.5rem;
    letter-spacing: -0.02em;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--plum-deep);
    border: 1px solid rgba(91, 141, 239, 0.08);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
    transition: border-color 0.3s;
}

.feature-card:hover {
    border-color: rgba(91, 141, 239, 0.25);
}

.feature-num {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    color: var(--blue-accent);
    font-weight: 600;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--white);
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--gray-light);
    line-height: 1.6;
}

/* --- TECH --- */
.tech-section {
    padding: 80px 2rem 120px;
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.tech-section h2 {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    letter-spacing: -0.02em;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.tech-card {
    background: linear-gradient(135deg, var(--plum-deep), var(--plum));
    border: 1px solid rgba(91, 141, 239, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: left;
}

.tech-card h4 {
    font-size: 1.1rem;
    color: var(--blue-accent);
    margin-bottom: 0.75rem;
}

.tech-card p {
    font-size: 0.9rem;
    color: var(--gray-light);
    line-height: 1.6;
}

/* --- FOOTER --- */
.landing-footer {
    padding: 3rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(91, 141, 239, 0.06);
}

.landing-footer p {
    color: var(--gray-light);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* ========================================
   EDITOR PAGE
   ======================================== */

.editor-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(13, 10, 15, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(91, 141, 239, 0.08);
    height: 56px;
}

.editor-status {
    font-size: 0.8rem;
    color: var(--gray-light);
    padding: 0.3rem 0.8rem;
    border: 1px solid rgba(169, 158, 176, 0.15);
    border-radius: 100px;
}

.editor-status.processing {
    color: var(--blue-accent);
    border-color: rgba(91, 141, 239, 0.3);
    animation: pulse-border 2s infinite;
}

.editor-status.success {
    color: var(--success);
    border-color: rgba(74, 222, 128, 0.3);
}

.editor-status.error {
    color: var(--error);
    border-color: rgba(248, 113, 113, 0.3);
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(91, 141, 239, 0.3); }
    50% { border-color: rgba(91, 141, 239, 0.6); }
}

/* Editor Layout */
.editor-layout {
    padding-top: 56px;
    height: 100vh;
    display: grid;
    grid-template-rows: 1fr auto;
    grid-template-columns: 1fr 280px;
}

/* Canvas Container */
.canvas-container {
    grid-row: 1;
    grid-column: 1;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.canvas-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--plum-deep);
    border: 1px solid rgba(91, 141, 239, 0.06);
}

/* Drop Zone */
.canvas-dropzone {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s;
    border: 2px dashed rgba(91, 141, 239, 0.15);
    border-radius: 16px;
}

.canvas-dropzone.drag-over {
    border-color: var(--blue-accent);
    background: rgba(91, 141, 239, 0.03);
}

.dropzone-content {
    text-align: center;
}

.dropzone-content h3 {
    font-size: 1.2rem;
    color: var(--white);
    margin: 1rem 0 0.5rem;
}

.dropzone-content p {
    font-size: 0.85rem;
    color: var(--gray-light);
}

/* Canvas Images */
.canvas-images {
    width: 100%;
    height: 100%;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

.image-panel {
    flex: 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--off-black);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-panel img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.panel-label {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.7rem;
    color: var(--cream);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(13, 10, 15, 0.7);
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    z-index: 5;
    backdrop-filter: blur(8px);
}

.result-panel {
    border: 1px solid rgba(91, 141, 239, 0.15);
}

.download-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--white);
    background: var(--blue-accent);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    z-index: 5;
}

.download-btn:hover {
    background: var(--blue-glow);
    transform: translateY(-1px);
}

/* Processing Overlay */
.processing-overlay {
    position: absolute;
    inset: 0;
    background: rgba(13, 10, 15, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px;
}

.processing-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(91, 141, 239, 0.15);
    border-top-color: var(--blue-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.5rem;
}

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

.processing-text {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.processing-sub {
    font-size: 0.85rem;
    color: var(--gray-light);
}

/* Prompt Bar */
.prompt-bar {
    grid-row: 2;
    grid-column: 1;
    padding: 0 1.5rem 1.5rem;
}

.prompt-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--plum-deep);
    border: 1px solid rgba(91, 141, 239, 0.12);
    border-radius: 14px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.prompt-inner:focus-within {
    border-color: var(--blue-accent);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.08);
}

#prompt-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--cream);
}

#prompt-input::placeholder {
    color: rgba(169, 158, 176, 0.5);
}

#prompt-input:disabled {
    opacity: 0.5;
}

.prompt-submit {
    background: var(--blue-accent);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--white);
    flex-shrink: 0;
}

.prompt-submit:hover:not(:disabled) {
    background: var(--blue-glow);
    transform: scale(1.05);
}

.prompt-submit:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.prompt-hints {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.hint {
    font-size: 0.75rem;
    color: var(--gray-light);
    background: rgba(45, 27, 51, 0.5);
    border: 1px solid rgba(169, 158, 176, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.hint:hover {
    border-color: var(--blue-accent);
    color: var(--blue-accent);
    background: rgba(91, 141, 239, 0.05);
}

/* History Panel */
.history-panel {
    grid-row: 1 / 3;
    grid-column: 2;
    background: var(--plum-deep);
    border-left: 1px solid rgba(91, 141, 239, 0.06);
    padding: 1.25rem;
    overflow-y: auto;
}

.history-panel h4 {
    font-size: 0.85rem;
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.history-empty {
    font-size: 0.8rem;
    color: rgba(169, 158, 176, 0.5);
    line-height: 1.6;
}

.history-item {
    background: rgba(13, 10, 15, 0.4);
    border: 1px solid rgba(91, 141, 239, 0.06);
    border-radius: 10px;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.history-item:hover {
    border-color: rgba(91, 141, 239, 0.2);
}

.history-item .h-prompt {
    font-size: 0.8rem;
    color: var(--cream);
    margin-bottom: 0.35rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.history-item .h-time {
    font-size: 0.7rem;
    color: var(--gray-light);
}

.history-item .h-status {
    font-size: 0.65rem;
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    margin-top: 0.25rem;
}

.h-status.completed {
    color: var(--success);
    background: rgba(74, 222, 128, 0.1);
}

.h-status.failed {
    color: var(--error);
    background: rgba(248, 113, 113, 0.1);
}

.h-status.processing {
    color: var(--blue-accent);
    background: rgba(91, 141, 239, 0.1);
}

.h-status.demo {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
}

/* Demo mode banner */
.demo-banner {
    background: rgba(251, 191, 36, 0.08);
    border: 1px solid rgba(251, 191, 36, 0.2);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: var(--warning);
    line-height: 1.5;
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--plum);
    border: 1px solid rgba(91, 141, 239, 0.2);
    color: var(--cream);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    z-index: 200;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-color: rgba(248, 113, 113, 0.3);
    color: var(--error);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    nav { padding: 0.75rem 1rem; }
    .nav-tag { display: none; }

    .hero { padding: 100px 1.25rem 60px; }
    .hero h1 { font-size: 2rem; }
    .hero-sub { font-size: 1rem; }
    .hero-actions { flex-direction: column; align-items: center; }

    .demo-canvas { flex-direction: column; gap: 1rem; }
    .demo-arrow { transform: rotate(90deg); }

    .feature-grid { grid-template-columns: 1fr; gap: 1rem; }
    .tech-grid { grid-template-columns: 1fr; }

    /* Editor responsive */
    .editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto auto;
    }

    .history-panel {
        grid-row: 3;
        grid-column: 1;
        border-left: none;
        border-top: 1px solid rgba(91, 141, 239, 0.06);
        max-height: 200px;
    }

    .canvas-images {
        flex-direction: column;
    }

    .prompt-hints {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.25rem;
    }
}
