/**
 * Network Status Indicator Styles for Rehoboth Engineers PWA
 * Provides visual cues for online/offline status and cache vs live content
 */

/* Network Status Indicator */
#network-status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Khula', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 2147483647;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#network-status-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Connection Status Badge */
#connection-status-badge {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Khula', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 2147483646;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

#connection-status-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Status Colors */
.status-online {
    border-color: #00a651 !important;
    color: #00a651 !important;
}

.status-offline {
    border-color: #f58221 !important;
    color: #f58221 !important;
}

.status-cached {
    border-color: #0A507D !important;
    color: #0A507D !important;
}

/* Status Dot */
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.status-dot.online {
    background: #00a651;
}

.status-dot.offline {
    background: #f58221;
}

.status-dot.cached {
    background: #0A507D;
}

/* Detailed Status Modal */
.network-status-detail {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Khula', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    z-index: 2147483645;
    text-align: center;
    white-space: pre-line;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.network-status-detail.show {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #network-status-indicator {
        top: 10px;
        right: 10px;
        font-size: 11px;
        padding: 6px 12px;
    }
    
    #connection-status-badge {
        bottom: 10px;
        left: 10px;
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .network-status-detail {
        margin: 0 20px;
        padding: 15px 20px;
        font-size: 13px;
    }
}

/* Animation for status changes */
@keyframes statusPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

#connection-status-badge.status-change {
    animation: statusPulse 0.6s ease-in-out;
}

/* Hide indicators when printing */
@media print {
    #network-status-indicator,
    #connection-status-badge,
    .network-status-detail {
        display: none !important;
    }
}

/* Accessibility improvements */
#connection-status-badge:focus {
    outline: 2px solid #0A507D;
    outline-offset: 2px;
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    #network-status-indicator,
    #connection-status-badge {
        background: rgba(0, 0, 0, 0.9);
        color: #fff;
    }
    
    .network-status-detail {
        background: rgba(255, 255, 255, 0.9);
        color: #333;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    #network-status-indicator,
    #connection-status-badge {
        border-width: 3px;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    #network-status-indicator,
    #connection-status-badge,
    .network-status-detail {
        transition: none;
    }
    
    #connection-status-badge.status-change {
        animation: none;
    }
}