/* Index Page Specific Styles */

/* Index page body layout - centered content with particles contained */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    position: relative;
    overflow: hidden; /* Keep particles from causing scrollbars - INDEX ONLY */
}

.main-header {
    max-width: 600px;
    /* Subtle fade-in on page load - starts invisible, ends visible */
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

h1 {
    font-family: 'Creepster', cursive;
    font-size: 4rem;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 15px 30px;
    background-color: var(--color-accent);
    color: var(--color-bg);
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 50px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                background-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 127, 80, 0.2);
}

.cta-button:hover {
    transform: scale(1.05) translateY(-2px);
    background-color: #ff9166; /* Slightly lighter orange on hover */
    box-shadow: 0 0 30px rgba(255, 127, 80, 0.7),
                0 0 60px rgba(255, 127, 80, 0.4),
                0 8px 20px rgba(255, 127, 80, 0.3);
    /* The cubic-bezier creates a subtle bounce effect - more polished than basic scale */
}

.cta-button:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 4px;
}

/* Ghost Animation */
.ghost-container {
    width: calc(var(--ghost-width) * 2 + var(--ghost-spacing) * 3);
    height: calc(var(--ghost-height) + 30px);
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    gap: var(--ghost-spacing);
    justify-content: center;
}

.ghost {
    width: var(--ghost-width);
    height: var(--ghost-height);
    background: var(--color-ghost);
    border-radius: calc(var(--ghost-width) / 2) calc(var(--ghost-width) / 2) 0 0;
    position: relative;
}

.ghost-one {
    animation: float 3.2s ease-in-out infinite;
}

.ghost-two {
    animation: float 3s ease-in-out infinite;
}

/* Add a cute bow to the second ghost */
.ghost-two::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 18px;
    width: 28px;
    height: 28px;
    background: url('../assets/pink_bow.png') no-repeat center;
    background-size: contain;
    transform: rotate(-15deg);
}

.ghost-eyes {
    position: absolute;
    top: 25px;
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.ghost-eye {
    width: 10px;
    height: 10px;
    background: #1a1a1a;
    border-radius: 50%;
}

/* Add cute blush as cheeks */
.ghost::before {
    content: '';
    position: absolute;
    top: 35px;
    left: 12px;
    width: 12px;
    height: 5px;
    background: var(--color-blush);
    border-radius: 50%;
    opacity: 0.6;
    box-shadow: 18px 0 0 var(--color-blush);
}

/* Floating heart between ghosts */
.floating-heart {
    width: 50px;
    height: 50px;
    background: url('../assets/pink_heart.png') no-repeat center;
    background-size: contain;
    position: relative;
    animation: heartFloat 3.5s ease-in-out infinite;
    opacity: 0.9;
}

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

@keyframes heartFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-25px) scale(1.1);
    }
}

/* Page load animation - fade in with subtle upward movement */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Subtle floating particles for atmosphere - barely noticeable but adds depth */
.particle {
    position: absolute;
    pointer-events: none; /* Don't interfere with clicks */
    opacity: 0.08; /* VERY subtle - almost invisible */
    z-index: 0; /* Behind everything else */
}

/* Create tiny floating sparkles using CSS gradients (no images needed) */
.particle::before {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, var(--color-accent) 0%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 3px rgba(255, 127, 80, 0.3);
}

/* Different particles drift at different speeds and positions */
.particle:nth-child(1) {
    top: 10%;
    left: 15%;
    animation: particleDrift 25s ease-in-out infinite;
}

.particle:nth-child(2) {
    top: 70%;
    left: 80%;
    animation: particleDrift 30s ease-in-out infinite 5s;
}

.particle:nth-child(3) {
    top: 40%;
    left: 5%;
    animation: particleDrift 35s ease-in-out infinite 10s;
}

.particle:nth-child(4) {
    top: 85%;
    left: 50%;
    animation: particleDrift 28s ease-in-out infinite 3s;
}

.particle:nth-child(5) {
    top: 25%;
    left: 90%;
    animation: particleDrift 32s ease-in-out infinite 8s;
}

@keyframes particleDrift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.08;
    }
    25% {
        transform: translate(30px, -50px) scale(1.2);
        opacity: 0.12;
    }
    50% {
        transform: translate(-20px, -100px) scale(0.8);
        opacity: 0.06;
    }
    75% {
        transform: translate(40px, -70px) scale(1.1);
        opacity: 0.1;
    }
}

/* --- Halloween Countdown Timer --- */
.countdown-container {
    margin: 2rem 0 1.5rem 0;
    animation: fadeInUp 1.2s ease-out forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

.countdown-label {
    font-family: 'Creepster', cursive;
    font-size: 1.5rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 107, 53, 0.3);
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.countdown-number {
    font-family: 'Creepster', cursive;
    font-size: 3.5rem;
    color: var(--color-accent);
    text-shadow:
        0 0 20px rgba(255, 107, 53, 0.6),
        0 0 40px rgba(255, 107, 53, 0.3);
    animation: pulse 2s ease-in-out infinite;
    line-height: 1;
}

.countdown-label-small {
    font-size: 0.85rem;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.countdown-separator {
    font-family: 'Creepster', cursive;
    font-size: 3rem;
    color: var(--color-accent);
    opacity: 0.5;
    animation: blink 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        text-shadow:
            0 0 20px rgba(255, 107, 53, 0.6),
            0 0 40px rgba(255, 107, 53, 0.3);
    }
    50% {
        transform: scale(1.05);
        text-shadow:
            0 0 30px rgba(255, 107, 53, 0.8),
            0 0 60px rgba(255, 107, 53, 0.5);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.2;
    }
}

/* Locked button state */
.cta-button.locked {
    background-color: #666;
    color: #999;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.5;
    box-shadow: none;
}

.cta-button.locked:hover {
    transform: none;
    background-color: #666;
    box-shadow: none;
}

/* Button container for padlock positioning */
.button-container {
    position: relative;
    display: inline-block;
}

/* Padlock overlay */
.padlock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: auto;
    pointer-events: all;
    cursor: pointer;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    transition: transform 0.3s ease;
    z-index: 10;
}

.padlock-overlay.shaking {
    animation: padlock-shake 1.7s ease-in-out 0.5s; /* Shake for 1.7s after 0.5s delay */
}

@keyframes padlock-shake {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translate(-50%, -50%) rotate(-8deg);
    }
    20%, 40%, 60%, 80% {
        transform: translate(-50%, -50%) rotate(8deg);
    }
}

/* Hide padlock when button unlocks */
.padlock-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

/* Respect user motion preferences - Accessibility */
@media (prefers-reduced-motion: reduce) {
    .ghost-one,
    .ghost-two,
    .floating-heart,
    .particle {
        animation: none;
    }

    .cta-button {
        transition: none;
    }

    /* Disable page load animation for users with motion sensitivity */
    .main-header {
        animation: none;
        opacity: 1;
    }

    /* Hide particles entirely for users who prefer reduced motion */
    .particle {
        display: none;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    p {
        font-size: 1rem;
    }

    .ghost-container {
        transform: scale(0.8);
    }

    .cta-button {
        font-size: 1rem;
        padding: 12px 24px;
    }

    .countdown-label {
        font-size: 1.2rem;
    }

    .countdown-number {
        font-size: 2.5rem;
    }

    .countdown-unit {
        min-width: 60px;
    }

    .countdown-display {
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
    }

    .ghost-container {
        transform: scale(0.7);
    }

    .countdown-label {
        font-size: 1rem;
    }

    .countdown-number {
        font-size: 2rem;
    }

    .countdown-unit {
        min-width: 50px;
    }

    .countdown-separator {
        font-size: 2rem;
    }

    .padlock-overlay {
        width: 50px;
    }
}
