/* // FILE: magic-mirror/style.css */

/* --- THEME ALIGNMENT (Mapped to your Main Site) --- */
:root {
    /* Using your main site variables directly + local overrides */
    --mm-bg: var(--royal-blue, #1E293B);      
    --mm-border: var(--gold-muted, #C5A059);
    --mm-gold: var(--gold, #FFD700);
    --mm-text: var(--text-light, #F8FAFC);
    --mm-void: var(--royal-night, #0F172A);
    --mm-accent: #22d3ee;  /* Magic Cyan */
    
    /* Fonts matching your site */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
    --font-hand: 'Caveat', cursive;
}

/* --- CONTAINER --- */
.magic-mirror-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: var(--font-body);
    color: var(--mm-text);
    box-sizing: border-box;
}

.mirror-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 10px;
}

.demo-badge {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--mm-gold);
    color: var(--mm-gold);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem; 
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.15);
}

/* Responsive Font Scaling */
.mirror-header h2 {
    font-family: var(--font-heading);
    /* Scales between 2rem (mobile) and 3.5rem (desktop) */
    font-size: clamp(2rem, 5vw, 3.5rem); 
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.mirror-header p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: #cbd5e1;
    max-width: 700px;
    margin: 10px auto;
    line-height: 1.6;
}

/* --- THE GRIMOIRE CARD --- */
.magic-card {
    background: var(--mm-bg);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 24px;
    padding: clamp(20px, 5vw, 50px); /* Responsive padding */
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

/* --- INPUT GROUPS --- */
.form-group { margin-bottom: 30px; }

.form-group label {
    display: block;
    font-family: var(--font-heading);
    color: var(--mm-gold);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.label-explainer {
    display: block;
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #94a3b8;
    margin-bottom: 15px;
    font-style: italic;
    line-height: 1.4;
}

/* --- UPLOAD FRAME (FIXED) --- */
.soul-frame {
    border: 3px dashed rgba(255, 215, 0, 0.4);
    background: rgba(0,0,0,0.2);
    border-radius: 16px;
    height: clamp(200px, 40vh, 300px); /* Adjusts height on small screens */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.soul-frame:hover {
    background: rgba(255, 215, 0, 0.05);
    border-color: var(--mm-gold);
}

.soul-frame.has-image {
    border-style: solid;
    border-color: var(--mm-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.soul-frame-content { 
    text-align: center; 
    z-index: 2; /* Below image when image is loaded */
    pointer-events: none;
    padding: 20px;
    transition: opacity 0.3s;
}

/* FIX: Ensure Image sits ON TOP of content */
.soul-frame img {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; 
    z-index: 10; /* Higher z-index ensures visibility */
    display: none; 
    border-radius: 12px;
}

/* --- FORM ELEMENTS --- */
.magic-input, .magic-textarea {
    width: 100%;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem; 
    font-family: var(--font-body);
}

/* Mobile input sizing to prevent zoom */
@media (max-width: 768px) {
    .magic-input, .magic-textarea { font-size: 16px; } 
}

.magic-input:focus, .magic-textarea:focus {
    outline: none;
    border-color: var(--mm-gold);
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.magic-textarea { height: 120px; resize: none; }

/* Magic Seeds (Chips) */
.magic-seeds { display: flex; gap: 10px; margin-top: 15px; flex-wrap: wrap; }

.seed-chip {
    background: rgba(255,255,255,0.1); 
    border: 1px solid rgba(255,255,255,0.2);
    padding: 10px 18px; 
    border-radius: 50px; 
    font-size: 0.95rem; 
    color: white;
    cursor: pointer; 
    transition: all 0.2s;
    font-family: var(--font-body);
    flex: 1 1 auto; /* Grow to fill space on mobile */
    text-align: center;
    white-space: nowrap;
}

.seed-chip:hover { 
    background: var(--mm-gold); 
    color: var(--mm-void); 
    border-color: var(--mm-gold);
    font-weight: 700;
}

/* BUTTON */
.btn-god-tier {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #FFD700 0%, #F59E0B 100%);
    border: none;
    border-radius: 16px;
    color: var(--mm-void); 
    font-family: var(--font-heading);
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 900;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 30px;
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
    transition: transform 0.2s;
}

.btn-god-tier:disabled { 
    background: #334155; color: #64748b; box-shadow: none; cursor: not-allowed;
}

.btn-god-tier:not(:disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

/* --- LOADING STATE --- */
.loading-mode { text-align: center; padding: 60px 20px; }

.vortex-container {
    position: relative; width: 80px; height: 80px; margin: 0 auto 30px;
}
.vortex-ring {
    position: absolute; border-radius: 50%; border: 2px solid transparent; width: 100%; height: 100%;
    border-top-color: var(--mm-gold);
    animation: spin 1s linear infinite;
}
.vortex-core {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-size: 1.5rem; color: white;
}

.loading-title { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 10px; color: white; }
.loading-status { font-family: var(--font-hand); color: var(--mm-gold); font-size: 1.3rem; }

.wand-progress-container {
    width: 80%; margin: 30px auto 0; height: 6px; background: rgba(255,255,255,0.1); border-radius: 10px;
}
.wand-progress-bar {
    height: 100%; width: 0%; background: var(--mm-gold); transition: width 0.3s ease;
}

/* --- RESULT STATE (MOBILE OPTIMIZED) --- */
.book-stage {
    display: flex; justify-content: center; align-items: center; padding: 20px 0;
    perspective: 1500px;
}

.book-3d {
    width: 100%; 
    max-width: 340px; /* Cap width for desktop */
    aspect-ratio: 2/3;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-10deg) rotateX(5deg); 
    animation: bookEntrance 1.5s ease forwards;
    box-shadow: 20px 20px 60px rgba(0,0,0,0.5);
    margin: 0 auto;
}

.book-cover {
    position: absolute; width: 100%; height: 100%;
    background: var(--mm-void); 
    border-radius: 4px 12px 12px 4px;
    overflow: hidden;
    border: 3px solid var(--mm-border);
}

.book-cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}

.cover-title-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%;
    padding: 60px 15px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    color: white; text-align: center;
    font-family: var(--font-heading);
    pointer-events: none;
}
.cover-name-display {
    font-size: clamp(1.5rem, 5vw, 2rem); 
    color: var(--mm-gold); 
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    line-height: 1; margin-bottom: 5px;
}
.cover-adventure-display {
    font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px;
}

/* SALES ROADMAP BOX (Responsive Grid) */
.next-steps-container {
    background: var(--paper); /* FDFBF7 */
    border-radius: 12px;
    border: 2px solid var(--mm-gold);
    overflow: hidden;
    margin-top: 40px;
    color: var(--royal-blue);
}

.step-header {
    background: #FFEDD5; /* Light Gold */
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.steps-grid {
    display: grid;
    /* Desktop: 3 columns. Mobile: 1 column */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 20px;
    padding: 20px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.step-icon {
    width: 35px; height: 35px;
    background: var(--mm-bg);
    color: var(--mm-gold);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900;
    margin-bottom: 10px;
    flex-shrink: 0; /* Don't squash icon */
}

.step-text strong { display: block; font-family: var(--font-heading); font-size: 1rem; margin-bottom: 5px; }
.step-text span { font-size: 0.85rem; color: #475569; line-height: 1.4; display: block; }

.result-actions { text-align: center; margin-top: 30px; }
.action-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }

/* Responsive adjustments specifically for mobile phones */
@media (max-width: 600px) {
    /* Stack steps horizontally in a vertical list */
    .step-item { 
        flex-direction: row; 
        text-align: left; 
        gap: 15px;
        align-items: flex-start;
    }
    .step-icon { margin-bottom: 0; margin-top: 2px; }
    
    .mirror-header h2 { margin-bottom: 15px; }
    .btn-god-tier { margin-top: 20px; }
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes bookEntrance {
    0% { transform: translateY(50px) rotateX(10deg); opacity: 0; }
    100% { transform: translateY(0) rotateY(-10deg) rotateX(5deg); opacity: 1; }
}