/* Animation Category Tabs */
.anim-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.anim-tab {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.5);
    font-family: var(--font-main);
    font-size: 0.8em;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.anim-tab small {
    font-family: var(--font-main);
    font-size: 0.75em;
    opacity: 0.6;
    font-style: italic;
}

.anim-tab:hover {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.anim-tab.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.anim-panel {
    display: none;
}

.anim-panel.active {
    display: block;
}

.state-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px;
    border-radius: 8px;
}

.state-tab {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.5);
    font-family: var(--font-main);
    font-size: 0.8em;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.state-tab small {
    font-family: var(--font-main);
    font-size: 0.75em;
    opacity: 0.6;
    font-style: italic;
}

.state-tab:hover {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.1);
}

.state-tab.active {
    color: var(--gold);
    background: rgba(212, 175, 55, 0.2);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.state-panel {
    display: none;
}

.state-panel.active {
    display: block;
}

.measurement-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.measurement-grid .quantum-btn {
    width: 100%;
}

.measurement-grid.has-custom {
    grid-template-columns: repeat(3, 1fr);
}

.custom-axis-popover {
    width: 280px;
    grid-template-columns: 1fr;
    row-gap: 10px;
}

.axis-input-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.axis-input-mode-tabs .state-tab {
    flex: 1;
    padding: 6px 8px;
    font-size: 0.85em;
}

.axis-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
    width: 100%;
}

.axis-input-group.cartesian {
    grid-template-columns: 1fr 1fr 1fr;
}

.axis-input-cell {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.axis-input-cell label {
    font-size: 0.75em;
    color: rgba(212, 175, 55, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.axis-input-cell input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.4);
    color: var(--gold-light);
    caret-color: var(--gold);
    font-family: var(--font-main);
    font-size: 0.95em;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    font-variant-numeric: tabular-nums;
}

.axis-input-cell input::placeholder {
    color: rgba(212, 175, 55, 0.45);
}

.axis-input-cell input[type="range"] {
    padding: 0;
    background: transparent;
    margin-top: 6px;
}

.axis-color-picker {
    display: flex;
    gap: 6px;
    align-items: center;
}

.axis-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.5);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.axis-color-swatch:hover {
    transform: scale(1.1);
}

.axis-color-swatch.selected {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.trail-color-picker {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
}

.trail-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.45);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.trail-color-swatch:hover {
    transform: scale(1.08);
}

.trail-color-swatch.selected {
    border-color: var(--gold);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.45);
}

.custom-axis-btn {
    position: relative;
}

.custom-axis-btn .delete-badge {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: rgba(231, 76, 60, 0.95);
    border-radius: 50%;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.85;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.custom-axis-btn:hover .delete-badge {
    display: block;
    transform: scale(1.05);
    opacity: 1;
}

.custom-gate-btn {
    position: relative;
}

.custom-gate-btn .delete-badge {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: rgba(231, 76, 60, 0.95);
    border-radius: 50%;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.85;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.custom-gate-btn:hover .delete-badge {
    display: block;
    transform: scale(1.05);
    opacity: 1;
}

.custom-state-btn {
    position: relative;
}

.custom-state-btn .delete-badge {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background: rgba(231, 76, 60, 0.95);
    border-radius: 50%;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    opacity: 0.85;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.custom-state-btn:hover .delete-badge {
    display: block;
    transform: scale(1.05);
    opacity: 1;
}

.measurement-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 1.05em;
    display: none;
    border: 1px solid rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.measurement-result.show {
    display: block;
    animation: fadeInOut 2s ease-in-out;
}

.measurement-result.zero {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.18), rgba(39, 174, 96, 0.06));
    border-color: rgba(39, 174, 96, 0.5);
    color: #8FE6B7;
}

.measurement-result.one {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.18), rgba(231, 76, 60, 0.06));
    border-color: rgba(231, 76, 60, 0.5);
    color: #F5A09A;
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0;
    }

    20%,
    80% {
        opacity: 1;
    }
}
