/* Settings-specific styles */

.settings-container {
    display: flex;
    height: calc(100vh - 120px);
    background: var(--color-background);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Settings Navigation */
.settings-nav {
    width: 280px;
    background: var(--color-white);
    border-right: 1px solid var(--color-border-light);
    overflow-y: auto;
}

.settings-nav-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.settings-nav-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.settings-nav-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.settings-nav-item {
    margin: 0 0.75rem 0.5rem;
}

.settings-nav-link {
    display: flex;
    align-items: center;
    padding: 0.875rem 1rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.settings-nav-link:hover {
    background: var(--color-background);
    color: var(--color-text-primary);
}

.settings-nav-item.active .settings-nav-link {
    background: var(--color-primary);
    color: white;
}

.settings-nav-link i {
    margin-right: 0.75rem;
    width: 16px;
    text-align: center;
    font-size: 0.875rem;
}

/* Settings Content */
.settings-content {
    flex: 1;
    background: var(--color-white);
    overflow-y: auto;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-white);
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-header-left {
    flex: 1;
}

.settings-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--color-text-primary);
}

.settings-subtitle {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin: 0;
}

.settings-header-right {
    display: flex;
    gap: 0.75rem;
}

/* Settings Body */
.settings-body {
    padding: 2rem;
    max-width: 900px;
}

/* Settings Sections */
.settings-section {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 1.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

/* Form Elements in Settings */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-col {
    display: flex;
    flex-direction: column;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-input,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
    background: var(--color-white);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Toggle Switches */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toggle-item {
    display: flex;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
    cursor: pointer;
    margin: 0;
}

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

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: 12px;
    margin-right: 0.75rem;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 10px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch {
    background: var(--color-primary);
}

.toggle-label input[type="checkbox"]:checked + .toggle-switch::after {
    transform: translateX(20px);
}

/* Integration Items */
.integration-list {
    margin-top: 1.5rem;
}

.integration-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border-light);
}

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

.integration-info {
    flex: 1;
}

.integration-name {
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
}

.integration-status {
    font-size: 0.875rem;
    font-weight: 500;
}

.integration-status.connected {
    color: var(--color-success);
}

.integration-status.disconnected {
    color: var(--color-text-secondary);
}

/* API Settings */
.api-key-container {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.api-key-container .form-input {
    flex: 1;
}

.api-docs {
    margin-top: 1rem;
}

/* Backup Settings */
.backup-status {
    padding: 1.5rem;
    background: var(--color-background);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.backup-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.backup-label {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.backup-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

.backup-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.export-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Button Sizing */
.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .settings-container {
        flex-direction: column;
        height: auto;
    }
    
    .settings-nav {
        width: 100%;
        background: var(--color-white);
        border-right: none;
        border-bottom: 1px solid var(--color-border-light);
        order: 2;
    }
    
    .settings-nav-menu {
        display: flex;
        overflow-x: auto;
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .settings-nav-item {
        margin: 0;
        flex-shrink: 0;
    }
    
    .settings-nav-link {
        white-space: nowrap;
        padding: 0.625rem 1rem;
    }
    
    .settings-content {
        order: 1;
    }
    
    .settings-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .settings-header-right {
        width: 100%;
        justify-content: stretch;
    }
    
    .settings-header-right .btn {
        flex: 1;
    }
    
    .settings-body {
        padding: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .backup-actions,
    .export-options {
        flex-direction: column;
    }
    
    .backup-actions .btn,
    .export-options .btn {
        width: 100%;
    }
    
    .api-key-container {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .settings-nav-link span {
        display: none;
    }
    
    .settings-nav-link {
        padding: 0.75rem;
        justify-content: center;
    }
    
    .settings-title {
        font-size: 1.5rem;
    }
    
    .settings-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Animation for settings transitions */
.settings-body {
    animation: fadeIn 0.3s ease;
}

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