/**
 * TOURIX Offline Sync UI Styles
 */

/* Offline Banner */
.offline-banner {
    position: fixed;
    top: -50px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10001;
    transition: top 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.offline-banner.visible {
    top: 0;
}

.offline-banner i {
    font-size: 16px;
}

.offline-banner .pending-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

/* Sync Status Notification */
.sync-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.sync-status.visible {
    opacity: 1;
    transform: translateY(0);
}

.sync-status.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.sync-status.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.sync-status.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.sync-status.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* Body adjustment when offline banner is visible */
body.offline-mode {
    padding-top: 40px;
}

/* Sync indicator in header (optional) */
.sync-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.sync-indicator.online {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.sync-indicator.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.sync-indicator.syncing {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.sync-indicator i {
    font-size: 10px;
}

.sync-indicator.syncing i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Pending changes badge */
.pending-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: white;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.pending-badge:empty,
.pending-badge[data-count="0"] {
    display: none;
}

/* Offline data warning */
.offline-data-notice {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #f59e0b;
}

.offline-data-notice i {
    font-size: 18px;
}

.offline-data-notice.hidden {
    display: none;
}
