/* NutriTrack PWA Styles */

/* PWA Banners */
.pwa-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pwa-banner.show {
    transform: translateY(0);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
}

.pwa-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

.pwa-banner-text strong {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.pwa-banner-text small {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.2rem;
}

.pwa-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Install Banner */
.install-banner {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.install-banner .btn-primary {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
}

.install-banner .btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.install-banner .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
    line-height: 1;
}

.install-banner .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Offline Banner */
.offline-banner {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.offline-banner .btn-outline-light {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
}

.offline-banner .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Update Banner */
.update-banner {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.update-banner .btn-success {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-weight: 600;
}

.update-banner .btn-success:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Toast Notifications */
.pwa-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    max-width: 400px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.4;
}

.pwa-toast.show {
    transform: translateX(0);
}

/* Toast Types */
.pwa-toast-success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.pwa-toast-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pwa-toast-warning {
    background: rgba(245, 158, 11, 0.9);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.pwa-toast-info {
    background: rgba(6, 182, 212, 0.9);
    color: white;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

/* PWA-specific UI improvements */

/* Install button in navigation */
.nav-install-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.nav-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.nav-install-btn i {
    margin-right: 0.3rem;
    font-size: 0.9rem;
}

/* Offline indicator */
.offline-indicator {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: rgba(245, 158, 11, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
}

.offline-indicator.show {
    display: block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* PWA-optimized form styles */
.pwa-form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.pwa-form-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.05);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pwa-form-input:focus {
    outline: none;
    border-color: #06b6d4;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
    background: rgba(248, 250, 252, 0.1);
}

.pwa-form-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent 0%, transparent 40%, var(--background-primary) 50%, var(--background-primary) 100%);
    padding: 0 0.2rem;
}

.pwa-form-input:focus + .pwa-form-label,
.pwa-form-input:not(:placeholder-shown) + .pwa-form-label {
    top: -0.5rem;
    left: 0.8rem;
    font-size: 0.85rem;
    color: #06b6d4;
    font-weight: 600;
}

/* Quick action buttons */
.pwa-quick-actions {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 1rem;
    z-index: 1000;
    padding: 0.5rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(6, 182, 212, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.pwa-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.pwa-quick-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.4);
    color: white;
    text-decoration: none;
}

.pwa-quick-action i {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .pwa-banner-content {
        padding: 0.8rem 1rem;
        gap: 0.8rem;
    }
    
    .pwa-banner-text strong {
        font-size: 0.9rem;
    }
    
    .pwa-banner-text small {
        font-size: 0.8rem;
    }
    
    .pwa-toast {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .pwa-quick-actions {
        bottom: 1rem;
        gap: 0.5rem;
        padding: 0.3rem;
    }
    
    .pwa-quick-action {
        width: 50px;
        height: 50px;
        font-size: 0.65rem;
    }
    
    .pwa-quick-action i {
        font-size: 1rem;
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .pwa-form-input {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
}

[data-theme="dark"] .pwa-form-input:focus {
    background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .pwa-form-label {
    background: linear-gradient(to bottom, transparent 0%, transparent 40%, #0f172a 50%, #0f172a 100%);
}

/* Light theme adjustments */
[data-theme="light"] .pwa-form-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.3);
    color: #0f172a;
}

[data-theme="light"] .pwa-form-input:focus {
    background: rgba(255, 255, 255, 1);
}

[data-theme="light"] .pwa-form-label {
    background: linear-gradient(to bottom, transparent 0%, transparent 40%, #ffffff 50%, #ffffff 100%);
}

[data-theme="light"] .pwa-quick-actions {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(6, 182, 212, 0.3);
}

/* PWA splash screen styles */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    color: white;
}

.pwa-splash-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

.pwa-splash-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #06b6d4;
}

.pwa-splash-subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.pwa-splash-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top: 3px solid #06b6d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide splash screen */
.pwa-splash.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}