/* PayPal Colors */
:root {
    --paypal-blue: #003087;
    --paypal-light-blue: #009CDE;
    --paypal-gold: #FFC439;
    --paypal-white: #FFFFFF;
    --paypal-gray: #F5F7FA;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    /* Основной градиентный фон */
    background: linear-gradient(-45deg, var(--paypal-gray), var(--paypal-white), #e3f2fd, var(--paypal-gray));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    /* Safari fallback */
    background: -webkit-linear-gradient(-45deg, var(--paypal-gray), var(--paypal-white), #e3f2fd, var(--paypal-gray));
    min-height: 100vh;
    display: flex;
    display: -webkit-flex; /* Safari */
    align-items: center;
    -webkit-align-items: center; /* Safari */
    justify-content: center;
    -webkit-justify-content: center; /* Safari */
    /* Убираем подсветку касаний на мобильных Safari */
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

/* Фоновое изображение офиса (полупрозрачное) */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/office-background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.75; /* Немного увеличиваем прозрачность для лучшей видимости */
    z-index: -2;
    /* Убираем размытие для четкости */
}

/* Цветовое наложение для глубины */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0, 48, 135, 0.1) 0%, 
        rgba(0, 156, 222, 0.05) 50%, 
        rgba(255, 196, 57, 0.05) 100%
    );
    z-index: -1;
}

.container {
    text-align: center;
    max-width: 600px;
    width: 90%;
    padding: 40px;
    /* Усиленный стеклянный эффект */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 
        0 15px 35px rgba(0, 48, 135, 0.1),
        0 5px 15px rgba(0, 156, 222, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
    animation: containerFloat 6s ease-in-out infinite;
}

.logo-container {
    margin-bottom: 40px;
}

.logo {
    max-width: 200px;
    height: auto;
}

/* Progress State */
.main-title {
    color: var(--paypal-blue);
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 40px;
    line-height: 1.2;
    animation: titleGlow 3s ease-in-out infinite alternate;
    text-shadow: 0 0 20px rgba(0, 48, 135, 0.3);
}

.progress-container {
    margin: 40px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: var(--paypal-gray);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: var(--paypal-blue);
    border-radius: 10px;
    transition: width 0.5s ease;
    -webkit-transition: width 0.5s ease; /* Safari */
    position: relative;
    /* Аппаратное ускорение для плавности */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    box-shadow: 0 0 20px rgba(0, 156, 222, 0.6);
}

.progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: progressWave 2s linear infinite;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--paypal-white);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--paypal-white);
    animation: progressPulse 1.5s ease-in-out infinite;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-percentage {
    font-size: 2rem;
    font-weight: bold;
    color: var(--paypal-blue);
}

.progress-status {
    color: var(--paypal-light-blue);
    font-weight: 500;
}

/* Office Image */
.office-image {
    margin-top: 40px;
    text-align: center;
}

.office-illustration {
    max-width: 350px;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 48, 135, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.office-illustration:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 48, 135, 0.25);
}

.office-description {
    margin-top: 20px;
    color: var(--paypal-blue);
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Finished State */
.finished-state {
    animation: celebrate 0.8s ease-out;
}

.finished-title {
    color: var(--paypal-blue);
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 30px;
}

.qr-container {
    margin: 30px 0;
}

.qr-code {
    max-width: 250px;
    height: auto;
    border: 3px solid var(--paypal-gold);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 48, 135, 0.2);
    transition: transform 0.3s ease;
}

.qr-code:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.qr-link {
    display: inline-block;
    text-decoration: none;
}

.office-button {
    display: inline-block;
    padding: 20px 40px;
    background: linear-gradient(135deg, var(--paypal-gold), #FFD700);
    /* Safari fallback */
    background: -webkit-linear-gradient(135deg, var(--paypal-gold), #FFD700);
    color: var(--paypal-blue);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(255, 196, 57, 0.4);
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease; /* Safari */
    border: 3px solid var(--paypal-blue);
    /* Убираем выделение на iOS */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.office-button:hover {
    transform: translateY(-3px);
    -webkit-transform: translateY(-3px); /* Safari */
    box-shadow: 0 12px 35px rgba(255, 196, 57, 0.6);
    background: linear-gradient(135deg, #FFD700, var(--paypal-gold));
    background: -webkit-linear-gradient(135deg, #FFD700, var(--paypal-gold));
}

.success-message {
    background: linear-gradient(135deg, var(--paypal-gold), #FFD700);
    /* Safari fallback */
    background: -webkit-linear-gradient(135deg, var(--paypal-gold), #FFD700);
    color: var(--paypal-blue);
    padding: 20px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 30px;
}

/* Animations */
@keyframes celebrate {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Новые динамические анимации */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes containerFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes progressShimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

@keyframes progressWave {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

@keyframes floatingParticle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0;
    }
}

/* Плавающие частицы */
.floating-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--paypal-light-blue);
    border-radius: 50%;
    opacity: 0.7;
}

.particle:nth-child(1) {
    left: 10%;
    animation: floatingParticle 15s linear infinite;
    animation-delay: 0s;
    background: var(--paypal-blue);
}

.particle:nth-child(2) {
    left: 20%;
    animation: floatingParticle 18s linear infinite;
    animation-delay: 2s;
    background: var(--paypal-light-blue);
}

.particle:nth-child(3) {
    left: 30%;
    animation: floatingParticle 12s linear infinite;
    animation-delay: 4s;
    background: var(--paypal-gold);
    width: 3px;
    height: 3px;
}

.particle:nth-child(4) {
    left: 50%;
    animation: floatingParticle 20s linear infinite;
    animation-delay: 1s;
    background: var(--paypal-blue);
}

.particle:nth-child(5) {
    left: 60%;
    animation: floatingParticle 16s linear infinite;
    animation-delay: 3s;
    background: var(--paypal-light-blue);
    width: 2px;
    height: 2px;
}

.particle:nth-child(6) {
    left: 70%;
    animation: floatingParticle 14s linear infinite;
    animation-delay: 5s;
    background: var(--paypal-gold);
}

.particle:nth-child(7) {
    left: 80%;
    animation: floatingParticle 22s linear infinite;
    animation-delay: 1.5s;
    background: var(--paypal-blue);
    width: 3px;
    height: 3px;
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 0 20px rgba(0, 48, 135, 0.3);
    }
    100% {
        text-shadow: 0 0 30px rgba(0, 156, 222, 0.6), 0 0 40px rgba(0, 156, 222, 0.3);
    }
}

.particle:nth-child(8) {
    left: 90%;
    animation: floatingParticle 17s linear infinite;
    animation-delay: 6s;
    background: var(--paypal-light-blue);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 30px 20px;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .finished-title {
        font-size: 2.2rem;
    }
    
    .progress-percentage {
        font-size: 1.5rem;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .qr-code {
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .finished-title {
        font-size: 1.8rem;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 10px;
    }
}
