/* Control Panel - owned by UIControlsManager.js */

#controls {
    position: fixed;
    left: 32px;
    top: 80px;
    background: rgba(20, 25, 40, 0.75);
    border-radius: 18px;
    backdrop-filter: blur(25px) saturate(1.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 12px rgba(78, 205, 196, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1.5px solid rgba(78, 205, 196, 0.25);
    width: 350px;
    max-width: 98vw;
    box-sizing: border-box;
    max-height: 90vh;
    z-index: 2000;
    transition: box-shadow 0.3s ease, background 0.3s ease;
    user-select: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
}

#controls.dragging {
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 5px 20px rgba(78, 205, 196, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: rgba(20, 25, 40, 0.85);
    cursor: grabbing;
    transform: scale(1.02);
    transition: none !important;
}

/* Panel Header - fixed at top, draggable */
.panel-header {
    font-family: 'Orbitron', monospace;
    font-size: 1.1em;
    font-weight: 600;
    color: #64ffda;
    text-shadow: 0 0 10px rgba(100, 255, 218, 0.3);
    margin: 18px 14px;
    padding: 12px 16px;
    text-align: left;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
    cursor: grab;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(78, 205, 196, 0.3);
    transition: background 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    user-select: none;
}

.panel-header:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.15);
}

.panel-header:active {
    cursor: grabbing;
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.1);
}

/* Panel Content Area - scrollable */
.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 18px 18px 18px;
    scrollbar-gutter: stable;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.panel-content::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}

.panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.panel-content::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.panel-content.scrolling::-webkit-scrollbar-thumb,
.panel-content:hover::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.3);
}

.panel-content.scrolling::-webkit-scrollbar-thumb:hover,
.panel-content:hover::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.5);
}

.section-header {
    font-family: 'Orbitron', monospace;
    font-size: 1.1em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    letter-spacing: 0.8px;
    color: #b8e0e6;
    text-shadow: 0 0 10px rgba(184, 224, 230, 0.2);
}

/* Panel Sections */
.panel-section {
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid rgba(78, 205, 196, 0.13);
}

.panel-section:last-child {
    border-bottom: none;
}

/* Control Groups */
.control-group {
    margin-bottom: 18px;
}

.control-group label {
    margin-bottom: 7px;
    color: #c8e8ee;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.collapsible-content {
    display: none;
    padding-left: 2px;
}

.collapsible-content.active {
    display: block;
}

/* Collapsibles */
.collapsible {
    background: none;
    border: none;
    color: #fff;
    font-family: 'Orbitron', monospace;
    font-size: 1.05em;
    width: 100%;
    text-align: left;
    padding: 12px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: rgba(78, 205, 196, 0.2);
    touch-action: manipulation;
}

.collapsible:hover,
.collapsible:focus {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.15), rgba(68, 160, 141, 0.15));
    border-radius: 6px;
    color: #4ecdc4;
    text-shadow: 0 0 10px rgba(78, 205, 196, 0.3);
    transform: translateX(3px);
    padding-left: 4px;
    padding-right: 4px;
    margin-left: -4px;
    margin-right: -4px;
}

.collapsible:after {
    content: '\25C0';
    font-size: 0.8em;
    margin-left: auto;
    transition: transform 0.2s;
}

.collapsible.active:after {
    transform: rotate(-90deg);
}

/* Sub-section collapsibles */
.sub-collapsible {
    background: none;
    border: none;
    border-top: 1px solid rgba(78, 205, 196, 0.15);
    color: #8eb4fd;
    font-size: 0.85em;
    width: 100%;
    text-align: left;
    margin-top: 6px;
    padding: 6px 0 4px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.2s;
}

.sub-collapsible:first-child {
    border-top: none;
    margin-top: 0;
}

.sub-collapsible:hover {
    color: #64ffda;
}

.sub-collapsible .sub-chevron {
    font-size: 0.7em;
    transition: transform 0.2s;
    display: inline-block;
}

.sub-collapsible.open .sub-chevron {
    transform: rotate(90deg);
}

.sub-collapsible-content {
    display: none;
    padding: 4px 0 6px 0;
}

.sub-collapsible-content.open {
    display: block;
}

/* Text3D button states */
.text3d-align-btn.active {
    background: rgba(100, 255, 218, 0.2) !important;
    color: #64ffda !important;
    border-color: #64ffda !important;
}

.text3d-style-btn.active {
    background: rgba(100, 255, 218, 0.2) !important;
    color: #64ffda !important;
    border-color: #64ffda !important;
}

.text3d-style-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed !important;
}

/* Back to Top Button */
#backToTopBtn {
    position: fixed;
    right: 32px;
    bottom: 32px;
    z-index: 2000;
    background: #2d2d4d;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    font-size: 1.3em;
    cursor: pointer;
    transition: background 0.2s;
}

/* Checkbox labels */
#controls label {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Prevent checkboxes/icons from shrinking */
#controls input[type="checkbox"],
#controls label i {
    flex-shrink: 0;
}
