/**
 * Cloud Sync Manager Styles
 * Modern UI for OneDrive synchronization settings
 */

/* ==========================================================================
   SETTINGS PANEL
   ========================================================================== */

.cloud-sync-settings {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 24px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sync-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #cbd5e1;
}

.sync-icon {
    font-size: 48px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
}

.sync-title {
    flex: 1;
}

.sync-title h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
}

.sync-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.disconnected {
    background: #94a3b8;
    animation: none;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
}

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

/* ==========================================================================
   FOLDER SECTION
   ========================================================================== */

.sync-folder-section {
    margin-bottom: 20px;
}

.sync-folder-section label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.folder-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.folder-row input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    color: #334155;
}

.folder-row input[type="text"]:read-only {
    background: #f1f5f9;
    cursor: default;
}

/* ==========================================================================
   TOGGLE SECTION
   ========================================================================== */

.sync-toggle-section {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-row input[type="checkbox"] {
    display: none;
}

.toggle-row .toggle-slider {
    width: 48px;
    height: 26px;
    background: #cbd5e1;
    border-radius: 13px;
    position: relative;
    transition: all 0.3s ease;
}

.toggle-row .toggle-slider::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-row input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
}

.toggle-row input[type="checkbox"]:checked + .toggle-slider::after {
    left: 24px;
}

.toggle-label {
    font-weight: 600;
    color: #334155;
}

.toggle-desc {
    margin: 8px 0 0 60px;
    font-size: 0.8rem;
    color: #64748b;
}

/* ==========================================================================
   ACTION BUTTONS
   ========================================================================== */

.sync-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sync-actions .btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sync-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sync-actions .btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

.sync-actions .btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.sync-actions .btn-info {
    background: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
    color: white;
}

.sync-actions .btn-info:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.sync-actions .btn-outline {
    background: white;
    color: #475569;
    border: 2px solid #cbd5e1;
}

.sync-actions .btn-outline:hover:not(:disabled) {
    border-color: #0078d4;
    color: #0078d4;
}

/* ==========================================================================
   SYNC INFO
   ========================================================================== */

.sync-info {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.sync-info small {
    color: #64748b;
    font-size: 0.8rem;
}

/* ==========================================================================
   BACKUP LIST MODAL
   ========================================================================== */

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

.backup-list-modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.backup-list-modal h3 {
    margin: 0 0 20px 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.backup-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.backup-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.backup-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.backup-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    font-family: var(--font-mono);
}

.backup-date {
    font-size: 0.75rem;
    color: #64748b;
}

.no-backups {
    text-align: center;
    color: #94a3b8;
    padding: 40px 20px;
    font-style: italic;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: right;
}

.modal-footer .btn-secondary {
    background: #64748b;
    color: white;
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.modal-footer .btn-secondary:hover {
    background: #475569;
}

/* ==========================================================================
   GENERAL BUTTON STYLES
   ========================================================================== */

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #0078d4 0%, #00a4ef 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

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

@media (prefers-color-scheme: dark) {
    .cloud-sync-settings {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-color: #334155;
    }

    .sync-title h3 {
        color: #f1f5f9;
    }

    .sync-subtitle {
        color: #94a3b8;
    }

    .sync-status {
        background: #334155;
        border-color: #475569;
    }

    .status-text {
        color: #cbd5e1;
    }

    .folder-row input[type="text"] {
        background: #334155;
        border-color: #475569;
        color: #f1f5f9;
    }

    .folder-row input[type="text"]:read-only {
        background: #1e293b;
    }

    .sync-toggle-section {
        background: #334155;
        border-color: #475569;
    }

    .toggle-label {
        color: #f1f5f9;
    }

    .toggle-desc {
        color: #94a3b8;
    }

    .sync-actions .btn-outline {
        background: #334155;
        color: #cbd5e1;
        border-color: #475569;
    }

    .backup-list-modal {
        background: #1e293b;
    }

    .backup-list-modal h3 {
        color: #f1f5f9;
    }

    .backup-item {
        background: #334155;
        border-color: #475569;
    }

    .backup-name {
        color: #f1f5f9;
    }

    .backup-date {
        color: #94a3b8;
    }
}

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

@media (max-width: 640px) {
    .sync-header {
        flex-wrap: wrap;
    }

    .sync-status {
        width: 100%;
        justify-content: center;
    }

    .folder-row {
        flex-direction: column;
    }

    .folder-row input[type="text"],
    .folder-row button {
        width: 100%;
    }

    .sync-actions {
        flex-direction: column;
    }

    .sync-actions .btn {
        width: 100%;
    }
}
