/* ==========================================================================
   NODE & CHANNEL EXPLORER SPECIFIC STYLES
   ========================================================================== */

/* Explorer Container */
.explorer-container {
    width: 100%;
}

/* Explorer Controls */
.explorer-controls {
    max-width: 1200px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

/* Unified Controls Row - All primary controls on one line */
.controls-row-unified {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.controls-row-unified .search-container {
    flex: 1;
    min-width: 250px;
    max-width: 450px;
}

/* Search divider for channel explorer (between two node search boxes) */
.search-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.2rem;
    padding: 0 0.5rem;
    flex-shrink: 0;
}

.search-divider i {
    opacity: 0.6;
}

/* Search hint for channel explorer */
.search-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(232, 145, 107, 0.1);
    border: 1px solid rgba(232, 145, 107, 0.3);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.search-hint i {
    color: var(--primary);
    font-size: 1rem;
}

.controls-row-unified .filter-select {
    min-width: 200px;
}

.controls-row-unified .reset-btn {
    padding: 0.75rem 1rem;
    min-width: auto;
}

.controls-row-unified .reset-btn i {
    margin: 0;
}

/* View Toggle */
.view-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.view-btn {
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.view-btn.active {
    background: var(--primary);
    color: var(--surface);
}

/* Filter Group */
.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    min-width: 160px;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Node Explorer Container */
.node-explorer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.node-explorer-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Grid View */
.grid-view .node-explorer-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* List View */
.list-view .node-explorer-grid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.node-item.list-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.node-item.list-item:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
}

.node-rank {
    font-weight: 600;
    color: var(--primary);
    min-width: 60px;
}

.node-rank-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary);
    color: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.node-info {
    min-width: 0;
}

.node-info .node-alias {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-info .node-type {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.node-metrics {
    display: flex;
    gap: 2rem;
}

.metric {
    text-align: right;
}

.metric-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.metric-value {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

/* Node Cap Tier (used in grid view) */
.node-cap-tier {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* Filter Presets */
.filter-presets-row {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.filter-presets {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.presets-label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-preset {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-preset:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.filter-preset i {
    font-size: 0.8rem;
}

/* Advanced Filters */
.advanced-filters-section {
    margin: 1.5rem 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.advanced-filters-section .section-header {
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    margin-bottom: 0;
    transition: background 0.2s ease;
}

.advanced-filters-section .section-header:hover {
    background: var(--bg-tertiary);
}

.advanced-filters-section .section-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.toggle-filters {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toggle-filters:hover {
    background: rgba(232, 145, 107, 0.1);
    color: var(--primary);
}

.advanced-filters-section.expanded .toggle-filters i {
    transform: rotate(180deg);
}

.filters-grid {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 100%;
}

.advanced-filters-section.expanded .filters-grid {
    display: grid;
}

/* Filter Category */
.filter-category {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    min-width: 0;
    max-width: 100%;
}

.filter-category h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.category-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem 0;
    line-height: 1.4;
    font-style: italic;
    opacity: 0.9;
}

.filter-category h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.range-filter {
    margin-bottom: 1rem;
}

.range-filter:last-child {
    margin-bottom: 0;
}

.range-filter label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.range-inputs input {
    flex: 1;
    min-width: 0;
    max-width: calc(50% - 0.25rem);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    box-sizing: border-box;
}

.range-inputs input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(232, 145, 107, 0.1);
}

.range-inputs input:not(:placeholder-shown) {
    border-color: var(--primary);
    background: rgba(232, 145, 107, 0.05);
}

.range-separator {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 0.25rem;
}

/* Filter Statistics */
.filter-stats {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    text-align: center;
}

.filter-stats #filterStats {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Filter helper text */
.filter-helper {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    font-style: italic;
    opacity: 0.8;
}

/* Filter count badge */
.filter-count-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Coming soon note for disabled features */
.coming-soon-note {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: 0.5rem;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-row-unified {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 1rem;
    }

    .controls-row-unified .search-container {
        max-width: 100%;
        min-width: 100%;
    }
    
    .search-divider {
        display: none; /* Hide arrow on mobile, it's implied by vertical stacking */
    }
    
    .search-hint {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .controls-row-unified .filter-select {
        min-width: 100%;
        width: 100%;
    }

    .controls-row-unified .view-toggle {
        width: 100%;
    }

    .controls-row-unified .view-btn {
        flex: 1;
    }

    .controls-row-unified .reset-btn {
        width: 100%;
        justify-content: center;
    }

    .filter-group {
        justify-content: center;
    }

    .grid-view .node-explorer-grid {
        grid-template-columns: 1fr;
    }

    .node-metrics {
        flex-direction: column;
        gap: 0.5rem;
        text-align: left;
    }

    .filter-presets {
        justify-content: flex-start;
    }
    
    .filter-preset {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .filter-category {
        padding: 1rem;
    }
    
    .range-inputs {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }
    
    .range-inputs input {
        max-width: 100%;
        width: 100%;
    }
    
    .range-separator {
        text-align: center;
        font-size: 0.8rem;
        padding: 0.25rem 0;
    }
}