/**
 * SanLog Offline CSS v3.9.0
 * Styling für Offline-Banner und -Markierungen
 */

/* ==========================================================================
   OFFLINE BANNER
   ========================================================================== */

#offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    
    padding: 12px 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    
    /* Versteckt per Default */
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#offline-banner.visible {
    transform: translateY(0);
    opacity: 1;
}

#offline-banner .offline-icon {
    font-size: 18px;
    animation: pulse 2s ease-in-out infinite;
}

#offline-banner .offline-text {
    font-weight: 400;
}

#offline-banner .offline-text strong {
    font-weight: 600;
}

#offline-banner .offline-count {
    font-size: 12px;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
}

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

/* ==========================================================================
   OFFLINE ENTRY MARKER
   ========================================================================== */

/* Marker für Meldungen im ETB */
.offline-marker {
    display: inline-flex;
    align-items: center;
    margin-right: 6px;
    font-size: 14px;
    animation: offline-pulse 1.5s ease-in-out infinite;
    cursor: help;
}

.offline-marker::after {
    content: 'Wird synchronisiert...';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-left: 8px;
}

.offline-marker:hover::after {
    opacity: 1;
}

@keyframes offline-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.95); }
}

/* Zeile mit Offline-Eintrag */
.log-entry.offline-entry,
.patient-card.offline-entry,
.einsatz-item.offline-entry {
    border-left: 4px solid #e67e22;
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.08) 0%, transparent 100%);
}

/* ==========================================================================
   BODY OFFSET (wenn Banner sichtbar)
   ========================================================================== */

body.offline-banner-visible {
    padding-top: 48px;
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

[data-theme="dark"] #offline-banner {
    background: linear-gradient(135deg, #c0392b, #96281b);
}

[data-theme="dark"] .log-entry.offline-entry,
[data-theme="dark"] .patient-card.offline-entry,
[data-theme="dark"] .einsatz-item.offline-entry {
    background: linear-gradient(90deg, rgba(230, 126, 34, 0.15) 0%, transparent 100%);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 600px) {
    #offline-banner {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    #offline-banner .offline-count {
        display: none;
    }
}
