/* PWA-specific styles for NovaInvoice */

/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
}

.pwa-install-prompt.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: white;
}

.pwa-install-icon {
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
}

.pwa-install-text {
    flex: 1;
}

.pwa-install-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.pwa-install-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.pwa-install-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.pwa-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pwa-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* iOS Install Instructions */
.ios-install-instructions {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
}

.ios-install-instructions.show {
    transform: translateY(0);
    opacity: 1;
}

.ios-install-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: white;
}

.ios-install-icon {
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
}

.ios-install-text {
    flex: 1;
}

.ios-install-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.ios-install-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.ios-share-icon {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    margin: 0 4px;
}

.ios-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: 16px;
}

.ios-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* PWA Update Notification */
.pwa-update-notification {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 400px;
    margin: 0 auto;
}

.pwa-update-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-update-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: white;
}

.pwa-update-icon {
    font-size: 24px;
    margin-right: 16px;
    flex-shrink: 0;
    animation: spin 2s linear infinite;
}

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

.pwa-update-text {
    flex: 1;
}

.pwa-update-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.pwa-update-text p {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.pwa-update-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.pwa-update-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pwa-update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* PWA Offline Notification */
.pwa-offline-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    padding: 12px 20px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.pwa-offline-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.pwa-offline-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pwa-offline-icon {
    font-size: 18px;
}

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

.pwa-standalone .sticky-header {
    padding-top: env(safe-area-inset-top);
}

/* Mobile-specific optimizations */
@media (max-width: 768px) {
    .pwa-install-prompt,
    .ios-install-instructions,
    .pwa-update-notification {
        left: 16px;
        right: 16px;
        margin: 0;
    }
    
    .pwa-install-content,
    .ios-install-content,
    .pwa-update-content {
        padding: 14px 16px;
    }
    
    .pwa-install-text h3,
    .ios-install-text h3,
    .pwa-update-text h3 {
        font-size: 15px;
    }
    
    .pwa-install-text p,
    .ios-install-text p,
    .pwa-update-text p {
        font-size: 13px;
    }
    
    .pwa-install-btn,
    .pwa-update-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pwa-close-btn,
    .ios-close-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .pwa-install-btn,
    .pwa-update-btn,
    .pwa-close-btn,
    .ios-close-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .pwa-install-btn,
    .pwa-update-btn {
        padding: 12px 16px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pwa-offline-notification {
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-prompt,
    .ios-install-instructions,
    .pwa-update-notification,
    .pwa-offline-notification {
        transition: opacity 0.1s ease;
    }
    
    .pwa-install-prompt.show,
    .ios-install-instructions.show,
    .pwa-update-notification.show,
    .pwa-offline-notification.show {
        transform: none;
    }
    
    .pwa-update-icon {
        animation: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pwa-install-prompt,
    .ios-install-instructions,
    .pwa-update-notification {
        border: 2px solid white;
    }
    
    .pwa-install-btn,
    .pwa-update-btn {
        border: 2px solid white;
    }
}

/* Focus styles for accessibility */
.pwa-install-btn:focus,
.pwa-update-btn:focus,
.pwa-close-btn:focus,
.ios-close-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* PWA Loading Indicator */
.pwa-loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.pwa-loading-indicator.fade-out {
    opacity: 0;
}

.pwa-loading-content {
    text-align: center;
    color: white;
}

.pwa-loading-spinner {
    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;
    margin: 0 auto 20px;
}

.pwa-loading-text {
    font-size: 18px;
    font-weight: 500;
    color: white;
    opacity: 0.9;
}

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

/* PWA Authentication Styles */
.pwa-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.pwa-auth-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.pwa-auth-logo {
    width: 80px;
    height: 80px;
    background: #4f46e5;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 32px;
    color: white;
}

.pwa-auth-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
}

.pwa-auth-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
}

/* PWA standalone mode login page adjustments */
.pwa-standalone .pwa-auth-container {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Print styles */
@media print {
    .pwa-install-prompt,
    .ios-install-instructions,
    .pwa-update-notification,
    .pwa-offline-notification,
    .pwa-loading-indicator {
        display: none !important;
    }
} 