* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #3b82f6 50%, #60a5fa 75%, #93c5fd 100%);
    background-attachment: fixed;
    direction: rtl;
    position: relative;
    overflow: hidden;
    transition: background 1.5s ease-in-out;
}

/* Rain state - blue gradient */
body.has-rain {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 25%, #3b82f6 50%, #60a5fa 75%, #93c5fd 100%);
}

/* No rain state - brownish red gradient */
body.no-rain {
    background: linear-gradient(135deg, #92400e 0%, #b45309 50%, #d97706 100%);
}

.container {
    text-align: center;
    padding: 2rem;
}

.main-text {
    font-size: 4rem;
    color: #1e40af;
    text-shadow: 2px 2px 12px rgba(59, 130, 246, 0.5), 0 0 20px rgba(147, 197, 253, 0.3);
    font-weight: 700;
    letter-spacing: 0.05em;
    animation: fadeIn 1s ease-in;
    position: relative;
    z-index: 10;
    transition: color 1.5s ease-in-out, text-shadow 1.5s ease-in-out;
}

/* Text color for rain state */
body.has-rain .main-text {
    color: #1e40af;
    text-shadow: 2px 2px 12px rgba(59, 130, 246, 0.5), 0 0 20px rgba(147, 197, 253, 0.3);
}

/* Text color for no-rain state - brownish red */
body.no-rain .main-text {
    color: #fef3c7;
    text-shadow: 2px 2px 12px rgba(217, 119, 6, 0.5), 0 0 20px rgba(180, 83, 9, 0.3);
}

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

@media (max-width: 768px) {
    .main-text {
        font-size: 2.5rem;
    }
}

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

/* Rain droplets */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: opacity 1.5s ease-in-out;
}

/* Hide rain when no rain */
body.no-rain .rain-container {
    opacity: 0;
    pointer-events: none;
}

/* Show rain when raining */
body.has-rain .rain-container {
    opacity: 1;
}

.droplet {
    position: absolute;
    width: 4px;
    height: 20px;
    background: linear-gradient(to bottom, rgba(147, 197, 253, 0.8), rgba(59, 130, 246, 0.6));
    border-radius: 0 0 50% 50%;
    animation: fall linear infinite;
    opacity: 0.7;
}

.droplet-1 {
    left: 5%;
    top: -20px;
    animation-duration: 1.2s;
    animation-delay: 0s;
}

.droplet-2 {
    left: 8%;
    top: -40px;
    animation-duration: 1.5s;
    animation-delay: 0.3s;
}

.droplet-3 {
    left: 12%;
    top: -20px;
    animation-duration: 1.3s;
    animation-delay: 0.1s;
}

.droplet-4 {
    right: 5%;
    top: -30px;
    animation-duration: 1.4s;
    animation-delay: 0.2s;
}

.droplet-5 {
    right: 8%;
    top: -50px;
    animation-duration: 1.6s;
    animation-delay: 0.4s;
}

.droplet-6 {
    right: 12%;
    top: -25px;
    animation-duration: 1.3s;
    animation-delay: 0.15s;
}

.droplet-7 {
    left: 3%;
    top: -35px;
    animation-duration: 1.5s;
    animation-delay: 0.25s;
}

.droplet-8 {
    right: 3%;
    top: -45px;
    animation-duration: 1.4s;
    animation-delay: 0.35s;
}

@keyframes fall {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.7;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(calc(100vh + 50px)) translateX(10px);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 10;
}

/* Loading state */
.loading-state {
    font-size: 2rem;
    color: #60a5fa;
    text-shadow: 2px 2px 8px rgba(59, 130, 246, 0.5);
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
    margin: 2rem 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* Error state */
.error-state {
    text-align: center;
    color: #fbbf24;
    font-size: 1.25rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(30, 58, 138, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease-in;
}

.error-state p {
    margin-bottom: 1.5rem;
    color: #fef3c7;
}

.retry-button {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    font-family: inherit;
    direction: rtl;
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.5);
}

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

@media (max-width: 768px) {
    .loading-state {
        font-size: 1.5rem;
    }
    
    .error-state {
        font-size: 1.1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .loading-state {
        font-size: 1.25rem;
    }
    
    .error-state {
        font-size: 1rem;
        padding: 1rem;
    }
    
    .retry-button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

