* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    direction: rtl;
    lang: ar;
}

body {
    font-family: 'Cairo', 'Amiri', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

/* Animated background butterflies - diverse animations */
@keyframes fly1 {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(120px) translateY(-150px) rotate(180deg); }
    100% { transform: translateX(0) translateY(300px) rotate(360deg); }
}

@keyframes fly2 {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(-150px) translateY(-100px) rotate(-180deg); }
    100% { transform: translateX(0) translateY(350px) rotate(-360deg); }
}

@keyframes fly3 {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(100px) translateY(150px) rotate(180deg); }
    100% { transform: translateX(-200px) translateY(-200px) rotate(360deg); }
}

@keyframes fly4 {
    0% { transform: translateX(0) translateY(0) rotate(0deg); }
    50% { transform: translateX(-100px) translateY(100px) rotate(-180deg); }
    100% { transform: translateX(180px) translateY(-250px) rotate(-360deg); }
}

.door-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.door-content {
    text-align: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    padding: 60px 40px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    max-width: 600px;
    width: 90%;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.door-message {
    font-size: 2rem;
    color: #ffffff;
    margin-bottom: 50px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
    font-weight: 600;
}

.door-message.unlocked {
    color: #00ff00;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    animation: pulse 0.5s ease-out;
}

.door-description {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    font-style: italic;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.countdown {
    margin: 40px 0;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 40px;
}

.time-unit {
    background: rgba(255, 255, 255, 0.2);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s ease;
}

.time-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 10px;
    transition: all 0.5s ease;
}

.time-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* RGB Color shifting for timer when unlocked */
.time-unit.rgb-shift .time-value {
    animation: rgbShift 2s infinite;
}

@keyframes rgbShift {
    0% { 
        color: #ff0000;
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
    }
    33% { 
        color: #00ff00;
        text-shadow: 0 0 10px rgba(0, 255, 0, 0.6);
    }
    66% { 
        color: #0000ff;
        text-shadow: 0 0 10px rgba(0, 0, 255, 0.6);
    }
    100% { 
        color: #ff0000;
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
    }
}

/* Button with water wave effect */
.door-button {
    position: relative;
    padding: 16px 50px;
    font-size: 1.2rem;
    font-family: 'Cairo', Arial, sans-serif;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-weight: 600;
}

.door-button.not-yet {
    background-color: #999999;
    color: #ffffff;
}

.door-button.not-yet:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.door-button.open-now {
    background-color: #00ff00;
    color: #000000;
    animation: openPulse 0.5s ease-out;
}

.door-button.open-now::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: waterWave 0.8s ease-out 0s infinite;
    pointer-events: none;
}

@keyframes waterWave {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.door-button.open-now:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

@keyframes openPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Responsive design */
@media (max-width: 768px) {
    .door-content {
        padding: 30px 20px;
        width: 95%;
    }

    .door-message {
        font-size: 1.3rem;
        margin-bottom: 20px;
        line-height: 1.4;
    }

    .door-description {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .countdown {
        margin: 25px 0;
    }

    .countdown-timer {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 25px;
    }

    .time-unit {
        padding: 15px 10px;
        border-radius: 8px;
    }

    .time-value {
        font-size: 1.6rem;
        margin-bottom: 5px;
    }

    .time-label {
        font-size: 0.7rem;
        letter-spacing: 0.5px;
    }

    .door-button {
        padding: 12px 30px;
        font-size: 0.95rem;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .door-content {
        padding: 20px 15px;
        border-radius: 15px;
    }

    .door-message {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .door-description {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .countdown-timer {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        margin-bottom: 20px;
    }

    .time-unit {
        padding: 12px 8px;
        border-radius: 6px;
    }

    .time-value {
        font-size: 1.4rem;
        margin-bottom: 3px;
    }

    .time-label {
        font-size: 0.65rem;
    }

    .door-button {
        padding: 10px 25px;
        font-size: 0.9rem;
    }
}

/* Butterfly decoration - animated butterflies in the background */
.butterfly {
    position: fixed;
    z-index: -1;
    will-change: transform;
    pointer-events: none;
}
