/* ═══════════════════════════════════════
   PROJECT SETTINGS MODAL
   Extension of dce.css design system
   ═══════════════════════════════════════ */

/* Wide modal variant — fixed size so tabs don't resize the dialog */
.modal-wide {
    width: 720px;
    max-width: 90vw;
    height: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;     /* override base .modal overflow-y: auto */
}

.modal-wide .modal-header,
.modal-wide .settings-tabs,
.modal-wide .modal-footer {
    flex-shrink: 0;
}

.modal-wide .modal-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* TopBar settings button */
.topbar-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    margin-right: 8px;
}

.topbar-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
    border-color: var(--accent-border);
}

.topbar-btn svg { width: 18px; height: 18px; }

/* ═══════════════════════════════════════
   TAB NAVIGATION
   ═══════════════════════════════════════ */
.settings-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-light);
    padding: 0 24px;
    overflow-x: auto;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.settings-tab svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.settings-tab:hover {
    color: var(--text-secondary);
    background: var(--accent-light);
}

.settings-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Section title within tabs */
.tab-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

/* ═══════════════════════════════════════
   UNIT PRESETS
   ═══════════════════════════════════════ */
.unit-preset-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.unit-preset-btn {
    flex: 1;
    padding: 8px 14px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.unit-preset-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
}

.unit-preset-btn.active {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 93, 62, 0.1);
}

.unit-preset-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* ═══════════════════════════════════════
   UNIT GROUP SUB-TABS
   ═══════════════════════════════════════ */
.unit-group-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.unit-group-tab {
    padding: 8px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 450;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
}

.unit-group-tab:hover {
    color: var(--text);
}

.unit-group-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

/* ═══════════════════════════════════════
   UNIT TABLE
   ═══════════════════════════════════════ */
.unit-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
}

.unit-table-header {
    display: grid;
    grid-template-columns: 140px 1fr 90px;
    gap: 12px;
    padding: 8px 14px;
    background: #f5f3ef;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.unit-table-row {
    display: grid;
    grid-template-columns: 140px 1fr 90px;
    gap: 12px;
    padding: 8px 14px;
    align-items: center;
    border-top: 1px solid var(--border-light);
    transition: background var(--transition);
}

.unit-table-row:hover {
    background: var(--surface-hover);
}

.unit-table-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.unit-table-select {
    font-family: var(--font);
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    width: 100%;
}

.unit-table-select:focus { border-color: var(--accent); }

.unit-table-decimals {
    font-family: var(--font);
    font-size: 12px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color var(--transition);
    width: 100%;
    text-align: center;
}

.unit-table-decimals:focus { border-color: var(--accent); }

/* ═══════════════════════════════════════
   PLACEHOLDER CHIPS
   ═══════════════════════════════════════ */
.placeholder-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 14px;
}

.placeholder-chip {
    font-family: var(--mono);
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent-border);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.placeholder-chip:hover {
    background: var(--accent);
    color: #fff;
}

/* Section divider */
.section-divider {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 16px 0;
}

/* ═══════════════════════════════════════
   HEADER / FOOTER PREVIEW
   ═══════════════════════════════════════ */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-row .form-label {
    margin-bottom: 0;
}

.hf-preview-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
}

.hf-preview-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hf-preview-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.hf-preview-strip {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 7px;
    color: var(--text-secondary);
    font-weight: 500;
    background: var(--surface);
    min-height: 38px;
}

.hf-preview-strip--header {
    border-bottom: 1.5px solid var(--text);
}

.hf-preview-strip--footer {
    border-top: 1.5px solid var(--border);
    font-size: 6px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   DIMENSION PREVIEW
   ═══════════════════════════════════════ */
.dim-preview-svg {
    margin-top: 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    background: var(--preview-bg);
    padding: 12px;
}

.dim-preview-svg svg {
    width: 100%;
    height: auto;
}

/* ═══════════════════════════════════════
   FORM EXTENSIONS
   ═══════════════════════════════════════ */
.form-textarea {
    resize: vertical;
    min-height: 60px;
    font-family: var(--font);
}

.form-color {
    height: 38px;
    padding: 4px;
    cursor: pointer;
}

/* Text button variant */
.btn-text {
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 9px 12px;
    border-radius: var(--radius);
    transition: all var(--transition);
}

.btn-text:hover {
    color: var(--accent);
    background: var(--accent-light);
}
