/* Offline and PWA-specific styles for CyberTech Cyprus */

/* PWA Mode Styles */
.pwa-mode {
    /* Add any PWA-specific styling here */
    --pwa-padding: env(safe-area-inset-top, 0px);
    padding-top: var(--pwa-padding);
}

/* Offline State Styles */
.offline {
    /* Subtle indication that the app is offline */
    position: relative;
}

.offline::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    z-index: 9999;
    animation: offline-pulse 2s ease-in-out infinite;
}

@keyframes offline-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Offline message banner */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    z-index: 9998;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.offline .offline-banner {
    transform: translateY(0);
}

/* PWA Install Button Styles */
.pwa-install-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #4096FF, #1e40af);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(64, 150, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(64, 150, 255, 0.4);
}

.pwa-install-btn::before {
    content: '📱';
    font-size: 16px;
}

/* Update notification styles */
.update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-left: 4px solid #B87333;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    z-index: 1001;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.update-notification h4 {
    margin: 0 0 8px 0;
    font-weight: 600;
    color: #B87333;
}

.update-notification p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.update-notification .actions {
    display: flex;
    gap: 8px;
}

.update-notification button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-notification .btn-primary {
    background: #4096FF;
    color: white;
}

.update-notification .btn-primary:hover {
    background: #1e40af;
}

.update-notification .btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.update-notification .btn-secondary:hover {
    background: #d1d5db;
}

/* Loading states for offline content */
.loading-offline {
    position: relative;
    opacity: 0.7;
}

.loading-offline::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent
    );
    animation: loading-shimmer 1.5s infinite;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive adjustments for mobile PWA */
@media (max-width: 768px) {
    .pwa-install-btn {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 13px;
    }

    .update-notification {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
    }

    .offline-banner {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* Dark mode support (if implemented) */
@media (prefers-color-scheme: dark) {
    .update-notification {
        background: #1f2937;
        color: white;
        border-left-color: #B87333;
    }

    .update-notification h4 {
        color: #B87333;
    }

    .update-notification p {
        color: #d1d5db;
    }

    .update-notification .btn-secondary {
        background: #374151;
        color: #d1d5db;
    }

    .update-notification .btn-secondary:hover {
        background: #4b5563;
    }
}

/* Safe area adjustments for mobile devices */
@supports (padding: env(safe-area-inset-top)) {
    .pwa-mode .offline-banner {
        padding-top: calc(8px + env(safe-area-inset-top));
    }

    .pwa-mode .update-notification {
        top: calc(20px + env(safe-area-inset-top));
    }
}

/* Print styles (hide PWA elements when printing) */
@media print {
    .pwa-install-btn,
    .update-notification,
    .offline-banner,
    .offline::before {
        display: none !important;
    }
}