/* ==================== SYNC INDICATOR ====================
   Life Manager - Senkronizasyon Durumu Göstergesi
   ==================== */

/* Indicator Container */
.sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sync-indicator:hover {
    background: var(--bg-secondary);
}

/* Sync Dot */
.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Online - Yeşil */
.sync-indicator.online .sync-dot {
    background: #4CAF50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
}

/* Offline - Gri */
.sync-indicator.offline .sync-dot {
    background: #9e9e9e;
}

.sync-indicator.offline {
    background: rgba(158, 158, 158, 0.15);
}

/* Syncing - Mavi, animasyonlu */
.sync-indicator.syncing .sync-dot {
    background: var(--primary-color);
    animation: syncPulse 1s ease-in-out infinite;
}

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

/* Pending - Turuncu */
.sync-indicator.pending .sync-dot {
    background: #FF9800;
    animation: pendingBlink 1.5s ease-in-out infinite;
}

@keyframes pendingBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.sync-indicator.pending {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

/* Error - Kırmızı */
.sync-indicator.error .sync-dot {
    background: #f44336;
}

.sync-indicator.error {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

/* Sidebar Footer'da Konumlandırma */
.sidebar-footer .sync-indicator {
    margin-top: 8px;
}

/* Header'da Konumlandırma */
.home-header .sync-indicator {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
}

/* Mobile */
@media (max-width: 768px) {
    .sync-indicator span:not(.sync-dot) {
        display: none;
    }

    .sync-indicator {
        padding: 8px;
        border-radius: 50%;
    }

    .home-header .sync-indicator {
        right: 50px;
    }
}

/* Sync Details Popup */
.sync-details-popup {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    margin-bottom: 8px;
}

.sync-indicator:hover .sync-details-popup {
    opacity: 1;
    visibility: visible;
}

.sync-details-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bg-card);
}

.sync-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.sync-detail-item .value {
    color: var(--text-primary);
    font-weight: 500;
}

.sync-detail-item.last-sync {
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
    padding-top: 8px;
}

/* Manual Sync Button */
.btn-manual-sync {
    width: 100%;
    margin-top: 12px;
    padding: 8px;
    background: var(--primary-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-manual-sync:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-manual-sync:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Dark Mode */
[data-theme="dark"] .sync-details-popup {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .sync-details-popup::after {
    border-top-color: var(--bg-card);
}
