/* Channel browser + typeahead styles */

.typeahead-wrap {
    position: relative;
}

.typeahead-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: #1f2937;
    border: 1px solid #4b5563;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    z-index: 60;
}

.typeahead-dropdown.hidden {
    display: none;
}

.typeahead-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #374151;
}

.typeahead-item:last-child {
    border-bottom: none;
}

.typeahead-item:hover,
.typeahead-item.active {
    background: #374151;
}

.typeahead-item-mark {
    background: #f59e0b33;
    color: #fbbf24;
}

.typeahead-item-primary {
    font-size: 0.875rem;
    font-weight: 600;
    color: #f3f4f6;
}

.typeahead-item-meta {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 2px;
}

.typeahead-empty {
    padding: 12px;
    font-size: 0.8rem;
    color: #9ca3af;
    text-align: center;
}

/* Channel pool — tab layout (phase 3) */

.channel-browser {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
}

.channel-browser-header {
    padding: 16px;
    border-bottom: 1px solid #374151;
    background: #111827;
}

.picklist-status {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 8px;
}

.picklist-status.live { color: #22c55e; }
.picklist-status.api { color: #3b82f6; }
.picklist-status.cached-local { color: #fbbf24; }
.picklist-status.unavailable { color: #f87171; }

.channel-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px 0;
    background: #111827;
    border-bottom: 1px solid #374151;
}

.channel-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 2px solid #374151;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #1f2937;
    color: #9ca3af;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-bottom: -1px;
}

.channel-tab:hover {
    color: #e5e7eb;
    background: #273040;
}

.channel-tab.active {
    color: #f3f4f6;
    background: #1f2937;
    position: relative;
    z-index: 1;
}

.channel-tab.column-border-green.active  { border-color: #22c55e; color: #86efac; }
.channel-tab.column-border-red.active    { border-color: #ef4444; color: #fca5a5; }
.channel-tab.column-border-yellow.active { border-color: #eab308; color: #fde047; }
.channel-tab.column-border-blue.active   { border-color: #3b82f6; color: #93c5fd; }
.channel-tab.column-border-cyan.active  { border-color: #06b6d4; color: #67e8f9; }
.channel-tab.column-border-sky.active   { border-color: #93c5fd; color: #bae6fd; }

.channel-tab-count {
    font-size: 0.65rem;
    font-weight: 600;
    background: #111827;
    color: #9ca3af;
    padding: 1px 7px;
    border-radius: 999px;
    min-width: 1.5rem;
    text-align: center;
}

.channel-browser-body {
    padding: 16px;
    min-height: 200px;
}

.channel-tab-panel {
    display: none;
    border: 2px solid #374151;
    border-radius: 0 8px 8px 8px;
    background: #111827;
    padding: 12px;
    min-height: 180px;
}

.channel-tab-panel.active {
    display: block;
}

.channel-tab-panel.column-border-green  { border-color: #22c55e; }
.channel-tab-panel.column-border-red    { border-color: #ef4444; }
.channel-tab-panel.column-border-yellow { border-color: #eab308; }
.channel-tab-panel.column-border-blue   { border-color: #3b82f6; }
.channel-tab-panel.column-border-cyan   { border-color: #06b6d4; }
.channel-tab-panel.column-border-sky    { border-color: #93c5fd; }

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
    padding: 4px;
}

.channel-tab-empty,
.channel-tab-no-results {
    grid-column: 1 / -1;
    padding: 32px 16px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

.column-border-green  { --block-accent: #22c55e; }
.column-border-red    { --block-accent: #ef4444; }
.column-border-yellow { --block-accent: #eab308; }
.column-border-blue   { --block-accent: #3b82f6; }
.column-border-cyan   { --block-accent: #06b6d4; }
.column-border-sky    { --block-accent: #93c5fd; }

.channel-tag-heading {
    grid-column: 1 / -1;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
    padding: 8px 4px 4px;
    border-bottom: 1px solid #374151;
    margin-bottom: 4px;
}

.channel-block-tag {
    font-size: 0.55rem;
    color: #6b7280;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Draggable channel blocks */

.channel-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 6px 4px;
    background: #0a0a0a;
    border: 2px solid var(--block-accent, #555);
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    transition: transform 0.12s, opacity 0.12s, box-shadow 0.12s;
    text-align: center;
}

.channel-block:hover {
    box-shadow: 0 0 10px color-mix(in srgb, var(--block-accent) 40%, transparent);
    transform: translateY(-1px);
}

.channel-block:active {
    cursor: grabbing;
}

.channel-block.is-dragging {
    opacity: 0.45;
    transform: scale(0.95);
}

.channel-block.hidden-by-filter {
    display: none;
}

.channel-block-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #f3f4f6;
    text-transform: uppercase;
    line-height: 1.2;
    word-break: break-word;
}

.channel-block-sublabel {
    font-size: 0.6rem;
    color: #9ca3af;
    line-height: 1.2;
    margin-top: 2px;
    word-break: break-word;
}

.catalog-empty {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}
