/* Wealthsimple Sync Styles */

/* Sync Button */
.btn-sync {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    transition: all var(--transition-fast);
}

.btn-sync:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sync.connected {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-sync svg {
    transition: transform 0.3s ease;
}

.btn-sync:hover svg {
    transform: rotate(180deg);
}

/* Sync Modal Content */
.sync-modal-content {
    max-width: 480px;
}

/* Status View */
.sync-status-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
}

.sync-status-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.sync-status-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.sync-status-icon.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.sync-status-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.sync-status-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.sync-last-updated {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
}

.sync-last-updated span:first-child {
    color: var(--text-secondary);
}

.sync-last-updated span:last-child {
    color: var(--text-primary);
    font-weight: 500;
}

.sync-actions {
    display: flex;
    gap: var(--spacing-md);
}

.sync-actions .btn {
    flex: 1;
}

/* Sync Progress */
.sync-progress {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
}

.sync-progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.sync-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.sync-progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Login View */
.sync-login-form {
    padding: var(--spacing-md);
}

.sync-login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.sync-logo {
    margin-bottom: var(--spacing-md);
}

.sync-login-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.sync-login-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.form-group input {
    width: 100%;
    padding: var(--spacing-md);
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

.form-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
}

.btn-full {
    width: 100%;
    margin-top: var(--spacing-md);
}

/* Privacy Note */
.sync-privacy-note {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xl);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.sync-privacy-note svg {
    flex-shrink: 0;
    color: var(--text-muted);
    margin-top: 2px;
}

.sync-privacy-note p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Error View */
.sync-error-view {
    text-align: center;
    padding: var(--spacing-xl);
}

.sync-error-icon {
    margin-bottom: var(--spacing-lg);
}

.sync-error-view h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.sync-error-view p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.sync-error-view code {
    display: inline-block;
    background: var(--bg-tertiary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Responsive */
@media (max-width: 480px) {
    .sync-modal-content {
        margin: var(--spacing-md);
    }
    
    .sync-status-header {
        flex-direction: column;
        text-align: center;
    }
    
    .sync-actions {
        flex-direction: column;
    }
}

/* Upload Section */
.sync-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 24px 0;
    color: var(--text-secondary);
}

.sync-divider::before,
.sync-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.sync-divider span {
    padding: 0 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sync-upload-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
}

.sync-upload-section h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
}

.sync-upload-section > p {
    margin: 0 0 16px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.sync-upload-steps {
    margin: 0 0 16px 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.sync-upload-steps code {
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.sync-upload-steps a {
    color: var(--accent-primary);
    text-decoration: none;
}

.sync-upload-steps a:hover {
    text-decoration: underline;
}

.file-upload-wrapper {
    margin-top: 12px;
}

.form-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
}
