/*
╔═══════════════════════════════════════════════════════════════════╗
║ TOOLS PANEL — TTY Style                                           ║
║ Mini (56px) ↔ Expanded (200px)                                    ║
╚═══════════════════════════════════════════════════════════════════╝
*/

/* ====================================================================
   PANEL
   ==================================================================== */

.tools-panel {
    width: 56px;
    height: 100%;
    background: var(--io-surface-raised);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    font-family: var(--io-font-mono);
    border-left: 1px solid var(--io-border-subtle);
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.tools-panel.expanded {
    width: 200px;
}

/* accent fade border */
.tools-panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(var(--io-border-accent-fade-base), 0.3) 15%,
        rgba(var(--io-border-accent-fade-base), 1.0) 50%,
        rgba(var(--io-border-accent-fade-base), 0.3) 85%,
        transparent 100%
    );
    pointer-events: none;
}

/* ====================================================================
   TOGGLE — header
   ==================================================================== */

.tp-toggle {
    padding: 8px 0;
    text-align: center;
    font-size: 10px;
    color: var(--io-text-tertiary);
    letter-spacing: 1px;
    border-bottom: 1px solid var(--io-border-subtle);
    cursor: pointer;
    transition: color 200ms ease;
    flex-shrink: 0;
    font-family: var(--io-font-mono);
}

.tp-toggle:hover {
    color: var(--io-accent);
}

.tp-toggle-blink {
    animation: tp-blink 1s step-end infinite;
}

@keyframes tp-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ====================================================================
   DIVIDER
   ==================================================================== */

.tp-divider {
    height: 1px;
    background: var(--io-border-subtle);
    flex-shrink: 0;
}

/* ====================================================================
   TOOL LIST
   ==================================================================== */

.tp-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 0;
    display: flex;
    flex-direction: column;
}

.tp-list::-webkit-scrollbar { width: 3px; }
.tp-list::-webkit-scrollbar-track { background: transparent; }
.tp-list::-webkit-scrollbar-thumb { background: var(--io-accent-subtle); border-radius: 2px; }

/* ====================================================================
   TOOL ITEM
   ==================================================================== */

.tp-item {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--io-font-mono);
    font-size: 11px;
    color: var(--io-text-tertiary);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
    position: relative;
    border-left: 2px solid transparent;
    overflow: hidden;
}

.tp-item:hover {
    color: var(--io-text-primary);
    background: var(--io-surface-hover);
    border-left-color: var(--io-text-tertiary);
}

.tp-item.active {
    color: var(--io-accent);
    border-left-color: var(--io-accent);
    background: var(--io-accent-subtle);
}

/* > cursor prefix — only visible when active */
.tp-item-cursor {
    display: none;
    color: var(--io-accent);
    margin-right: 2px;
    flex-shrink: 0;
}

.tp-item.active .tp-item-cursor {
    display: inline;
}

/* abbreviated label — always visible */
.tp-item-abbr {
    flex-shrink: 0;
}

/* full label — hidden in mini */
.tp-item-label {
    display: none;
    white-space: nowrap;
    overflow: hidden;
    margin-left: 4px;
    color: inherit;
}

/* EXPANDED */
.tools-panel.expanded .tp-item {
    justify-content: flex-start;
    padding-left: 12px;
    font-size: 10px;
    gap: 0;
}

.tools-panel.expanded .tp-item-label {
    display: inline;
}

/* ====================================================================
   TOOLTIP — mini mode only
   ==================================================================== */

.tp-tip {
    position: fixed;
    z-index: 9999;
    padding: 3px 8px;
    background: var(--io-surface-base);
    border: 1px solid var(--io-border-subtle);
    font-family: var(--io-font-mono);
    font-size: 11px;
    color: var(--io-text-primary);
    letter-spacing: 0.5px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity 80ms ease, transform 80ms ease;
    white-space: nowrap;
}

.tp-tip.visible {
    opacity: 1;
    transform: translateX(0);
}

.tp-tip strong {
    font-weight: 700;
    color: var(--io-accent);
}

.tp-tip-desc {
    font-size: 11px;
    color: var(--io-text-tertiary);
}

/* ====================================================================
   FOOTER — status line
   ==================================================================== */

.tp-foot {
    border-top: 1px solid var(--io-border-subtle);
    padding: 6px 4px;
    font-family: var(--io-font-mono);
    font-size: 9px;
    color: var(--io-text-tertiary);
    text-align: center;
    line-height: 1.8;
    flex-shrink: 0;
}

.tp-foot-status {
    color: var(--io-success);
}

/* ====================================================================
   RESPONSIVE
   ==================================================================== */

@media (max-width: 768px) {
    .tools-panel {
        position: absolute;
        right: 0;
        top: 0;
        z-index: 1000;
        box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
    }
}