/* ============================================
   Glory2YahPub - PWA Install Styles
   Premium glassmorphism design
   Uses unified design system from variables.css
   ============================================ */

/* ===== PWA INSTALL POPUP ===== */
.pwa-popup-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--g2y-z-toast);
    display: none;
    align-items: flex-end;
    justify-content: center;
    font-family: var(--g2y-font);
}

.pwa-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--g2y-overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: g2y-fadeIn 0.3s ease;
}

.pwa-popup-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px 24px 24px 24px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 32px 24px 24px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: pwaSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.pwa-popup-visible .pwa-popup-container {
    transform: translateY(0);
}

/* ===== POPUP HEADER ===== */
.pwa-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.pwa-popup-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-popup-logo-img {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--g2y-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 35, 102, 0.3);
    flex-shrink: 0;
}

.pwa-popup-logo-img span {
    font-size: 28px;
    font-weight: 800;
    background: var(--g2y-gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pwa-popup-logo-text {
    display: flex;
    flex-direction: column;
}

.pwa-popup-logo-text h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--g2y-primary);
    margin: 0;
    line-height: 1.2;
}

.pwa-popup-logo-text span {
    font-size: 12px;
    color: var(--g2y-primary-light);
    font-weight: 500;
}

.pwa-popup-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--g2y-text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--g2y-transition-fast);
    flex-shrink: 0;
}

.pwa-popup-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

/* ===== POPUP BODY ===== */
.pwa-popup-body {
    text-align: center;
    margin-bottom: 24px;
}

.pwa-popup-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--g2y-primary);
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.pwa-popup-description {
    font-size: 15px;
    color: var(--g2y-text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.pwa-popup-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 16px 0;
}

.pwa-popup-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(0, 35, 102, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--g2y-primary);
    font-weight: 500;
}

.pwa-popup-feature span {
    font-size: 16px;
}

/* ===== POPUP ACTIONS ===== */
.pwa-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-popup-install-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    background: var(--g2y-gradient-primary);
    color: white;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--g2y-transition);
    box-shadow: 0 4px 20px rgba(0, 35, 102, 0.3);
    position: relative;
    overflow: hidden;
}

.pwa-popup-install-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    transition: left 0.5s ease;
}

.pwa-popup-install-btn:hover::before {
    left: 100%;
}

.pwa-popup-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 35, 102, 0.4);
}

.pwa-popup-install-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 12px rgba(0, 35, 102, 0.3);
}

.pwa-popup-install-btn .pwa-btn-icon {
    font-size: 20px;
}

.pwa-popup-dismiss-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--g2y-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--g2y-transition-fast);
}

.pwa-popup-dismiss-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--g2y-primary);
}

/* ===== iOS GUIDE POPUP ===== */
.pwa-ios-guide-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--g2y-z-toast);
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--g2y-font);
}

.pwa-ios-guide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: g2y-fadeIn 0.3s ease;
}

.pwa-ios-guide-container {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 20px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    padding: 32px 24px 24px;
    animation: g2y-scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.pwa-ios-guide-header {
    text-align: center;
    margin-bottom: 24px;
}

.pwa-ios-guide-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--g2y-gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 20px rgba(0, 35, 102, 0.3);
}

.pwa-ios-guide-icon span {
    font-size: 36px;
    font-weight: 800;
    background: var(--g2y-gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pwa-ios-guide-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--g2y-primary);
    margin: 0;
}

.pwa-ios-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.pwa-ios-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(0, 35, 102, 0.03) 0%, rgba(102, 126, 234, 0.03) 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 35, 102, 0.06);
}

.pwa-ios-guide-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--g2y-gradient-primary);
    color: white;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-ios-guide-step-content {
    flex: 1;
}

.pwa-ios-guide-step-content p {
    margin: 0;
    font-size: 14px;
    color: var(--g2y-text);
    line-height: 1.5;
}

.pwa-ios-guide-step-content .pwa-step-highlight {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 35, 102, 0.08);
    padding: 2px 10px;
    border-radius: 6px;
    font-weight: 600;
    color: var(--g2y-primary);
    font-size: 13px;
}

.pwa-ios-guide-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-ios-close-btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 16px;
    background: var(--g2y-gradient-primary);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--g2y-transition);
    box-shadow: 0 4px 20px rgba(0, 35, 102, 0.3);
}

.pwa-ios-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 35, 102, 0.4);
}

.pwa-ios-dismiss-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--g2y-text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--g2y-transition-fast);
}

.pwa-ios-dismiss-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--g2y-primary);
}

/* ===== ANIMATIONS ===== */
@keyframes pwaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pwaSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pwaScaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pwaShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* ===== DARK MODE SUPPORT ===== */
.dark-mode .pwa-popup-container {
    background: rgba(28, 28, 30, 0.95);
    border-color: rgba(255, 215, 0, 0.15);
}

.dark-mode .pwa-popup-logo-text h2 {
    color: var(--g2y-gold);
}

.dark-mode .pwa-popup-logo-text span {
    color: var(--g2y-primary-light);
}

.dark-mode .pwa-popup-close {
    background: rgba(255, 255, 255, 0.1);
    color: var(--g2y-text-muted);
}

.dark-mode .pwa-popup-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.dark-mode .pwa-popup-title {
    color: var(--g2y-gold);
}

.dark-mode .pwa-popup-description {
    color: var(--g2y-text-muted);
}

.dark-mode .pwa-popup-feature {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(102, 126, 234, 0.1) 100%);
    color: var(--g2y-gold);
}

.dark-mode .pwa-popup-dismiss-btn {
    color: var(--g2y-text-muted);
}

.dark-mode .pwa-popup-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--g2y-gold);
}

.dark-mode .pwa-ios-guide-container {
    background: rgba(28, 28, 30, 0.98);
}

.dark-mode .pwa-ios-guide-title {
    color: var(--g2y-gold);
}

.dark-mode .pwa-ios-guide-step {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05) 0%, rgba(102, 126, 234, 0.05) 100%);
    border-color: rgba(255, 215, 0, 0.1);
}

.dark-mode .pwa-ios-guide-step-content p {
    color: var(--g2y-text);
}

.dark-mode .pwa-ios-guide-step-content .pwa-step-highlight {
    background: rgba(255, 215, 0, 0.15);
    color: var(--g2y-gold);
}

.dark-mode .pwa-ios-dismiss-btn {
    color: var(--g2y-text-muted);
}

.dark-mode .pwa-ios-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--g2y-gold);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .pwa-popup-container {
        margin: 12px;
        padding: 24px 20px 20px;
        border-radius: 20px;
    }

    .pwa-popup-logo-img {
        width: 48px;
        height: 48px;
    }

    .pwa-popup-logo-img span {
        font-size: 24px;
    }

    .pwa-popup-logo-text h2 {
        font-size: 18px;
    }

    .pwa-popup-title {
        font-size: 20px;
    }

    .pwa-popup-description {
        font-size: 14px;
    }

    .pwa-popup-features {
        gap: 6px;
    }

    .pwa-popup-feature {
        font-size: 12px;
        padding: 4px 12px;
    }

    .pwa-popup-install-btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .pwa-ios-guide-container {
        margin: 12px;
        padding: 24px 20px 20px;
    }

    .pwa-ios-guide-icon {
        width: 60px;
        height: 60px;
    }

    .pwa-ios-guide-icon span {
        font-size: 30px;
    }

    .pwa-ios-guide-title {
        font-size: 18px;
    }

    .pwa-ios-guide-step {
        padding: 12px;
    }

    .pwa-ios-guide-step-content p {
        font-size: 13px;
    }
}

@media (max-width: 360px) {
    .pwa-popup-container {
        margin: 8px;
        padding: 20px 16px 16px;
    }

    .pwa-popup-logo-img {
        width: 40px;
        height: 40px;
    }

    .pwa-popup-logo-img span {
        font-size: 20px;
    }

    .pwa-popup-title {
        font-size: 18px;
    }

    .pwa-popup-description {
        font-size: 13px;
    }

    .pwa-popup-feature {
        font-size: 11px;
        padding: 3px 10px;
    }
}

/* ===== SAFE AREA SUPPORT ===== */
@supports (padding: max(0px)) {
    .pwa-popup-container {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }

    .pwa-ios-guide-container {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}