/* =================================
   Indicateur de Synchronisation
   ================================= */

.sync-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #6b7280;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    transition: all 0.3s ease;
    cursor: help;
}

.sync-indicator.online {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.sync-indicator.offline {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.sync-indicator.syncing {
    background: #3b82f6;
    animation: pulse 1.5s ease-in-out infinite;
}

.sync-indicator.synced {
    background: #10b981;
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.4);
}

.sync-indicator.error {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    animation: shake 0.5s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Tooltip au survol */
.sync-indicator::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.sync-indicator:hover::after {
    opacity: 1;
}

/* Panel de statut de sync (optionnel) */
.sync-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-width: 320px;
    z-index: 9998;
    display: none;
}

.sync-panel.visible {
    display: block;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.sync-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.sync-panel-title {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.sync-panel-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.sync-panel-close:hover {
    background: #f3f4f6;
}

.sync-panel-content {
    font-size: 13px;
    color: #4b5563;
}

.sync-status-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.sync-status-row:last-child {
    border-bottom: none;
}

.sync-status-label {
    font-weight: 500;
    color: #6b7280;
}

.sync-status-value {
    color: #111827;
    font-weight: 600;
}

.sync-status-value.online {
    color: #10b981;
}

.sync-status-value.offline {
    color: #f59e0b;
}

.sync-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.sync-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.sync-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.sync-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.sync-btn.primary:hover {
    background: #2563eb;
}

/* Badge de statut mobile */
@media (max-width: 768px) {
    .sync-indicator {
        top: 10px;
        right: 10px;
        width: 12px;
        height: 12px;
    }

    .sync-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}
