/* ==========================================================================
   GearGen-3D Parameter Controls Stylesheet
   Dark CAD Theme & Dual Control Synchronization
   ========================================================================== */

.parameters-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Parameter Groups */
.parameter-group {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.group-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-title i {
    color: var(--accent-primary);
    font-size: 0.85rem;
}

.group-reset-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all var(--transition-fast);
}

.group-reset-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border);
}

/* Parameter Cards */
.parameter-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
    transition: border-color var(--transition-fast);
}

.parameter-card:hover {
    border-color: var(--border);
}

.parameter-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.parameter-label-wrap {
    display: flex;
    flex-direction: column;
}

.parameter-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.parameter-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Dual Controls Row (Slider + Input + Step Buttons) */
.parameter-controls-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-group {
    flex: 1;
    display: flex;
    align-items: center;
}

.parameter-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: #334155;
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.parameter-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.parameter-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    background: var(--accent-primary-hover);
}

.parameter-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid #ffffff;
    cursor: pointer;
}

/* Number Input with Stepper */
.input-stepper-group {
    display: flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    height: 28px;
}

.input-stepper-group:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.step-btn {
    width: 24px;
    height: 28px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: all var(--transition-fast);
}

.step-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.parameter-number-input {
    width: 48px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    padding: 0 4px;
    font-variant-numeric: tabular-nums;
}

/* Hide spin arrows in modern browsers */
.parameter-number-input::-webkit-outer-spin-button,
.parameter-number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.parameter-number-input[type=number] {
    -moz-appearance: textfield;
}

/* Text being typed that is not (yet) a usable value */
.parameter-number-input.input-invalid {
    color: #FCA5A5;
    box-shadow: inset 0 0 0 1px #EF4444;
    border-radius: 4px;
}

/* Preset Chips */
.preset-chips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.preset-chip {
    padding: 2px 8px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.preset-chip:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.preset-chip.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #ffffff;
    font-weight: 600;
}

/* Select Dropdown */
.cad-select {
    width: 100%;
    height: 32px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    padding: 0 10px;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.cad-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 1px var(--accent-primary);
}

.cad-select option {
    background: var(--background-panel);
    color: var(--text-primary);
}

/* Color Picker Control */
.color-picker-control {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 34px;
}

.cad-color-input {
    -webkit-appearance: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    width: 44px;
    height: 30px;
    background: transparent;
    cursor: pointer;
    padding: 2px;
}

.cad-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.cad-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.color-hex-val {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Calculated KPI Section */
.calculated-kpi-container {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.kpi-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.kpi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-subtle);
}

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

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.kpi-value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-success);
    font-variant-numeric: tabular-nums;
}
