/**
 * PWA Install Banner & Modal Styles
 * Premium design matching iStory theme
 */

/* ===== Install Banner ===== */
.pwa-install-banner {
    position: fixed;
    bottom: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: linear-gradient(135deg, #2c053c 0%, #8b1978 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    padding: 20px;
    z-index: 99999;
    transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
}

.pwa-install-banner.show {
    bottom: 20px;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #ffffff;
}

.pwa-banner-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.pwa-banner-text {
    flex: 1;
}

.pwa-banner-text h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.pwa-banner-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.pwa-banner-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pwa-btn-install {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.pwa-btn-install:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.pwa-btn-close {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pwa-btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===== iOS Instructions Overlay ===== */
.pwa-ios-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.pwa-ios-overlay.show {
    opacity: 1;
}

.pwa-ios-modal {
    background: #ffffff;
    border-radius: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pwa-ios-overlay.show .pwa-ios-modal {
    transform: scale(1);
}

.pwa-ios-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

[dir="rtl"] .pwa-ios-close {
    right: auto;
    left: 15px;
}

.pwa-ios-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.pwa-ios-content {
    padding: 40px 30px 30px;
    text-align: center;
}

.pwa-ios-icon {
    margin-bottom: 20px;
    color: #2c053c;
}

.pwa-ios-content h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #2c053c;
}

.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.pwa-ios-step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 16px;
}

[dir="rtl"] .pwa-ios-step {
    text-align: right;
}

.pwa-step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2c053c 0%, #8b1978 100%);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.pwa-step-content {
    flex: 1;
}

.pwa-share-icon,
.pwa-home-icon {
    display: inline-flex;
    width: 40px;
    height: 40px;
    background: #007aff;
    color: #ffffff;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.pwa-step-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.pwa-ios-arrow {
    text-align: center;
    font-size: 24px;
    color: #2c053c;
    font-weight: bold;
}

.pwa-ios-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: #fff3cd;
    padding: 15px;
    border-radius: 12px;
    border-left: 4px solid #ffc107;
    text-align: left;
}

[dir="rtl"] .pwa-ios-note {
    border-left: none;
    border-right: 4px solid #ffc107;
    text-align: right;
}

.pwa-ios-note svg {
    flex-shrink: 0;
    color: #856404;
}

.pwa-ios-note p {
    margin: 0;
    font-size: 14px;
    color: #856404;
    line-height: 1.5;
}

/* ===== QR Code Modal ===== */
.pwa-qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pwa-qr-modal.show {
    opacity: 1;
}

.pwa-qr-content {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    position: relative;
    max-width: 400px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.pwa-qr-modal.show .pwa-qr-content {
    transform: scale(1);
}

.pwa-qr-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pwa-qr-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.pwa-qr-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #2c053c;
}

#pwa-qrcode {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 16px;
    display: inline-block;
}

#pwa-qrcode img {
    display: block;
    max-width: 100%;
    height: auto;
}

.pwa-qr-content p {
    margin: 20px 0 0 0;
    font-size: 14px;
    color: #666;
}

/* ===== Responsive ===== */
@media (max-width: 576px) {
    .pwa-install-banner {
        width: 95%;
        padding: 15px;
    }
    
    .pwa-banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .pwa-banner-actions {
        width: 100%;
        justify-content: center;
    }
    
    .pwa-btn-install {
        flex: 1;
    }
    
    .pwa-ios-content {
        padding: 30px 20px 20px;
    }
    
    .pwa-ios-content h2 {
        font-size: 20px;
    }
    
    .pwa-ios-step {
        padding: 15px;
    }
    
    .pwa-qr-content {
        padding: 30px 20px;
    }
}

/* ===== Animations ===== */
@keyframes slideUp {
    from {
        bottom: -150px;
    }
    to {
        bottom: 20px;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pwa-btn-install:active {
    animation: pulse 0.3s ease;
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    .pwa-ios-modal {
        background: #1a1a1a;
    }
    
    .pwa-ios-content h2 {
        color: #ffffff;
    }
    
    .pwa-ios-step {
        background: #2a2a2a;
    }
    
    .pwa-step-content p {
        color: #e0e0e0;
    }
    
    #pwa-qrcode {
        background: #2a2a2a;
    }
    
    .pwa-qr-content {
        background: #1a1a1a;
    }
    
    .pwa-qr-content h3 {
        color: #ffffff;
    }
    
    .pwa-qr-content p {
        color: #b0b0b0;
    }
}
