﻿/* ==========================================================================
   COMPONENTS – Buttons, Cards, Form Controls
   ========================================================================== */

/* Allgemeiner, eckiger Button-Stil */
button,
select,
input,
textarea{
    font: inherit;
    color: inherit;
}

button{
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pill-Buttons = rechteckig mit klarer Border */
.pill{
    border: 1px solid var(--hairline);
    border-radius: 4px;                 /* eckig */
    background: transparent;
    color: var(--paper);                /* gute Lesbarkeit auf dunklem Stream */
    min-width: 0;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform .12s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
    display: inline-flex;               /* Inhalte nebeneinander */
    align-items: center;                /* vertikal zentrieren */
    gap: 8px;                           /* Abstand zwischen Swatch und Text */
    white-space: nowrap;                /* kein Zeilenumbruch bei langen Namen */
}

.pill:hover{
    transform: translateY(-1px);
    border-color: var(--hairline);
    background: transparent;
    box-shadow: none;
}

.pill:active{
    transform: translateY(0);
}

/* Ausgewählt */
.pill.selected{
    border-color: var(--primary);
    background: transparent;
    box-shadow: none;
}

/* Deaktiviert sichtbar machen */
.is-disabled,
button[disabled],
[aria-disabled="true"] {
    opacity: .2;
    pointer-events: none;
    filter: grayscale(20%);
}

/* Form */
.form .control{ margin-bottom:14px; }
.form label{
    display:flex; justify-content:space-between; gap:10px; margin-bottom:6px;
    color: var(--paper);
}
.form .value{ color: var(--ink-2); }
.form input[type="range"]{ width:100%; }

.form input[type="range"],
#panel-interaction input[type="range"]{
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: var(--glow-primary-soft);
    box-shadow: inset 0 0 0 1px rgba(var(--shadow-rgb), 0.18);
}

.form input[type="range"]::-webkit-slider-runnable-track,
#panel-interaction input[type="range"]::-webkit-slider-runnable-track{
    height: 4px;
    border-radius: 999px;
    background: var(--glow-primary-soft);
}

.form input[type="range"]::-webkit-slider-thumb,
#panel-interaction input[type="range"]::-webkit-slider-thumb{
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--outline-contrast);
    box-shadow: 0 4px 12px var(--glow-primary-medium);
    margin-top: -4px;
    transition: transform .15s ease;
}

.form input[type="range"]::-webkit-slider-thumb:active,
#panel-interaction input[type="range"]::-webkit-slider-thumb:active{
    transform: scale(0.94);
}

.form input[type="range"]::-moz-range-track,
#panel-interaction input[type="range"]::-moz-range-track{
    height: 4px;
    border-radius: 999px;
    background: var(--glow-primary-soft);
}

.form input[type="range"]::-moz-range-thumb,
#panel-interaction input[type="range"]::-moz-range-thumb{
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--outline-contrast);
    box-shadow: 0 4px 12px var(--glow-primary-medium);
    transition: transform .15s ease;
}

.form input[type="range"]::-moz-range-thumb:active,
#panel-interaction input[type="range"]::-moz-range-thumb:active{
    transform: scale(0.94);
}

/* Dropdowns & Zahleneingaben im Interaktions-Panel: dunklere Flächen für Kontrast */
#panel-interaction select.pill,
#panel-interaction input.pill,
select.pill{
    background: transparent;
    color: var(--ink);
    border-color: var(--hairline);
    box-shadow: none;
}
#panel-interaction select.pill.level-select{
    padding: 6px 10px;
    font-size: 12px;
    min-height: 30px;
}

#panel-interaction input.pill::placeholder{
    color: var(--ink-2);
}

select.pill{
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink) 50%),
        linear-gradient(-45deg, transparent 50%, var(--ink) 50%),
        linear-gradient(90deg, transparent 50%, transparent 50%);
    background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%, 100% 0;
    background-size: 6px 6px, 6px 6px, 2.5rem 100%;
    background-repeat: no-repeat;
    padding-right: 2.75rem;
}

#panel-interaction select.pill:focus,
select.pill:focus{
    border-color: var(--primary);
    outline: none;
    box-shadow: none;
}

select.pill option,
select.pill optgroup{
    background-color: var(--control-surface-strong) !important;
    color: var(--ink);
}

select.pill option:hover,
select.pill option:focus {
    background-color: var(--primary-hover) !important;
    color: var(--ink) !important;
}

select.pill option:checked,
select.pill option:checked:hover,
select.pill option:checked:focus {
    background-color: var(--primary) !important;
    color: var(--paper) !important;
}

select.pill option:is(:hover, :focus)::selection {
    background: var(--primary-hover);
    color: var(--ink);
}

/* Reusable rows */
.row{ display:flex; align-items:center; gap:10px; margin:10px 0; }
.row.wrap{ flex-wrap:wrap; }
.row.spaced{ justify-content:space-between; }
.row-label{
    display:flex;
    align-items:center;
    gap:20px;
}

/* Interaction panel: studio-console layout */
#panel-interaction .panel-content{
    padding: 3px 2px;
    font-size: 15px;
}
#panel-subtabs{
    padding: 6px 6px 4px;
    border-radius: 10px;
    background: var(--control-surface);
}
#panel-subtabs .subtabs{
    display:flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 2px;
    padding: 0 2px;
    border: none;
    background: none;
}
#panel-subtabs .subtab-btn{
    flex: 1 1 0;
    min-width: 0;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 8px 6px;
    font-size: 12px;
    line-height: 1.2;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: center;
    position: relative;
    font-weight: 600;
    opacity: 1;
}
#panel-subtabs .subtab-btn:not(.active){
    opacity: 0.35;
    color: rgba(var(--ink-rgb), 0.5);
    font-weight: 500;
}
#panel-subtabs .subtab-btn.active{
    border-bottom-color: var(--primary);
    color: var(--paper);
    font-weight: 700;
    opacity: 1;
    text-shadow: 0 0 10px rgba(var(--primary-rgb), 0.35);
}
#panel-subtabs .subtab-btn.active:hover{
    border-bottom-color: var(--primary);
    color: var(--paper);
}
#panel-subtabs .subtab-btn:not(.active):hover{
    border-bottom-color: rgba(var(--primary-rgb), 0.4);
    color: rgba(var(--ink-rgb), 0.7);
    opacity: 0.55;
}
#panel-interaction .subtab-panel{
    padding: 4px 0 0;
    border: none;
    border-radius: 0;
    background: none;
}
#panel-interaction .section{
    padding: 4px 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
#panel-interaction .config-block + .config-block{
    margin-top: 20px;
}
#panel-interaction .section.section-plain{
    background: none;
    border: none;
    box-shadow: none;
}
#panel-interaction .section + .section{
    margin-top: 30px;
    border-top: none;
}
#panel-interaction .section > h3{
    margin: 0 0 10px 0;
    font-size: 10.5px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-2);
}

/* Slider labels/scales in the interaction panel */
#panel-interaction .slider-block{
    display:flex;
    flex-direction:column;
    gap:6px;
}
#panel-interaction .slider-block + .slider-block{
    margin-top: 12px;
}
#panel-interaction .slider-block input[type="range"]{
    width: 100%;
    margin: 0;
    padding: 0;
}
#panel-interaction .slider-label{
    font-weight: 600;
    color: var(--paper);
}
#panel-interaction .pill{
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}
#panel-interaction .row{
    flex-wrap: wrap;
}
#panel-interaction .row-label{
    flex-wrap: wrap;
    gap: 10px;
    font-weight: 600;
    color: var(--paper);
}
#panel-interaction .slider-value{
    color: var(--ink-2);
    font-size: 12px;
    letter-spacing: .02em;
}
#panel-interaction .slider-scale{
    display:flex;
    justify-content:space-between;
    color: var(--ink-2);
    font-size: 12px;
    letter-spacing: .02em;
    gap: 12px;
}
#panel-interaction .slider-scale span{
    flex: 1 1 0;
    max-width: 50%;
    white-space: normal;
}
#panel-interaction .slider-scale span:first-child{
    text-align: left;
}
#panel-interaction .slider-scale span:last-child{
    text-align: right;
}

/* Material selection buttons */
#panel-interaction .material-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}
#panel-interaction .material-group + .material-group{
    margin-top: 12px;
}
#panel-interaction .material-title{
    font-weight: 600;
    color: var(--paper);
}
#panel-interaction .material-options{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    padding: 6px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--control-surface);
    width: 100%;
}
#panel-interaction .material-option{
    align-items:center;
    gap:8px;
    border-color: var(--hairline);
    background: transparent;
    font-size: 14px;
    white-space: normal;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1 1 160px;
    max-width: 100%;
    justify-content: flex-start;
    text-align: left;
}
#panel-interaction .material-option.selected{
    border-color: var(--primary);
    background: transparent;
    box-shadow: none !important;
    color: var(--paper);
}
#panel-interaction .material-option.selected .swatch{
    border-color: rgba(var(--ink-rgb), 0.75);
}
#panel-interaction .material-option .swatch{
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background: var(--swatch, var(--neutral-400));
    border: 1px solid var(--swatch-border);
    box-shadow: inset 0 0 0 1px rgba(var(--shadow-rgb), 0.06);
}

/* Accessories */
#panel-interaction .accessory-options{
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    padding: 6px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--control-surface);
    width: 100%;
}
#panel-interaction .accessory-options.accessory-options-rows{
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
}
#panel-interaction .accessory-row{
    display:flex;
    gap:6px;
    width: 100%;
}
#panel-interaction .accessory-option,
#panel-interaction .accessory-id-option{
    align-items:center;
    border-color: var(--hairline);
    background: transparent;
    font-size: 14px;
    white-space: normal;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1 1 160px;
    max-width: 100%;
    justify-content: flex-start;
    text-align: left;
}
#panel-interaction .accessory-row .accessory-option,
#panel-interaction .accessory-row .accessory-id-option{
    flex: 1 1 0;
    max-width: none;
    justify-content: center;
    text-align: center;
}
#panel-interaction .accessory-option.selected,
#panel-interaction .accessory-id-option.selected{
    border-color: var(--primary);
    background: transparent;
    box-shadow: none !important;
    color: var(--paper);
}
#panel-interaction .accessory-group{
    display:flex;
    flex-direction:column;
    gap:8px;
}
#panel-interaction .accessory-group + .accessory-group{
    margin-top: 12px;
}
#panel-interaction .accessory-subtitle{
    font-weight: 600;
    color: var(--paper);
}

@media (max-width: 540px){
    .pill{
        white-space: normal;
        line-height: 1.3;
        flex-wrap: wrap;
        justify-content: flex-start;
        text-align: left;
    }
}
