/**
 * Telegram PWA Promo Styles
 * Стили для промо-баннера установки PWA в Telegram
 */

/* Промо-баннер */
.telegram-pwa-promo {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    border-radius: 24px 24px 0 0;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 600px;
    margin: 0 auto;
}

.telegram-pwa-promo.visible {
    bottom: 0;
}

.telegram-pwa-promo-content {
    padding: 24px 20px 20px;
    position: relative;
}

/* Кнопка закрытия */
.telegram-pwa-promo-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.telegram-pwa-promo-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Заголовок */
.telegram-pwa-promo-header {
    text-align: center;
    margin-bottom: 20px;
}

.telegram-pwa-promo-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.telegram-pwa-promo-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.telegram-pwa-promo-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Преимущества */
.telegram-pwa-promo-benefits {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    gap: 12px;
}

.promo-benefit {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    font-size: 13px;
    gap: 6px;
}

.benefit-icon {
    font-size: 24px;
}

/* Кнопки */
.telegram-pwa-promo-button {
    width: 100%;
    padding: 14px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.telegram-pwa-promo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.telegram-pwa-promo-button-secondary {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.telegram-pwa-promo-button-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Модальное окно с инструкциями */
.telegram-pwa-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto; /* Скролл для всей модалки */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

.telegram-pwa-instructions-modal.visible {
    opacity: 1;
}

.telegram-pwa-instructions-content {
    background: white;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: none; /* Убираем ограничение высоты */
    position: relative;
    animation: slideUp 0.3s ease-out;
    margin: auto; /* Центрирование */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.telegram-pwa-instructions-content h2 {
    margin: 0;
    padding: 24px 24px 20px;
    font-size: 24px;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
}

/* Кнопка закрытия инструкций */
.telegram-pwa-instructions-close {
    position: absolute;
    top: 24px;
    right: 20px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1;
}

.telegram-pwa-instructions-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

/* Вкладки */
.telegram-pwa-instructions-tabs {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.instructions-tab {
    flex: 1;
    padding: 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.instructions-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.instructions-tab:hover:not(.active) {
    background: #e0e0e0;
}

/* Панели с инструкциями */
.instructions-panel {
    display: none;
    padding: 24px;
}

.instructions-panel.active {
    display: block;
}

/* Шаги */
.instruction-step {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.instruction-step:last-of-type {
    margin-bottom: 20px;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    color: #333;
    font-size: 16px;
    margin-bottom: 6px;
}

.step-content p {
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* Заметка */
.instruction-note {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
}

.instruction-note strong {
    color: #f57c00;
}

/* Футер */
.instructions-footer {
    padding: 0 24px 24px;
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.instructions-link-button {
    display: block;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.instructions-link-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .telegram-pwa-instructions-content {
        background: #1e1e1e;
    }
    
    .telegram-pwa-instructions-content h2 {
        color: #fff;
        border-bottom-color: #333;
    }
    
    .telegram-pwa-instructions-tabs {
        border-bottom-color: #333;
    }
    
    .instructions-tab {
        background: #2a2a2a;
        color: #bbb;
    }
    
    .instructions-tab:hover:not(.active) {
        background: #333;
    }
    
    .step-content strong {
        color: #fff;
    }
    
    .step-content p {
        color: #bbb;
    }
    
    .instruction-note {
        background: rgba(255, 193, 7, 0.15);
        color: #bbb;
    }
    
    .instructions-footer {
        border-top-color: #333;
    }
    
    .telegram-pwa-instructions-close {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .telegram-pwa-instructions-close:hover {
        background: rgba(255, 255, 255, 0.2);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .telegram-pwa-promo-benefits {
        flex-direction: column;
        gap: 8px;
    }
    
    .promo-benefit {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        gap: 12px;
    }
    
    .telegram-pwa-instructions-modal {
        padding: 0;
        align-items: flex-end;
    }
    
    .telegram-pwa-instructions-content {
        max-width: none;
        border-radius: 24px 24px 0 0;
        max-height: 95vh;
    }
}

/* Блокировка скролла body при открытой модалке */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Скрываем в PWA режиме */
.standalone-mode .telegram-pwa-promo {
    display: none !important;
}

.standalone-mode .telegram-pwa-instructions-modal {
    display: none !important;
}

