/* ==========================================================================
   AETHERIA - COSMIC FORTUNE TELLER DESIGN SYSTEM
   ========================================================================== */

:root {
    --bg-dark: #070514;
    --bg-card: rgba(22, 16, 48, 0.65);
    --bg-card-border: rgba(168, 85, 247, 0.25);
    
    --color-primary: #a855f7;
    --color-secondary: #06b6d4;
    --color-accent: #fbbf24;
    --color-pink: #ec4899;
    --color-text-main: #f3f4f6;
    --color-text-muted: #9ca3af;
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--color-text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 40px;
}

/* Canvas Background */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

/* Ambient Lights */
.ambient-light {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.35;
    z-index: -1;
    pointer-events: none;
}

.glow-top {
    top: -200px;
    left: 10%;
    background: radial-gradient(circle, var(--color-primary), transparent 70%);
}

.glow-bottom {
    bottom: -200px;
    right: 10%;
    background: radial-gradient(circle, var(--color-secondary), transparent 70%);
}

/* Audio Control Floating Badge */
.audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(18, 12, 41, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 8px 16px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-main);
    transition: var(--transition-smooth);
}

.audio-control:hover {
    border-color: var(--color-accent);
    transform: scale(1.05);
}

.sound-waves {
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 12px;
}

.sound-waves span {
    width: 3px;
    height: 100%;
    background: var(--color-accent);
    border-radius: 2px;
    animation: soundWave 1.2s ease-in-out infinite alternate;
    display: none;
}

.audio-control.active .sound-waves span {
    display: block;
}

.sound-waves span:nth-child(2) { animation-delay: 0.2s; }
.sound-waves span:nth-child(3) { animation-delay: 0.4s; }

@keyframes soundWave {
    0% { height: 20%; }
    100% { height: 100%; }
}

/* Layout Container */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.badge-tag {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 20px;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--color-accent);
    margin-bottom: 12px;
}

.glow-text {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 6px;
    background: linear-gradient(135deg, #fff 0%, #d8b4fe 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
    margin-top: 6px;
}

/* Stepper Navigation */
.stepper-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto 40px auto;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: var(--transition-smooth);
}

.step-item.active {
    opacity: 1;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.step-item.active .step-num {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-color: var(--color-accent);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 12px;
    transition: var(--transition-smooth);
}

.step-line.active {
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

/* Step Sections */
.step-section {
    display: none;
    animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.step-section.active {
    display: block;
}

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

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--bg-card-border);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 6px;
}

.card-desc {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--color-accent);
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1.1rem;
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(10, 6, 28, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    font-family: var(--font-body);
    outline: none;
    transition: var(--transition-smooth);
}

.input-wrapper input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.3);
}

/* Astrology Quick Badge */
.astro-preview-badge {
    display: flex;
    gap: 16px;
    background: rgba(168, 85, 247, 0.1);
    border: 1px dashed rgba(168, 85, 247, 0.4);
    padding: 12px 18px;
    border-radius: 14px;
    margin-top: 16px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.astro-preview-badge.hidden {
    display: none;
}

.badge-info strong {
    color: var(--color-accent);
}

/* Focus Grid */
.focus-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .focus-grid { grid-template-columns: repeat(2, 1fr); }
}

.focus-btn {
    background: rgba(15, 10, 38, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    color: var(--color-text-main);
}

.focus-btn:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.focus-btn.active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(6, 182, 212, 0.25));
    border-color: var(--color-accent);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

.btn-emoji { font-size: 1.5rem; }
.btn-text { font-size: 0.85rem; font-weight: 500; text-align: center; }

/* Palm Scanner Box */
.scanner-box {
    position: relative;
    background: rgba(10, 6, 28, 0.8);
    border: 2px dashed rgba(6, 182, 212, 0.4);
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    user-select: none;
    transition: var(--transition-smooth);
}

.scanner-box:hover {
    border-color: var(--color-secondary);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.2);
}

.scanner-box.scanning {
    border-color: var(--color-accent);
    box-shadow: 0 0 35px rgba(251, 191, 36, 0.4);
}

.laser-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-secondary), var(--color-accent), transparent);
    box-shadow: 0 0 15px var(--color-secondary);
    display: none;
}

.scanner-box.scanning .laser-line {
    display: block;
    animation: scanLaser 1.5s ease-in-out infinite alternate;
}

@keyframes scanLaser {
    0% { top: 0%; }
    100% { top: 95%; }
}

.scan-finger-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
    transition: var(--transition-smooth);
}

.scanner-box.completed .scan-finger-icon {
    color: var(--color-accent);
    transform: scale(1.2);
}

.scan-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.scan-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 14px;
    overflow: hidden;
}

.scan-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    transition: width 0.1s linear;
}

/* Tarot Deck Grid */
.tarot-deck {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 12px;
}

@media (max-width: 768px) {
    .tarot-deck { grid-template-columns: repeat(4, 1fr); }
}

.tarot-card-item {
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1c1340, #2c1a63);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tarot-card-item:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--color-accent);
    box-shadow: 0 10px 25px rgba(168, 85, 247, 0.5);
}

.tarot-card-item.selected {
    border-color: var(--color-accent);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(168, 85, 247, 0.4));
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 0 25px rgba(251, 191, 36, 0.6);
}

.tarot-card-back {
    font-size: 1.5rem;
    color: var(--color-accent);
    opacity: 0.8;
}

.card-order-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    background: var(--color-accent);
    color: #000;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.cta-button {
    width: 100%;
    padding: 18px 24px;
    border-radius: 16px;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.cta-button.primary-glow {
    background: linear-gradient(135deg, var(--color-primary), #7c3aed);
    color: #fff;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.5);
}

.cta-button.primary-glow:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 0 45px rgba(168, 85, 247, 0.8);
    background: linear-gradient(135deg, #b875f8, #8b5cf6);
}

.cta-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Spacing Helpers */
.margin-top-md { margin-top: 24px; }
.margin-top-lg { margin-top: 36px; }
.text-center { text-align: center; }

/* STEP 2: RITUAL CANVAS & BALL */
.ritual-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px 30px;
}

.crystal-ball-wrapper {
    position: relative;
    width: 240px;
    height: 240px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#crystal-canvas {
    border-radius: 50%;
    z-index: 2;
}

.crystal-ball-glow {
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.5), transparent 70%);
    filter: blur(20px);
    z-index: 1;
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1.15); opacity: 0.9; }
}

.runes-ring {
    position: absolute;
    width: 310px;
    height: 310px;
    border-radius: 50%;
    border: 1px dashed rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: rotateRunes 25s linear infinite;
    pointer-events: none;
}

.runes-ring span {
    position: absolute;
    color: var(--color-accent);
    font-size: 1.2rem;
    transform-origin: 155px 155px;
}

.runes-ring span:nth-child(1) { transform: rotate(0deg) translate(-155px); }
.runes-ring span:nth-child(2) { transform: rotate(45deg) translate(-155px); }
.runes-ring span:nth-child(3) { transform: rotate(90deg) translate(-155px); }
.runes-ring span:nth-child(4) { transform: rotate(135deg) translate(-155px); }
.runes-ring span:nth-child(5) { transform: rotate(180deg) translate(-155px); }
.runes-ring span:nth-child(6) { transform: rotate(225deg) translate(-155px); }
.runes-ring span:nth-child(7) { transform: rotate(270deg) translate(-155px); }
.runes-ring span:nth-child(8) { transform: rotate(315deg) translate(-155px); }

@keyframes rotateRunes {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ritual-heading {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.ritual-message {
    color: var(--color-secondary);
    font-size: 1.1rem;
    min-height: 30px;
    margin-bottom: 24px;
}

.ritual-progress-container {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.ritual-progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width 0.4s ease;
}

/* STEP 3: REVELATION DASHBOARD */
.revelation-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aura-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.aura-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.avatar-aura-ring {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.7);
}

.avatar-initial {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
}

.user-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
}

.user-badges {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.tag-badge {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 0.75rem;
}

.tag-badge.gold {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    color: var(--color-accent);
}

.synergy-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.synergy-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.synergy-val {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--color-accent);
    text-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.section-title {
    margin-top: 10px;
}

.section-title h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Tarot Triad Grid */
.tarot-triad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .tarot-triad-grid { grid-template-columns: 1fr; }
}

.triad-card {
    background: rgba(18, 12, 41, 0.8);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: var(--transition-smooth);
}

.triad-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-4px);
}

.triad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.triad-position {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-secondary);
    font-weight: 700;
}

.triad-card-name {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--color-accent);
}

.triad-visual {
    height: 140px;
    background: linear-gradient(135deg, #1b1145, #351c6b);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.triad-meaning {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--color-text-main);
}

/* Timeline Tabs */
.timeline-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-btn:hover {
    color: #fff;
    border-color: var(--color-primary);
}

.tab-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.4);
}

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.4s ease; }

.timeline-body h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.timeline-body p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-main);
    margin-bottom: 16px;
}

.timeline-highlight {
    background: rgba(6, 182, 212, 0.12);
    border-left: 4px solid var(--color-secondary);
    padding: 12px 16px;
    border-radius: 0 12px 12px 0;
    font-size: 0.88rem;
}

/* Lucky Elements Grid */
.lucky-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .lucky-grid { grid-template-columns: 1fr; }
}

.lucky-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.lucky-card.warning-accent {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(45, 12, 20, 0.6);
}

.lucky-icon { font-size: 2rem; }

.lucky-info {
    display: flex;
    flex-direction: column;
}

.lucky-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.lucky-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-accent);
}

.lucky-value-sm {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #fca5a5;
}

/* Printable Certificate Card */
.certificate-card {
    background: linear-gradient(135deg, rgba(30, 20, 65, 0.9), rgba(15, 10, 35, 0.95));
    border: 2px solid var(--color-accent);
    padding: 28px;
    text-align: center;
}

.cert-header h4 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: #fff;
    margin-top: 6px;
}

.cert-seal {
    font-size: 0.75rem;
    color: var(--color-accent);
    letter-spacing: 3px;
}

.cert-body {
    margin-top: 20px;
}

.cert-name {
    font-size: 1.1rem;
    color: var(--color-text-main);
}

.cert-date {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.cert-quote {
    font-style: italic;
    color: var(--color-accent);
    margin-top: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 16px;
}

@media (max-width: 640px) {
    .action-bar { flex-direction: column; }
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 50px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: #000;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: var(--transition-smooth);
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
}
