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

:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --light-color: #f1f1f1;
    --gold-color: #ffd700;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--primary-color);
    color: var(--light-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Initial Screen */
#initialScreen {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.profile-container {
    text-align: center;
    animation: fadeInUp 1s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-image-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

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

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(103, 126, 234, 0.3) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
    z-index: 1;
}

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

.app-title {
    font-size: 4rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

.subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
    letter-spacing: 3px;
    font-weight: 300;
}

/* Popup Styles */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.popup.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: popupSlideIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

.popup-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--gold-color);
    animation: iconBounce 1s ease infinite;
}

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

.popup-icon svg {
    width: 100%;
    height: 100%;
}

.popup-content h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--light-color);
}

.popup-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.update-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.update-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.update-btn:active {
    transform: translateY(0);
}

.update-btn svg {
    width: 20px;
    height: 20px;
    animation: downloadPulse 1.5s ease infinite;
}

@keyframes downloadPulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Loading Screen */
#loadingScreen {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 50%, #1a1a2e 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
}

.loading-container {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.loading-spinner {
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
    position: relative;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--gold-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.spinner-ring:nth-child(2) {
    width: 80%;
    height: 80%;
    top: 10%;
    left: 10%;
    border-top-color: #667eea;
    animation-duration: 1.2s;
    animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
    width: 60%;
    height: 60%;
    top: 20%;
    left: 20%;
    border-top-color: #764ba2;
    animation-duration: 0.9s;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.progress-bar-container {
    width: 280px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin: 0 auto 1rem;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 1.5s infinite;
}

@keyframes progressShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-percentage {
    font-size: 1.5rem;
    color: var(--gold-color);
    font-weight: 600;
}

/* Final Screen */
#finalScreen {
    background: #000;
}

.final-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jesus-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: zoomIn 2s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(1.2);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.final-message {
    position: absolute;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 2rem 3rem;
    border-radius: 20px;
    animation: fadeInUp 1.5s ease 1s both;
    width: 90%;
    max-width: 500px;
}

.final-message.fade-out {
    animation: fadeOutMessage 0.8s ease forwards !important;
}

@keyframes fadeOutMessage {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.reveal-text {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--gold-color) 0%, #fff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.reveal-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-title {
        font-size: 3rem;
    }

    .popup-content {
        padding: 2rem 1.5rem;
    }

    .reveal-text {
        font-size: 2rem;
    }

    .final-message {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 480px) {
    .profile-image {
        width: 120px;
        height: 120px;
    }

    .app-title {
        font-size: 2.5rem;
    }

    .popup-content h2 {
        font-size: 1.5rem;
    }

    .popup-content p {
        font-size: 1rem;
    }

    .update-btn {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }

    .reveal-text {
        font-size: 1.75rem;
    }

    .reveal-subtitle {
        font-size: 1rem;
    }
}

/* Prevent scrolling and overscroll */
html, body {
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
}
