/* CSS Custom Properties */
:root {
    --menu-bar-height: 24px;
}

/* Mobile touch handling */
.waveform-main-canvas {
    touch-action: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    :root {
        --menu-bar-height: 32px;
    }
    
    .menu-bar {
        font-size: 14px;
    }
    
    .menu-item {
        padding: 0 8px;
    }
    
    .vertical-sidebar {
        width: var(--sidebar-width, 280px);
    }
    
    .vertical-sidebar:not(.expanded) {
        width: 40px;
    }
    
    .sidebar-icons {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
    }
    
    .sidebar-icon {
        width: 36px;
        height: 36px;
    }
}

/* Custom Scrollbars - Dark Theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1e24;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #3a404a;
    border-radius: 4px;
    border: 1px solid #2c313a;
}

::-webkit-scrollbar-thumb:hover {
    background: #4a505a;
}

::-webkit-scrollbar-thumb:active {
    background: #5a606a;
}

::-webkit-scrollbar-corner {
    background: #1a1e24;
}

/* Firefox scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #3a404a #1a1e24;
}

/* Menu Bar Styles - Consistent with Application Theme */
.menu-bar {
    display: flex;
    align-items: center;
    height: var(--menu-bar-height);
    background: #23272e; /* Match sidebar background */
    border-bottom: 1px solid #2c313a; /* Match sidebar border */
    font-size: 13px;
    color: #bfc7d5; /* Match sidebar text color */
    user-select: none;
    position: relative;
    z-index: 1000;
    flex-shrink: 0; /* Prevent shrinking */
    box-sizing: border-box;
}

.menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 12px;
    white-space: nowrap; /* Prevent text wrapping */
}

.menu-item:hover, .menu-item.active {
    background: #424242;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: #23272e; /* Match sidebar background */
    border: 1px solid #2c313a;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
    display: none;
    z-index: 1001;
    padding: 4px 0;
    overflow: hidden; /* Prevent scroll bars in submenu */
}

.menu-item.active .submenu {
    display: block;
}

.submenu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Prevent content overflow */
}

.submenu-item:hover {
    background: #0078d4;
    color: #ffffff; /* White font on hover */
}

.submenu-item span:first-child {
    flex: 1;
}

.accelerator {
    color: #888888;
    font-size: 12px;
    margin-left: 20px;
}

.submenu-item:hover .accelerator {
    color: #ffffff; /* White accelerator text on hover */
}

.submenu-separator {
    height: 1px;
    background: #2c313a; /* Match border color */
    margin: 4px 0;
}

body {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 12px;
}

.vertical-sidebar {
    position: relative;
    top: 0;
    right: 0;
    height: 100%;
    width: var(--sidebar-width, 320px);
    background: transparent;
    display: flex;
    flex-direction: row;
    z-index: 100;
    box-shadow: none;
    overflow: visible;
    pointer-events: none;
    flex-shrink: 0;
}
.vertical-sidebar:not(.expanded) {
    width: 48px;
}

.sidebar-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    cursor: ew-resize;
    z-index: 3;
    pointer-events: auto;
    background: transparent;
    transition: background 0.15s;
}

.vertical-sidebar:not(.expanded) .sidebar-resize-handle {
    display: none;
}

.vertical-sidebar:not(.expanded) .sidebar-panel-container {
    width: 0;
    min-width: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}
.sidebar-panel-container {
    width: var(--panel-width, 272px);
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #23272e;
    box-shadow: -2px 0 8px rgba(0,0,0,0.08);
    border-left: 1px solid #2c313a;
    pointer-events: auto;
    overflow: hidden;
}
.sidebar-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #23272e;
    color: #bfc7d5;
    padding: 16px 12px;
    box-sizing: border-box;
    font-size: 16px;
    overflow-y: auto;
    z-index: 1;
}
.vertical-sidebar.expanded .sidebar-panel.active {
    display: block;
    opacity: 1;
}
.sidebar-panel:not(.active) {
    opacity: 0;
    pointer-events: none;
}
.sidebar-icons {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 16px;
    gap: 12px;
    background: #181c22;
    position: absolute;
    right: 0;
    top: 0;
    z-index: 2;
    box-shadow: -2px 0 8px rgba(0,0,0,0.08);
    pointer-events: auto;
    border-left: 1.5px solid #353b45;
}
.sidebar-icon {
    background: none;
    border: none;
    color: #bfc7d5;
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.sidebar-icon.active, .sidebar-icon:hover {
    background: #353b45;
    color: #fff;
}
html, body {
  background: #181c20;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
/* Split horizontal separator for channel and waveform section (single definition) */
/* Note: Now using border-bottom on .waveform-row instead of dedicated elements */

.waveform-main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.waveform-container {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.waveform-main-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.waveform-root {
  display: flex;
  flex-direction: row;
  gap: 0px;
  background: #181a20;
  padding: 0;
  height: calc(100vh - var(--menu-bar-height)); /* Account for menu bar */
  box-sizing: border-box;
  overflow: hidden; /* Prevent any scroll bars */
}

.waveform-container {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.signal-manager-root {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.signal-manager-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.search-container {
    position: relative;
    flex-shrink: 0;
    padding: 0;
    margin-bottom: 8px;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-35%);
    color: #6b7280;
    font-size: 14px;
    pointer-events: none;
    filter: grayscale(100%);
}

.search-input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    background: #2c313a;
    border: 1px solid #444;
    color: #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
}

.search-input::placeholder {
    color: #6b7280;
}

.virtual-list-scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

.virtual-list-viewport {
    position: relative;
}

.virtual-list-spacer {
    width: 1px;
}

.virtual-list-items {
    display: flex;
    flex-direction: column;
}

.virtual-list-empty {
    color: #6b7280;
    padding: 16px;
    text-align: center;
}

.signal-item {
    position: absolute;
    left: 0;
    right: 0;
}

.signal-item.hidden {
    display: none;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    cursor: pointer;
    transition: background-color 0.1s;
    color: #e5e7eb;
    font-size: 13px;
    width: 100%;
    box-sizing: border-box;
    padding-left: calc(8px + var(--indent, 0px));
}

.tree-node:hover {
    background: #2a2d3a;
}

.tree-node.drop-target {
    background: #3b82f6;
    outline: 2px solid #60a5fa;
    outline-offset: -2px;
}

.tree-node.expandable {
    cursor: pointer;
}

.tree-node.leaf {
    cursor: pointer;
}

.tree-node.leaf:hover {
    background: #2a2d3a;
}

.tree-toggle {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-label {
    flex: 1;
    user-select: none;
    white-space: nowrap;
    overflow: visible;
    line-height: 1;
}

.tree-label mark {
    background: #fbbf24;
    color: #1f2937;
    padding: 0;
    border-radius: 2px;
    display: inline;
    line-height: inherit;
}

.tree-remove-btn {
    width: 18px;
    height: 18px;
    margin-left: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9ca3af;
    transition: all 0.1s;
    cursor: pointer;
    border-radius: 3px;
}

.tree-remove-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}
