/* ========================================
   Settings Screen Component
   macOS System Settings style modal
   ======================================== */

/* Overlay (Backdrop) */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

/* Modal Container */
.settings-modal {
    width: 600px;
    height: 500px;
    background: var(--bg-gradient-primary, var(--bg-primary));
    border: 1px solid var(--border-default);
    border-radius: 12px;
    box-shadow: var(--shadow-large);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleIn 0.2s ease;
}

/* Header */
.settings-header {
    width: 100%;
    height: 56px;
    background: transparent;
    border-bottom: 1px solid var(--border-default);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 24px;
    flex-shrink: 0;
}

.settings-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.settings-close:hover {
    background: var(--interactive-hover);
    color: var(--text-primary);
}

/* Body (Two-pane layout) */
.settings-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.settings-sidebar {
    width: 180px;
    background: transparent;
    border-inline-end: 1px solid var(--border-default);
    padding: 12px 8px;
    overflow-y: auto;
    flex-shrink: 0;
}

/* Hide scrollbar but keep functionality */
.settings-sidebar::-webkit-scrollbar {
    display: none;
}
.settings-sidebar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Category Item */
.settings-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    margin-bottom: 4px;
}

.settings-category-item:hover {
    background: var(--interactive-hover);
}

.settings-category-item.active {
    background: var(--interactive-selected);
}

.settings-category-icon {
    font-size: 18px;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.settings-category-item.active .settings-category-icon {
    color: var(--blue-primary);
}

.settings-category-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Content Area */
.settings-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-primary);
}

/* Hide scrollbar but keep functionality */
.settings-content::-webkit-scrollbar {
    display: none;
}
.settings-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Content Title */
.settings-content-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
}

/* Content Description */
.settings-content-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Settings List - Card Style */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    box-shadow: var(--shadow-small);
    overflow: hidden;
    margin-bottom: 16px;
}

/* Settings Row */
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-default);
    min-height: 52px;
    transition: background 0.2s;
}

.settings-row:hover {
    background: var(--interactive-hover);
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.settings-row-icon {
    font-size: 16px;
    color: var(--text-secondary);
    width: 20px;
    text-align: center;
}

.settings-row-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

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

.settings-row-value {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: end;
}

/* Action Buttons */
.settings-row-action {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.settings-row-action:hover {
    background: var(--interactive-hover);
    border-color: var(--border-secondary);
}

.settings-row-action.destructive {
    color: var(--red-primary);
    border-color: var(--red-primary);
}

.settings-row-action.destructive:hover {
    background: var(--red-primary);
    color: white;
}

/* Toggle Button */
.settings-row-toggle {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-primary);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 50px;
}

.settings-row-toggle:hover {
    background: var(--interactive-hover);
}

.settings-row-toggle.toggle-on {
    background: var(--blue-primary);
    color: white;
    border-color: var(--blue-primary);
}

/* Coming Soon Message */
.settings-coming-soon {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 40px 20px;
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .settings-overlay,
    .settings-modal {
        animation: none;
    }

    .settings-category-item,
    .settings-row-action,
    .settings-row-toggle,
    .settings-close {
        transition: none;
    }
}

/* Responsive */
@media (max-width: 700px) {
    .settings-modal {
        width: 90vw;
        height: 85vh;
        max-height: 600px;
    }
}

@media (max-width: 600px) {
    .settings-body {
        flex-direction: column;
    }

    .settings-sidebar {
        width: 100%;
        border-inline-end: none;
        border-bottom: 1px solid var(--border-primary);
        max-height: 120px;
    }

    .settings-category-item {
        display: inline-flex;
        width: auto;
    }
}

/* Structure Summary Details */
.structure-summary-details {
    padding: 0 16px;
    background: var(--bg-primary);
}

.summary-section {
    padding: 12px 0;
}

.summary-section:not(:last-child) {
    border-bottom: 1px solid var(--border-default);
}

.summary-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.summary-label {
    color: var(--text-primary);
    font-weight: 400;
}

.summary-value {
    color: var(--text-secondary);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
