/* PWA Specific Styles for Laxsara Care Healthcare Platform */

/* PWA Standalone Mode Support */
.pwa-standalone {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Online/Offline Status */
.offline {
    filter: grayscale(30%);
    opacity: 0.9;
}

.offline .navbar {
    background: linear-gradient(45deg, #dc3545, #fd7e14) !important;
}

.offline::before {
    content: "⚠️ Offline Mode";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #dc3545;
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 12px;
    z-index: 9999;
}

.online {
    filter: none;
    opacity: 1;
}

/* PWA Install Button */
#pwa-install-btn {
    animation: pulse 2s infinite;
    backdrop-filter: blur(10px);
    border: none;
    box-shadow: 0 8px 32px rgba(13, 110, 253, 0.3);
}

#pwa-install-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(13, 110, 253, 0.4);
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 8px 32px rgba(13, 110, 253, 0.3);
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 12px 40px rgba(13, 110, 253, 0.5);
    }
    100% { 
        transform: scale(1);
        box-shadow: 0 8px 32px rgba(13, 110, 253, 0.3);
    }
}

/* PWA Toast Notifications */
.pwa-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
    min-width: 300px;
    max-width: 400px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pwa-toast.show {
    animation: slideInRight 0.3s ease-out;
}

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

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    .pwa-standalone .container-fluid {
        padding-left: env(safe-area-inset-left, 15px);
        padding-right: env(safe-area-inset-right, 15px);
    }
    
    #pwa-install-btn {
        bottom: env(safe-area-inset-bottom, 20px);
        right: env(safe-area-inset-right, 20px);
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .pwa-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Splash Screen Simulation */
.pwa-splash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.pwa-splash-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: logoFloat 2s ease-in-out infinite;
}

.pwa-splash-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

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

.pwa-splash-loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

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

.pwa-splash.hide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

/* PWA-specific form enhancements */
.pwa-form-enhanced .form-control {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
}

.pwa-form-enhanced .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Share button styling */
.pwa-share-btn {
    background: linear-gradient(45deg, #0d6efd, #0056b3);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.pwa-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3);
    color: white;
}

/* Status indicators */
.connection-status {
    position: fixed;
    top: 60px;
    right: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    z-index: 1050;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.connection-status.online {
    background: rgba(25, 135, 84, 0.9);
    color: white;
}

.connection-status.offline {
    background: rgba(220, 53, 69, 0.9);
    color: white;
}

/* Enhanced touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
    
    .nav-link {
        padding: 12px 16px;
    }
    
    .card .btn {
        padding: 10px 16px;
    }
}