/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff1744;
    --primary-dark: #c41c3b;
    --primary-light: #ff5177;
    --secondary-color: #f50057;
    --bg-gradient-start: #fff0f3;
    --bg-gradient-end: #ffe0e8;
    --text-color: #2d2d2d;
    --text-light: #666;
    --shadow: 0 10px 40px rgba(255, 23, 68, 0.2);
    --shadow-hover: 0 15px 60px rgba(255, 23, 68, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow: hidden;
    position: relative;
}

/* Hearts Container for final animation */
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.falling-heart {
    position: absolute;
    font-size: 30px;
    animation: fall linear forwards;
    opacity: 0;
}

@keyframes fall {
    0% {
        top: -50px;
        opacity: 1;
    }
    100% {
        top: 100vh;
        opacity: 0.3;
    }
}

/* Heart Counter */
.heart-counter {
    position: fixed;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    z-index: 10000;
    animation: counterPulse 1s ease-in-out infinite;
}

.heart-counter.visible {
    display: flex;
}

.heart-icon {
    font-size: 30px;
    animation: heartBeat 1.2s ease-in-out infinite;
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    10%, 30% {
        transform: scale(1.1);
    }
    20%, 40% {
        transform: scale(0.95);
    }
}

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

/* Wizard Container */
.wizard-container {
    max-width: 800px;
    width: 90%;
    padding: 40px;
    position: relative;
    z-index: 1;
}

/* Wizard Steps */
.wizard-step {
    display: none;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wizard-step.active {
    display: block;
    animation: stepAppear 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.wizard-step.exiting {
    animation: stepExit 0.6s ease-in forwards;
}

@keyframes stepAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes stepExit {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
}

.wizard-content {
    background: white;
    padding: 60px 50px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: all 0.3s ease;
}

.wizard-content:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-5px);
}

/* Text Styling */
.wizard-text {
    font-size: 28px;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 40px;
    animation: textFloat 3s ease-in-out infinite;
}

.wizard-text.final {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    animation: finalTextGlow 2s ease-in-out infinite;
}

@keyframes textFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes finalTextGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 23, 68, 0.3);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 23, 68, 0.6);
    }
}

/* Buttons */
.wizard-button {
    padding: 18px 45px;
    font-size: 20px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 23, 68, 0.3);
    position: relative;
    overflow: hidden;
    margin: 10px;
}

.wizard-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wizard-button:hover::before {
    width: 300px;
    height: 300px;
}

.wizard-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(255, 23, 68, 0.4);
}

.wizard-button:active {
    transform: translateY(0);
}

.wizard-button.secondary {
    background: linear-gradient(135deg, #757575, #9e9e9e);
    box-shadow: 0 5px 20px rgba(117, 117, 117, 0.3);
}

.wizard-button.secondary:hover {
    box-shadow: 0 8px 30px rgba(117, 117, 117, 0.4);
}

.wizard-button.primary {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
    animation: buttonPulse 2s ease-in-out infinite;
}

.wizard-button.primary:hover {
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.4);
    animation: none;
}

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

/* Button Group */
.wizard-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: modalFadeIn 0.3s ease;
}

.modal.active {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 50px;
    border-radius: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.7) translateY(-50px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 60px;
    margin-bottom: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.modal-content p {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 30px;
}

/* Background Hearts Decoration */
body::before,
body::after {
    content: '❤️';
    position: absolute;
    font-size: 100px;
    opacity: 0.1;
    animation: floatHeart 6s ease-in-out infinite;
}

body::before {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

body::after {
    bottom: 10%;
    right: 10%;
    animation-delay: 3s;
}

@keyframes floatHeart {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    75% {
        transform: translateY(20px) rotate(-5deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wizard-container {
        width: 95%;
        padding: 20px;
    }

    .wizard-content {
        padding: 40px 30px;
    }

    .wizard-text {
        font-size: 22px;
    }

    .wizard-text.final {
        font-size: 24px;
    }

    .wizard-button {
        padding: 15px 35px;
        font-size: 18px;
        width: 100%;
        max-width: 350px;
    }

    .modal-content {
        padding: 40px 30px;
        width: 90%;
    }

    .modal-content h2 {
        font-size: 50px;
    }

    .modal-content p {
        font-size: 20px;
    }

    body::before,
    body::after {
        font-size: 60px;
    }

    .heart-counter {
        font-size: 20px;
        padding: 12px 25px;
    }

    .heart-icon {
        font-size: 24px;
    }
}

/* Step 5 - Show counter before showing */
#step-5.active ~ #heart-counter {
    display: flex;
}

/* Additional animations for step transitions */
.wizard-content * {
    position: relative;
    z-index: 1;
}
