/* =====================================================
   CARDGIFT - CARD VIEWER PAGE STYLES
   Стили страницы просмотра открыток
   ===================================================== */

/* ===== ГЛОБАЛЬНЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

/* ===== АНИМИРОВАННЫЙ ФОН ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: backgroundShift 10s ease infinite;
}

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

/* ===== ЯЗЫКОВОЙ ПЕРЕКЛЮЧАТЕЛЬ ===== */
.language-switcher {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 1000;
    display: flex;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    padding: 3px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lang-btn {
    background: transparent;
    border: none;
    color: #FFD700;
    padding: 6px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    transition: all 0.3s ease;
    min-width: 28px;
}

.lang-btn.active {
    background: rgba(255, 215, 0, 0.3);
    color: #FFF;
    transform: scale(1.05);
}

.lang-btn:hover:not(.active) {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.02);
}

/* ===== ОСНОВНОЙ КОНТЕЙНЕР ===== */
.mobile-container {
    max-width: 400px;
    width: 90vw;
    height: 80vh;
    min-height: 600px;
    margin: 5vh auto;
    background: #000;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 
        0 30px 80px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.1),
        0 0 50px rgba(255, 215, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== СТАТУС БАР ===== */
.status-bar {
    height: 28px;
    background: rgba(0,0,0,0.95);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 18px;
    font-size: 12px;
    color: #FFF;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.status-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: 'SF Pro Display', -apple-system, sans-serif;
}

/* ===== БЕГУЩАЯ СТРОКА ===== */
.top-marquee {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    height: 36px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: none;
    align-items: center;
    font-weight: bold;
    font-size: 12px;
    position: relative;
}

.top-marquee.show {
    display: flex;
    animation: slideDown 0.5s ease forwards;
}

.top-marquee:hover {
    background: linear-gradient(45deg, #FFE55C, #FFB700);
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.marquee-content {
    animation: marqueeMove 20s linear infinite;
    white-space: nowrap;
    padding-left: 100%;
    font-weight: 700;
}

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

@keyframes slideDown {
    0% { transform: translateY(-100%); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ===== ОСНОВНАЯ ОБЛАСТЬ КАРТЫ ===== */
.card-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: all 0.5s ease;
}

/* ===== ВИДЕО КОНТЕЙНЕРЫ ===== */
.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    background: #000;
    border-radius: inherit;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: all;
    border-radius: inherit;
}

/* ===== КНОПКА ЗВУКА ===== */
.sound-control-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.9);
    color: #FFD700;
    border: 2px solid #FFD700;
    padding: 10px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.sound-control-btn:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.3);
}

/* ===== КОНТЕНТ ПОВЕРХ ===== */
.card-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 25px 80px 25px;
    text-align: center;
    pointer-events: none;
}

.card-content > * {
    pointer-events: auto;
}

/* ===== ТИПОГРАФИКА ===== */
.card-title {
    color: #FFFFFF;
    font-size: 26px;
    font-weight: 800;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        0 0 20px rgba(0,0,0,1),
        0 0 35px rgba(0,0,0,0.8);
    margin-bottom: 18px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.5s forwards;
    position: relative;
    z-index: 11;
    line-height: 1.2;
}

.card-subtitle {
    color: #FFD700;
    font-size: 18px;
    font-weight: 700;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        0 0 20px rgba(0,0,0,1),
        0 0 35px rgba(0,0,0,0.8);
    margin-bottom: 25px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.8s forwards;
    position: relative;
    z-index: 11;
    line-height: 1.3;
}

.greeting-text {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 
        -3px -3px 0 #000,
        3px -3px 0 #000,
        -3px 3px 0 #000,
        3px 3px 0 #000,
        -2px 0 0 #000,
        2px 0 0 #000,
        0 -2px 0 #000,
        0 2px 0 #000,
        0 0 20px rgba(0,0,0,1),
        0 0 35px rgba(0,0,0,0.8);
    line-height: 1.5;
    opacity: 0;
    animation: fadeInUp 1s ease 1.1s forwards;
    max-width: 320px;
    position: relative;
    z-index: 11;
}

/* ===== НИЖНЯЯ ОБЛАСТЬ ===== */
.bottom-area {
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.8) 0%,
        rgba(0,0,0,0.95) 100%
    );
    padding: 20px;
    z-index: 3;
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ===== CTA СЕКЦИЯ ===== */
.cta-section {
    text-align: center;
    margin-bottom: 18px;
    display: none;
    animation: fadeInUp 0.6s ease forwards;
}

.cta-section.show {
    display: block;
}

.cta-text {
    color: #FFFFFF;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.cta-subtitle {
    color: #FFD700;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.9;
}

/* ===== КНОПКА ДЕЙСТВИЯ ===== */
.action-button {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-bottom: 12px;
    display: none;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.action-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.action-button:hover::before {
    left: 100%;
}

.action-button.show {
    display: block;
    animation: bounceIn 0.6s ease forwards;
}

.action-button:hover {
    background: linear-gradient(45deg, #FFE55C, #FFB700);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.action-button:active {
    transform: translateY(0) scale(0.98);
}

/* ===== НИЖНИЙ БАННЕР ===== */
.bottom-banner {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 12px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(100%);
    display: none;
    box-shadow: 0 -4px 20px rgba(255, 215, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.bottom-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.7s ease;
}

.bottom-banner:hover::before {
    left: 100%;
}

.bottom-banner.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideUpBanner 0.6s ease forwards;
}

.bottom-banner:hover {
    background: linear-gradient(45deg, #FFE55C, #FFB700);
    transform: translateY(-1px);
    box-shadow: 0 -6px 25px rgba(255, 215, 0, 0.3);
}

/* ===== СТИЛИ ФОНОВ ===== */
.style-classic {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.style-sunset {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #ffd89b 100%);
}

.style-ocean {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.style-space {
    background: linear-gradient(135deg, #0c0c0c 0%, #000000 100%);
    position: relative;
}

.style-space::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #FFD700, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 215, 0, 0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #FFD700, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 160px 30px, #FFD700, transparent);
    background-repeat: repeat;
    background-size: 250px 150px;
    animation: sparkle 4s ease-in-out infinite;
    z-index: 1;
}

/* ===== NEON СТИЛЬ ===== */
.style-neon {
    background: linear-gradient(45deg, #FF006E, #8338EC, #3A86FF);
    background-size: 400% 400%;
    animation: neonGradient 4s ease infinite;
    position: relative;
}

.style-neon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(255, 0, 110, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(131, 56, 236, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(58, 134, 255, 0.2) 0%, transparent 50%);
    animation: neonPulse 3s ease-in-out infinite;
    z-index: 1;
}

.style-neon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: neonSweep 6s linear infinite;
    z-index: 2;
}

/* ===== АНИМАЦИИ ===== */
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) translateY(50px); }
    50% { opacity: 1; transform: scale(1.05) translateY(-10px); }
    70% { transform: scale(0.9) translateY(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpBanner {
    0% { opacity: 0; transform: translateY(100%); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes sparkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

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

@keyframes neonPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes neonSweep {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(400%) rotate(45deg); }
}

/* ===== ЭКРАНЫ ЗАГРУЗКИ И ОШИБОК ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #FFD700;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 215, 0, 0.3);
    border-top: 5px solid #FFD700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

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

.error-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    z-index: 9999;
}

.error-icon {
    font-size: 80px;
    margin-bottom: 25px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error-title {
    color: #FFD700;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 18px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.error-text {
    color: #FFFFFF;
    font-size: 18px;
    margin-bottom: 35px;
    line-height: 1.6;
    max-width: 400px;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.error-button {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    border: none;
    padding: 18px 35px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.error-button:hover {
    background: linear-gradient(45deg, #FFE55C, #FFB700);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

/* ===== ИНДИКАТОР УРОВНЯ ПОЛЬЗОВАТЕЛЯ ===== */
.user-level-indicator {
    position: absolute;
    top: 40px;
    left: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: #FFD700;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    z-index: 15;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ===== ВИДЕО С КОНТЕНТОМ ===== */
.card-area.has-video .card-content {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    margin: 20px;
    padding-top: 60px;
    padding-bottom: 60px;
}

/* ===== СКРЫТИЕ ЭЛЕМЕНТОВ ===== */
.hidden {
    display: none !important;
}

/* ===== МОБИЛЬНАЯ ОПТИМИЗАЦИЯ ===== */
@media (max-width: 480px) {
    .mobile-container {
        width: 95vw;
        height: 85vh;
        margin: 2.5vh auto;
        border-radius: 25px;
    }
    
    .card-content {
        padding: 50px 20px 50px 20px;
    }
    
    .card-title {
        font-size: 22px;
    }
    
    .card-subtitle {
        font-size: 16px;
    }
    
    .greeting-text {
        font-size: 14px;
        max-width: 280px;
    }

    .video-container {
        border-radius: 0;
    }
    
    .sound-control-btn {
        top: 12px;
        right: 12px;
        padding: 8px 12px;
        font-size: 11px;
    }

    .action-button {
        padding: 12px 25px;
        font-size: 14px;
    }

    .bottom-area {
        padding: 15px;
    }

    .language-switcher {
        top: 5px;
        right: 5px;
        padding: 2px;
    }

    .lang-btn {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 24px;
    }
}

@media (max-width: 360px) {
    .mobile-container {
        width: 98vw;
        height: 90vh;
        margin: 1vh auto;
    }

    .card-title {
        font-size: 20px;
    }

    .card-subtitle {
        font-size: 14px;
    }

    .greeting-text {
        font-size: 13px;
    }
}

/* ===== ТЕМНЫЙ РЕЖИМ ===== */
@media (prefers-color-scheme: dark) {
    .loading-screen,
    .error-screen {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
}

/* ===== КОНТЕЙНЕР УВЕДОМЛЕНИЙ ===== */
#cardNotificationContainer {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10001;
    pointer-events: none;
    max-width: 90vw;
}

.card-notification {
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #333;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    cursor: pointer;
    font-size: 14px;
}

.card-notification.success {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.card-notification.error {
    border-color: #f44336;
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.card-notification.warning {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.card-notification.info {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

/* ===== ИНДИКАТОР ЗАГРУЗКИ ВИДЕО ===== */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: #FFD700;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    z-index: 10;
    font-weight: bold;
    transition: opacity 0.3s ease;
}

/* ===== ОШИБКА ВИДЕО ===== */
.video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 68, 68, 0.9);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    z-index: 10;
    font-weight: bold;
    max-width: 80%;
    backdrop-filter: blur(10px);
}
