/* HerbalMuzic PWA Styles */

/* PWA Detection Classes - Use main site variables to prevent conflicts */
.pwa-installed {
    /* Styles when PWA is installed */
}

.pwa-web {
    /* Styles when running as web app */
}

.pwa-standalone {
    /* Styles when running in standalone mode */
}

.offline {
    /* Styles when offline */
}

.online {
    /* Styles when online */
}

/* PWA Install Banner */
.pwa-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: slideUp 0.3s ease-out;
    max-width: 500px;
    width: 90%;
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.pwa-banner-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #00b36b);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.3);
}

.pwa-banner-text h4 {
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.pwa-banner-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.pwa-banner-actions .btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.pwa-banner-actions .btn-primary {
    background-color: var(--primary-color);
    color: #000;
    border-color: var(--primary-color);
}

.pwa-banner-actions .btn-primary:hover {
    background-color: #00ff99;
    border-color: #00ff99;
    transform: translateY(-1px);
}

.pwa-banner-actions .btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.2);
}

.pwa-banner-actions .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* PWA Update Notification */
.pwa-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(15, 15, 19, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
    max-width: 350px;
}

.update-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.update-content span {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.update-actions {
    display: flex;
    gap: 8px;
}

.update-actions .btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.update-actions .btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.update-actions .btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.update-actions .btn-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border-color: rgba(255, 255, 255, 0.2);
}

.update-actions .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Offline Indicator */
.offline-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: white;
    padding: 12px 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.offline-indicator i {
    font-size: 16px;
}

/* PWA Status Indicators */
.pwa-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 15, 19, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 100;
    display: none;
}

.pwa-status.installed {
    display: block;
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation Install Button */
#pwa-install-btn-nav {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.1), rgba(0, 179, 107, 0.1));
    color: var(--text-primary);
    backdrop-filter: blur(5px);
}

#pwa-install-btn-nav:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2), rgba(0, 179, 107, 0.2));
    border-color: rgba(0, 255, 136, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

#pwa-install-btn-nav i {
    font-size: 16px;
}

/* PWA-specific responsive adjustments */
@media (max-width: 768px) {
    .pwa-banner {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .pwa-banner-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .pwa-update-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    #pwa-install-btn-nav {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Service Worker Status */
.service-worker-status {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(15, 15, 19, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 100;
    display: none;
}

.service-worker-status.active {
    display: block;
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

/* Cache Management Styles */
.cache-stats {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: rgba(15, 15, 19, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 100;
    display: none;
    max-width: 200px;
}

.cache-stats.active {
    display: block;
}

.cache-stats h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.cache-stats ul {
    margin: 0;
    padding-left: 16px;
}

.cache-stats li {
    margin-bottom: 4px;
}

/* Performance Monitoring Styles */
.performance-metrics {
    position: fixed;
    top: 60px;
    left: 20px;
    background: rgba(15, 15, 19, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 100;
    display: none;
    max-width: 200px;
}

.performance-metrics.active {
    display: block;
}

.performance-metrics h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.performance-metrics .metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.performance-metrics .metric-value {
    font-weight: 600;
    color: #00ff88;
}

/* Accessibility improvements */
.pwa-banner:focus-within,
.pwa-update-notification:focus-within {
    outline: 2px solid #00ff88;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pwa-banner {
        border-color: #fff;
        color: #fff;
    }
    
    .pwa-update-notification {
        border-color: #fff;
        color: #fff;
    }
    
    .offline-indicator {
        background: #ff0000;
        color: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pwa-banner,
    .pwa-update-notification,
    .offline-indicator {
        animation: none;
    }
    
    .pwa-banner-actions .btn,
    .update-actions .btn {
        transition: none;
    }
}

/* Print styles */
@media print {
    .pwa-banner,
    .pwa-update-notification,
    .offline-indicator,
    .pwa-status,
    .service-worker-status,
    .cache-stats,
    .performance-metrics {
        display: none !important;
    }
}