/* Sync Progress Modal Styles */

.sync-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.sync-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.sync-header {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 24px;
    border-radius: 16px 16px 0 0;
}

.sync-header h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
}

.sync-body {
    padding: 32px;
}

/* Warning Section */
.sync-warning {
    text-align: center;
}

.warning-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.warning-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #1f2937;
}

.warning-content p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 24px;
}

.warning-details {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    text-align: left;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item svg {
    width: 20px;
    height: 20px;
    color: #10b981;
}

.detail-item.important svg {
    color: #f59e0b;
}

.start-sync-btn {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Progress Section */
.sync-progress {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.progress-section {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: #1f2937;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.waiting {
    background: #e5e7eb;
    color: #6b7280;
}

.status-badge.in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.status-badge.completed {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.running {
    background: #dcfce7;
    color: #166534;
}

.progress-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #6b7280;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.indeterminate {
    width: 100% !important;
    background: linear-gradient(90deg, #e5e7eb 0%, #6366f1 50%, #e5e7eb 100%);
    background-size: 200% 100%;
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.progress-time {
    font-size: 12px;
    color: #9ca3af;
}

.realtime-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
    color: #6b7280;
}

/* Overall Status */
.overall-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
}

.status-message {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.status-message svg {
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Completion Section */
.sync-complete {
    text-align: center;
    padding: 40px 0;
}

.complete-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.sync-complete h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #1f2937;
}

.sync-complete p {
    color: #6b7280;
    margin-bottom: 32px;
}

.complete-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.stat-item {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #6366f1;
}

.stat-label {
    font-size: 14px;
    color: #6b7280;
}

/* Minimized Indicator */
.sync-indicator {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    border: 1px solid #e5e7eb;
}

.indicator-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #6b7280;
}

.indicator-content svg {
    width: 20px;
    height: 20px;
    color: #6366f1;
    animation: pulse 2s ease-in-out infinite;
}

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

.indicator-expand {
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: color 0.2s ease;
}

.indicator-expand:hover {
    color: #6366f1;
}

/* Resume Notification */
.resume-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    border-left: 4px solid #6366f1;
    animation: slideIn 0.3s ease;
}

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

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #1f2937;
}

.notification-content svg {
    width: 20px;
    height: 20px;
    color: #6366f1;
}

.notification-close {
    padding: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #1f2937;
}

/* Dark Mode Support */
body.theme-dark .sync-modal-content {
    background: #1f2937;
}

body.theme-dark .warning-content h3,
body.theme-dark .sync-complete h3,
body.theme-dark .section-header h4 {
    color: #f9fafb;
}

body.theme-dark .warning-content p,
body.theme-dark .sync-complete p,
body.theme-dark .progress-info,
body.theme-dark .progress-time,
body.theme-dark .realtime-info,
body.theme-dark .status-message {
    color: #d1d5db;
}

body.theme-dark .warning-details,
body.theme-dark .progress-section,
body.theme-dark .stat-item {
    background: #374151;
}

body.theme-dark .overall-status {
    background: #374151;
    border-color: #4b5563;
}

body.theme-dark .sync-indicator,
body.theme-dark .resume-notification {
    background: #374151;
    border-color: #4b5563;
}

body.theme-dark .progress-bar {
    background: #4b5563;
}
