/* PWA UI Components Styles */
/* Add this to your css/style.css or create a separate pwa-ui.css */

/* Install Button */
.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: none;
    z-index: 1000;
    transition: all 0.3s ease;
    animation: slideInUp 0.5s ease;
}

.pwa-install-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.pwa-install-btn:active {
    transform: translateY(-1px);
}

.pwa-install-btn::before {
    content: "📱 ";
    margin-right: 8px;
}

.pwa-hidden {
    display: none !important;
}

/* iOS Install Prompt */
.ios-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    animation: slideInUp 0.5s ease;
}

.ios-install-prompt .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
}

.ios-install-prompt h3 {
    margin: 0 0 10px 0;
    color: #1f2937;
    font-size: 18px;
}

.ios-install-prompt p {
    margin: 0 0 15px 0;
    color: #6b7280;
    font-size: 14px;
}

.ios-install-prompt ol {
    margin: 0;
    padding-left: 20px;
    color: #6b7280;
    font-size: 14px;
}

.ios-install-prompt li {
    margin-bottom: 8px;
}

/* Network Status Indicator */
.network-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    z-index: 999;
    transition: all 0.3s ease;
}

.status-online {
    background: #d1fae5;
    color: #065f46;
}

.status-offline {
    background: #fee2e2;
    color: #991b1b;
    animation: pulse 2s infinite;
}

/* Update Available Banner */
.update-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fbbf24;
    color: #78350f;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    z-index: 1001;
    display: none;
    animation: slideInDown 0.5s ease;
}

.update-banner button {
    background: #78350f;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 5px;
    margin-left: 15px;
    cursor: pointer;
    font-weight: 600;
}

.update-banner button:hover {
    background: #451a03;
}

/* Loading Spinner for Offline Actions */
.pwa-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Offline Indicator Badge */
.offline-badge {
    display: inline-block;
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
}

/* File Not Available Indicator */
.file-not-available,
.not-installed {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.file-not-available::after,
.not-installed::after {
    content: "(Not Available)";
    display: inline-block;
    margin-left: 8px;
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
}

.not-installed::after {
    content: "(Not Installed)";
}

.file-not-available:hover,
.not-installed:hover {
    opacity: 0.5;
}

/* Disabled Button State */
button.file-not-available,
button.not-installed,
a.file-not-available,
a.not-installed {
    pointer-events: none;
    background: #e5e7eb !important;
    color: #9ca3af !important;
}

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .pwa-install-btn {
        bottom: 10px;
        right: 10px;
        padding: 12px 20px;
        font-size: 14px;
    }

    .ios-install-prompt {
        padding: 15px;
    }

    .network-status {
        top: 5px;
        right: 5px;
        font-size: 11px;
        padding: 6px 12px;
    }
}

@media (min-width: 768px) {
    .pwa-install-btn {
        bottom: 30px;
        right: 30px;
    }
}

/* Print Styles - Hide PWA UI when printing */
@media print {
    .pwa-install-btn,
    .ios-install-prompt,
    .network-status,
    .update-banner {
        display: none !important;
    }
}
