/* === FÖRLÅTELSENS RITUAL - AUTOMATISK PROGRESSION CSS === */

/* Reset och grundläggande styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Playfair Display', serif;
    color: #e8e3d3;
    background: #1a1b2e;
}

/* === FÄRGVARIABLER & GRADIENTER === */
:root {
    /* Färgpalett för ritualens progression */
    --deep-indigo: #1a1b2e;
    --mystic-purple: #16213e;
    --twilight-violet: #2d1b69;
    --sacred-blue: #0f3460;
    --gentle-turquoise: #16537e;
    --ethereal-teal: #1d5f6b;
    --golden-light: #ffd700;
    --starlight-white: #f8f6f0;
    --soft-amber: #ffb347;
    
    /* Timing variabler */
    --text-fade-duration: 0.8s;
    --step-transition: 2s ease-in-out;
    --breath-cycle: 4s;
}

/* === HUVUDLAYOUT === */
.ritual-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.ritual-step {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all var(--step-transition);
    pointer-events: none;
}

.ritual-step.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* === BAKGRUNDSGRADIENTER FÖR VARJE STEG === */

/* Steg 0: Välkommen */
#welcome-step {
    background: linear-gradient(135deg, 
        var(--deep-indigo) 0%, 
        var(--mystic-purple) 50%, 
        var(--twilight-violet) 100%);
}

/* Steg 1: Ingång/Andning */
#entrance-step {
    background: linear-gradient(135deg, 
        var(--twilight-violet) 0%, 
        var(--sacred-blue) 50%, 
        var(--gentle-turquoise) 100%);
}

/* Steg 2: Ansvarstagande */
#responsibility-step {
    background: linear-gradient(135deg, 
        var(--sacred-blue) 0%, 
        #2c1810 30%,
        var(--deep-indigo) 70%,
        var(--twilight-violet) 100%);
}

/* Steg 3: Empati */
#empathy-step {
    background: linear-gradient(135deg, 
        var(--gentle-turquoise) 0%, 
        var(--ethereal-teal) 40%, 
        #4a90a4 100%);
}

/* Steg 4: Ritualhandling */
#ritual-action-step {
    background: linear-gradient(135deg, 
        var(--ethereal-teal) 0%, 
        #5d4e75 30%,
        #8b4572 70%,
        var(--soft-amber) 100%);
}

/* Steg 5: Transformation */
#transformation-step {
    background: linear-gradient(135deg, 
        #8b4572 0%,
        var(--soft-amber) 40%,
        #daa520 80%,
        var(--golden-light) 100%);
}

/* Steg 6: Avslut/Befrielse */
#completion-step {
    background: linear-gradient(135deg, 
        var(--soft-amber) 0%, 
        var(--golden-light) 40%, 
        #fff8dc 80%,
        var(--starlight-white) 100%);
    color: #2c2416;
}

#completion-step .step-title,
#completion-step .ritual-text {
    color: #2c2416;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.3);
}

/* === INNEHÅLLSCENTRERING === */
.content-center {
    width: 100%;
    max-width: 900px;
    padding: 2rem;
    text-align: center;
}

.ceremonial-space {
    position: relative;
    padding: 2rem;
}

/* === TYPOGRAFI === */
.ritual-title {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.ritual-subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.9;
    margin-bottom: 3rem;
    font-family: 'Source Serif Pro', serif;
}

.step-title {
    font-size: 2.5rem;
    font-weight: 400;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.preparation-text {
    margin: 3rem 0;
    font-family: 'Source Serif Pro', serif;
}

.preparation-text p {
    margin: 1rem 0;
    font-size: 1.1rem;
    opacity: 0.8;
    line-height: 1.6;
}

/* === RITUAL TEXT PROGRESSION === */
.ritual-text-container {
    margin-top: 3rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.ritual-text {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.8;
}

.ritual-line {
    font-size: 1.2rem;
    margin: 0.8rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--text-fade-duration) ease-out;
    font-family: 'Source Serif Pro', serif;
    font-weight: 300;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1.8;
}

.ritual-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.ritual-pause {
    height: 1.5rem;
    opacity: 0 !important;
}

/* Special styling för de sista tre raderna */
.final-words {
    font-size: 1.8rem !important;
    font-weight: 500 !important;
    font-family: 'Playfair Display', serif !important;
    color: #2c2416 !important;
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.6) !important;
    margin: 1.5rem 0 !important;
    letter-spacing: 0.05em !important;
}

/* === STEG-SPECIFIKA VISUELLA ELEMENT === */

/* Välkomstljus */
.sacred-light {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at center, 
        rgba(255, 215, 0, 0.8) 0%,
        rgba(255, 215, 0, 0.4) 30%,
        rgba(255, 215, 0, 0.1) 70%,
        transparent 100%);
    margin: 0 auto 2rem;
    animation: gentleGlow 4s ease-in-out infinite alternate;
}

@keyframes gentleGlow {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.1); opacity: 1; }
}

/* === STEG 1: ANDNING === */
.breathing-container {
    margin: 2rem 0;
    position: relative;
}

.breathing-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(100, 200, 255, 0.3) 0%,
        rgba(100, 200, 255, 0.1) 60%,
        transparent 100%);
    border: 2px solid rgba(100, 200, 255, 0.5);
    margin: 0 auto;
    position: relative;
    transition: all var(--breath-cycle) ease-in-out;
}

.breathing-circle.inhale {
    transform: scale(1.4);
    background: radial-gradient(circle at center,
        rgba(100, 200, 255, 0.6) 0%,
        rgba(100, 200, 255, 0.3) 60%,
        transparent 100%);
    border-color: rgba(100, 200, 255, 0.8);
}

.breathing-circle.exhale {
    transform: scale(0.7);
    background: radial-gradient(circle at center,
        rgba(100, 200, 255, 0.2) 0%,
        rgba(100, 200, 255, 0.1) 60%,
        transparent 100%);
    border-color: rgba(100, 200, 255, 0.3);
}

.breathing-circle.hold {
    transform: scale(1.4);
    background: radial-gradient(circle at center,
        rgba(100, 200, 255, 0.8) 0%,
        rgba(100, 200, 255, 0.4) 60%,
        transparent 100%);
}

.breathing-circle.rest {
    transform: scale(1);
    background: radial-gradient(circle at center,
        rgba(100, 200, 255, 0.4) 0%,
        rgba(100, 200, 255, 0.2) 60%,
        transparent 100%);
}

.breathing-circle.heart {
    transform: scale(1.1);
    background: radial-gradient(circle at center,
        rgba(255, 182, 193, 0.6) 0%,
        rgba(255, 182, 193, 0.3) 60%,
        transparent 100%);
    border-color: rgba(255, 182, 193, 0.7);
}

.breathing-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2rem;
    font-weight: 300;
    font-family: 'Source Serif Pro', serif;
    text-align: center;
}

.breath-text {
    display: block;
    transition: all 0.5s ease;
}

/* === STEG 2: HÄNDER OCH BÖRDA === */
.hands-container {
    margin: 2rem 0;
    position: relative;
}

.ceremonial-hands {
    width: 200px;
    height: 150px;
    margin: 0 auto;
    position: relative;
    background: radial-gradient(ellipse at center,
        rgba(245, 222, 179, 0.2) 0%,
        rgba(245, 222, 179, 0.1) 50%,
        transparent 100%);
    border-radius: 50px;
    transition: all 2s ease-in-out;
}

.ceremonial-hands::before,
.ceremonial-hands::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 100px;
    background: linear-gradient(45deg,
        rgba(245, 222, 179, 0.3) 0%,
        rgba(245, 222, 179, 0.1) 100%);
    border-radius: 40px 40px 60px 60px;
    top: 25px;
}

.ceremonial-hands::before {
    left: 20px;
    transform: rotate(-15deg);
}

.ceremonial-hands::after {
    right: 20px;
    transform: rotate(15deg);
}

.invisible-burden {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        transparent 100%);
    opacity: 0;
    transition: all 2s ease-in-out;
}

.ceremonial-hands.holding-burden .invisible-burden {
    opacity: 1;
    animation: burden-pulse 3s ease-in-out infinite;
}

@keyframes burden-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
}

/* === STEG 3: EMPATI-LJUS === */
.empathy-light-container {
    margin: 2rem 0;
    position: relative;
}

.empathy-light {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(178, 255, 255, 0.6) 40%,
        rgba(100, 200, 255, 0.3) 70%,
        transparent 100%);
    margin: 0 auto;
    cursor: default;
    position: relative;
    transition: all 1s ease-in-out;
}

.empathy-light.interactive {
    cursor: pointer;
    animation: gentle-pulse 2s ease-in-out infinite;
}

.empathy-light.interactive:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(178, 255, 255, 0.6);
}

.empathy-light.activated {
    transform: scale(1.1);
    box-shadow: 0 0 50px rgba(178, 255, 255, 0.8);
}

.light-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 1) 0%,
        rgba(178, 255, 255, 0.8) 50%,
        transparent 100%);
    border-radius: 50%;
}

.empathy-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid rgba(178, 255, 255, 0.8);
    opacity: 1;
    animation: empathy-ripple 3s ease-out forwards;
}

@keyframes empathy-ripple {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(4);
        opacity: 0;
    }
}

@keyframes gentle-pulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* === STEG 4: MÖRKT FRÖ === */
.seed-container {
    margin: 2rem 0;
    position: relative;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-seed {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        #4a4a4a 0%,
        #2a2a2a 40%,
        #1a1a1a 80%,
        #0a0a0a 100%);
    cursor: default;
    transition: all 2s ease-in-out;
    position: relative;
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 0, 0, 0.5);
}

.dark-seed.interactive {
    cursor: pointer;
    animation: seed-ready 2s ease-in-out infinite;
}

.dark-seed.interactive:hover {
    transform: translateY(-5px);
    box-shadow: 
        inset 0 0 20px rgba(0, 0, 0, 0.8),
        0 5px 25px rgba(0, 0, 0, 0.7);
}

.dark-seed.lifting {
    transform: translateY(-100px) scale(1.2);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.5);
}

.dark-seed.dissolving {
    background: radial-gradient(circle at center,
        rgba(255, 215, 0, 0.9) 0%,
        rgba(255, 215, 0, 0.6) 30%,
        rgba(255, 255, 255, 0.8) 60%,
        transparent 100%);
    transform: translateY(-150px) scale(2);
    opacity: 0;
    box-shadow: 0 0 100px rgba(255, 215, 0, 1);
}

.seed-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle,
        #1a1a1a 0%,
        #0a0a0a 100%);
    border-radius: 50%;
}

@keyframes seed-ready {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* === STEG 5: TRANSFORMATION === */
.transformation-space {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 2rem auto;
}

.cosmic-waves {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

.cosmic-waves.active {
    opacity: 1;
    animation: wave-flow 15s ease-in-out infinite;
}

.cosmic-waves::before,
.cosmic-waves::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.cosmic-waves::before {
    animation: cosmic-ripple-1 8s ease-in-out infinite;
}

.cosmic-waves::after {
    animation: cosmic-ripple-2 12s ease-in-out infinite reverse;
}

.stellar-field {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 3s ease-in-out;
    background-image: 
        radial-gradient(2px 2px at 30px 40px, rgba(255, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 80px 20px, rgba(255, 215, 0, 0.4), transparent),
        radial-gradient(2px 2px at 150px 80px, rgba(178, 255, 255, 0.3), transparent),
        radial-gradient(1px 1px at 200px 50px, rgba(255, 255, 255, 0.2), transparent);
    background-size: 250px 150px;
    animation: stellar-twinkle 10s linear infinite;
}

.stellar-field.active {
    opacity: 1;
}

@keyframes cosmic-ripple-1 {
    0% { transform: scale(0.5); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.3; }
    100% { transform: scale(2.5); opacity: 0; }
}

@keyframes cosmic-ripple-2 {
    0% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(2); opacity: 0.2; }
    100% { transform: scale(3); opacity: 0; }
}

@keyframes wave-flow {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

@keyframes stellar-twinkle {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* === STEG 6: BEFRIELSE === */
.liberation-light-container {
    margin: 2rem 0;
    position: relative;
}

.liberation-light {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 215, 0, 0.9) 20%,
        rgba(255, 179, 71, 0.6) 50%,
        rgba(255, 215, 0, 0.3) 80%,
        transparent 100%);
    margin: 0 auto;
    position: relative;
    animation: liberation-glow 3s ease-in-out infinite alternate;
    box-shadow: 0 0 80px rgba(255, 215, 0, 0.7);
}

.liberation-light.final-radiance {
    animation: final-radiance 4s ease-in-out infinite;
    box-shadow: 0 0 120px rgba(255, 215, 0, 1);
}

.radiant-beams {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    height: 350px;
    background: conic-gradient(
        from 0deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 5%,
        transparent 10%,
        rgba(255, 215, 0, 0.3) 15%,
        transparent 20%,
        rgba(255, 255, 255, 0.4) 25%,
        transparent 30%,
        rgba(255, 215, 0, 0.3) 35%,
        transparent 40%,
        rgba(255, 255, 255, 0.4) 45%,
        transparent 50%,
        rgba(255, 215, 0, 0.3) 55%,
        transparent 60%,
        rgba(255, 255, 255, 0.4) 65%,
        transparent 70%,
        rgba(255, 215, 0, 0.3) 75%,
        transparent 80%,
        rgba(255, 255, 255, 0.4) 85%,
        transparent 90%,
        rgba(255, 215, 0, 0.3) 95%,
        transparent 100%
    );
    animation: beam-rotation 20s linear infinite;
    pointer-events: none;
}

@keyframes liberation-glow {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 80px rgba(255, 215, 0, 0.7);
    }
    100% { 
        transform: scale(1.1);
        box-shadow: 0 0 120px rgba(255, 215, 0, 1);
    }
}

@keyframes final-radiance {
    0% { 
        transform: scale(1);
        box-shadow: 0 0 120px rgba(255, 215, 0, 1);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 180px rgba(255, 215, 0, 1);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 0 120px rgba(255, 215, 0, 1);
    }
}

@keyframes beam-rotation {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* CSS för freedom-words togs bort - nu använder vi .final-words istället */

/* === KNAPPAR === */
.ritual-continue,
.ritual-complete {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.2) 0%,
        rgba(255, 215, 0, 0.1) 100%);
    border: 2px solid rgba(255, 215, 0, 0.5);
    color: var(--starlight-white);
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-family: 'Playfair Display', serif;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.6s ease;
    margin-top: 3rem;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
}

.ritual-continue:hover,
.ritual-complete:hover {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.3) 0%,
        rgba(255, 215, 0, 0.2) 100%);
    border-color: rgba(255, 215, 0, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.ritual-complete.revealed {
    opacity: 1;
    transform: translateY(0);
}

#completion-step .ritual-complete {
    color: #2c2416;
    border-color: #8b6914;
}

#completion-step .ritual-complete:hover {
    background: linear-gradient(135deg, 
        rgba(139, 105, 20, 0.3) 0%,
        rgba(139, 105, 20, 0.2) 100%);
    border-color: #8b6914;
}

/* Visa start-knapp direkt */
#welcome-step .ritual-continue {
    opacity: 1;
    transform: translateY(0);
}

/* === BAKGRUNDSELEMENT === */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 215, 0, 0.1), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(178, 255, 255, 0.1), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.1), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255, 215, 0, 0.1), transparent);
    background-repeat: repeat;
    background-size: 200px 150px;
    animation: particleFloat 25s linear infinite;
}

@keyframes particleFloat {
    from { transform: translateY(0px); }
    to { transform: translateY(-150px); }
}

.ambient-waves {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center,
        transparent 0%,
        rgba(255, 215, 0, 0.02) 50%,
        transparent 100%);
    animation: ambient-pulse 15s ease-in-out infinite alternate;
}

@keyframes ambient-pulse {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.1); }
}

/* === BEFRIELSE FULLBORDAN === */
body.liberation-complete {
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 215, 0, 0.7) 30%,
        rgba(255, 179, 71, 0.5) 60%,
        rgba(255, 215, 0, 0.3) 100%);
    animation: liberation-flash 3s ease-out;
}

@keyframes liberation-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
    100% { filter: brightness(1); }
}

/* === RESPONSIV DESIGN === */
@media (max-width: 768px) {
    .ritual-title {
        font-size: 2.5rem;
    }
    
    .step-title {
        font-size: 2rem;
    }
    
    .content-center {
        padding: 1rem;
    }
    
    .ceremonial-space {
        padding: 1rem;
    }
    
    .ritual-line {
        font-size: 1.1rem;
    }
    
    .breathing-circle {
        width: 150px;
        height: 150px;
    }
    
    .liberation-light {
        width: 140px;
        height: 140px;
    }
    
    .freedom-words {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .ritual-title {
        font-size: 2rem;
    }
    
    .step-title {
        font-size: 1.6rem;
    }
    
    .ritual-line {
        font-size: 1rem;
    }
    
    .breathing-circle {
        width: 120px;
        height: 120px;
    }
    
    .freedom-words {
        font-size: 2rem;
    }
}

/* === TILLGÄNGLIGHET === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .ritual-step {
        transition: opacity 0.3s ease;
    }
    
    .ritual-line {
        transition: opacity 0.3s ease;
    }
}

/* Förbättra fokus-synlighet för tillgänglighet */
.empathy-light:focus,
.dark-seed:focus,
.ritual-continue:focus,
.ritual-complete:focus {
    outline: 3px solid rgba(255, 215, 0, 0.8);
    outline-offset: 4px;
}