/* =============================================
   Tantra Legendarios — PWA Native CSS v1.0
   Styles for install banner, update toast, 
   offline bar, notification modal, bottom nav,
   and standalone-mode enhancements
   ============================================= */

/* === INSTALL BANNER === */
.pwa-install-banner {
    position: fixed;
    bottom: -120px;
    left: 0;
    right: 0;
    z-index: 100000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pwa-install-banner.pwa-banner-visible {
    transform: translateY(-120px);
}
.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto 10px;
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 16px;
    box-shadow: 0 -5px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 243, 255, 0.15);
}
.pwa-banner-icon img {
    border-radius: 12px;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
}
.pwa-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pwa-banner-text strong {
    color: #f8fafc;
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 700;
}
.pwa-banner-text span {
    color: #64748b;
    font-size: 12px;
}
.pwa-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pwa-btn-install {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0ea5e9, #00f0ff);
    color: #030712;
    border: none;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    white-space: nowrap;
}
.pwa-btn-install:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}
.pwa-btn-dismiss {
    background: none;
    border: none;
    color: #475569;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
}
.pwa-btn-dismiss:hover {
    color: #94a3b8;
}

/* === UPDATE TOAST === */
.pwa-update-toast {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.15);
    color: #f8fafc;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}
.pwa-update-toast.pwa-toast-visible {
    transform: translateX(-50%) translateY(75px);
}
.pwa-btn-update {
    padding: 6px 16px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #030712;
    border: none;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
}
.pwa-btn-update:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

/* === OFFLINE BAR === */
.pwa-offline-bar {
    position: fixed;
    top: -40px;
    left: 0;
    right: 0;
    z-index: 100002;
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: transform 0.4s ease;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}
.pwa-offline-bar.pwa-offline-visible {
    transform: translateY(40px);
}

/* === NOTIFICATION MODAL === */
.pwa-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 100003;
    background: rgba(3, 7, 18, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}
.pwa-modal-overlay.pwa-modal-visible {
    opacity: 1;
}
.pwa-modal {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(0, 243, 255, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 243, 255, 0.1);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.pwa-modal-visible .pwa-modal {
    transform: scale(1) translateY(0);
}
.pwa-modal-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: pwa-bell-ring 1s ease-in-out;
}
@keyframes pwa-bell-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(15deg); }
    30% { transform: rotate(-15deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    75% { transform: rotate(5deg); }
}
.pwa-modal h3 {
    color: #f8fafc;
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    margin-bottom: 10px;
}
.pwa-modal p {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.pwa-modal-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 25px;
    text-align: left;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.pwa-modal-categories label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 0;
    margin: 0;
}
.pwa-modal-categories input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00f0ff;
    cursor: pointer;
}
.pwa-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.pwa-btn-enable {
    padding: 12px 30px;
    background: linear-gradient(135deg, #0ea5e9, #00f0ff);
    color: #030712;
    border: none;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
}
.pwa-btn-enable:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.5);
}
.pwa-btn-later {
    padding: 12px 20px;
    background: transparent;
    color: #64748b;
    border: 1px solid #334155;
    border-radius: 12px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.pwa-btn-later:hover {
    color: #94a3b8;
    border-color: #475569;
}

/* === BOTTOM NAVIGATION (Standalone mode) === */
.pwa-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 65px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 243, 255, 0.15);
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
}
.pwa-bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #64748b;
    text-decoration: none;
    font-size: 11px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    transition: color 0.2s;
    padding: 8px 12px;
    border-radius: 10px;
}
.pwa-bnav-item:hover,
.pwa-bnav-item.pwa-bnav-active {
    color: #00f0ff;
}
.pwa-bnav-item.pwa-bnav-active {
    background: rgba(0, 243, 255, 0.08);
}
.pwa-bnav-icon {
    font-size: 22px;
    line-height: 1;
}

/* === PULL TO REFRESH === */
.pwa-pull-indicator {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-60px);
    z-index: 99998;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 50%;
    border: 1px solid rgba(0, 243, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s, transform 0.3s;
}
.pwa-pull-spinner {
    font-size: 20px;
    color: #00f0ff;
    animation: pwa-spin 1s linear infinite;
}
@keyframes pwa-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === NAV INSTALL BUTTON PULSE === */
@keyframes pwa-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; text-shadow: 0 0 10px rgba(0, 243, 255, 0.8); }
}

/* === SAFE AREA INSETS (iPhone notch/Dynamic Island) === */
.pwa-standalone body {
    padding-top: env(safe-area-inset-top, 0);
}
.pwa-standalone .navbar,
.pwa-standalone .global-nav {
    padding-top: calc(env(safe-area-inset-top, 0) + 10px);
}
.pwa-standalone .pwa-bottom-nav {
    height: calc(65px + env(safe-area-inset-bottom, 0));
}

/* === RESPONSIVE === */
@media (max-width: 480px) {
    .pwa-banner-content {
        margin: 0 10px 10px;
        padding: 12px 15px;
        gap: 10px;
    }
    .pwa-banner-text strong { font-size: 13px; }
    .pwa-btn-install { padding: 8px 16px; font-size: 12px; }
    .pwa-modal { padding: 25px 20px; }
    .pwa-modal h3 { font-size: 16px; }
    .pwa-bnav-item { font-size: 10px; }
    .pwa-bnav-icon { font-size: 20px; }
}

/* === HIDE IN NON-STANDALONE === */
body:not(.pwa-standalone) .pwa-bottom-nav {
    display: none;
}

/* === SPLASH SCREEN ANIMATION === */
@keyframes pwa-glow-pulse {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(0, 243, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.8)); }
}
