/**
 * ToolsPanel Styles - Bottom toolbar with accordion
 * Part of REFACTOR_TOPLEFT_MENU (tldraw-style UI)
 */

/* ========================================
   TOOLS PANEL CONTAINER
   ======================================== */
#tools-panel {
    position: fixed;
    bottom: 16px; /* At bottom with padding */
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    display: none; /* Hidden by default, shown via ?ui=new */
    flex-direction: column;
    align-items: center;
    user-select: none;
}

#tools-panel[data-visible="true"] {
    display: flex;
}

/* ========================================
   ACCORDION TOGGLE
   ======================================== */
.tools-panel-toggle {
    width: 44px;
    height: 20px;
    background: rgba(36, 36, 36, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    transition: background 0.15s ease, color 0.15s ease;
    padding: 0;
    outline: none;
}

.tools-panel-toggle:hover {
    background: rgba(50, 50, 50, 0.95);
    color: rgba(255, 255, 255, 0.8);
}

.tools-panel-toggle:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

/* Chevron indicators */
.tools-panel-toggle[data-collapsed="false"]::after {
    content: "ˇ"; /* Chevron down - click to collapse */
    font-size: 16px;
    line-height: 1;
}

.tools-panel-toggle[data-collapsed="true"]::after {
    content: "ˆ"; /* Chevron up - click to expand */
    font-size: 16px;
    line-height: 1;
}

/* ========================================
   TOOLS CONTAINER
   ======================================== */
.tools-panel-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(36, 36, 36, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

/* Collapsed state */
#tools-panel[data-collapsed="true"] .tools-panel-container {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* ========================================
   TOOL BUTTONS
   ======================================== */
.tools-panel-tool {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    background-color: transparent;
    background-size: 24px 24px;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    padding: 0;
    outline: none;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.tools-panel-tool:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.tools-panel-tool:active {
    transform: scale(0.95);
}

.tools-panel-tool:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

/* Selected state */
.tools-panel-tool[data-selected="true"] {
    background-color: #4a90d9;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.4);
}

.tools-panel-tool[data-selected="true"]:hover {
    background-color: #3a7fc8;
}

/* ========================================
   DIVIDER
   ======================================== */
.tools-panel-divider {
    width: 1px;
    height: 28px;
    background: rgba(255, 255, 255, 0.12);
    margin: 0 6px;
}

/* ========================================
   +ADD BUTTON (PLACEHOLDER)
   ======================================== */
.tools-panel-add {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    background: transparent;
    color: rgba(255, 255, 255, 0.35);
    font-size: 18px;
    font-weight: 300;
    padding: 0;
    outline: none;
    transition: all 0.15s ease;
    position: relative;
}

.tools-panel-add:hover {
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
}

.tools-panel-add:focus-visible {
    outline: 2px solid #4a90d9;
    outline-offset: 2px;
}

.tools-panel-add::after {
    content: "+";
}

/* Tooltip */
.tools-panel-add[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    background: rgba(20, 20, 20, 0.95);
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 400;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.tools-panel-add:hover[data-tooltip]::before {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   PLAY CONTROLS (embedded in toolbar)
   ======================================== */
.tools-panel-play-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tools-panel-play-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    background: #4CAF50;
    border: none;
    padding: 0;
    outline: none;
    transition: all 0.15s ease;
    color: #fff;
    font-size: 14px;
}

.tools-panel-play-btn:hover {
    background: #43A047;
    transform: scale(1.05);
}

.tools-panel-play-btn:active {
    transform: scale(0.95);
}

.tools-panel-play-btn[data-action="stop"] {
    background: #f44336;
}

.tools-panel-play-btn[data-action="stop"]:hover {
    background: #e53935;
}

.tools-panel-play-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.tools-panel-play-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.play-icon, .stop-icon, .reset-icon, .remix-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.remix-icon {
    font-size: 16px;
}

/* Speed slider container */
.tools-panel-speed {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
}

.tools-panel-speed-icon {
    opacity: 0.5;
    flex-shrink: 0;
    filter: invert(1);
}

.tools-panel-speed-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.tools-panel-speed-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.tools-panel-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.tools-panel-speed-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #4a90d9;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Dark theme is now the default - no overrides needed */

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 480px) {
    #tools-panel {
        bottom: 70px;
    }
    
    .tools-panel-tool {
        width: 40px;
        height: 40px;
        background-size: 22px 22px;
    }
    
    .tools-panel-add {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .tools-panel-container {
        gap: 4px;
        padding: 6px 10px;
    }
}
