/* ═══════════════════════════════════════════════════════════
   Shared / Generic Buttons & Controls
════════════════════════════════════════════════════════════ */
.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 4px;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* ── Input Group (Add Stream) ────────────────────────────── */
.input-group {
    display: flex;
    background: rgba(24, 24, 27, 0.6);
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    overflow: hidden;
}

.input-group:focus-within {
    border-color: var(--accent);
}

.platform-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: rgba(30, 30, 36, 0.6);
    border-right: 1px solid var(--sidebar-border);
    font-size: 14px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.platform-icon:hover {
    background: rgba(45, 45, 54, 0.8);
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 5px 10px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    min-width: 0;
}

.purple-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0 12px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 13px;
    flex-shrink: 0;
}

.purple-btn:hover {
    background: var(--accent-hover);
}

.error-msg {
    color: #ff6b6b;
    font-size: 12px;
    margin-top: 4px;
    min-height: 15px;
}

/* ── Layout Controls (Settings section) ──────────────────── */
.controls-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.control-btn {
    flex: 1;
    background: rgba(46, 46, 54, 0.6);
    border: none;
    color: var(--text-primary);
    padding: 8px 0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.control-btn:hover {
    background: #3e3e48;
}

.layout-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.toggle-group {
    display: flex;
    background: rgba(12, 12, 14, 0.4);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}

.toggle-group.disabled {
    opacity: 0.5;
}

.toggle-group.disabled .toggle-btn {
    pointer-events: none;
}

.toggle-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 5px 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.toggle-btn.active {
    background: linear-gradient(135deg, #a970ff, #7c3aed);
    color: white;
    box-shadow: 0 4px 12px rgba(169, 112, 255, 0.35);
}

.toggle-btn i,
.toggle-icon {
    font-size: 13px;
    /* width: 16px;
    height: 16px;
    stroke-width: 2.5; */
}

/* ── Slider ──────────────────────────────────────────────── */
.styled-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #3e3e48;
    outline: none;
    margin-top: 8px;
    margin-bottom: 4px;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    transition: background 0.2s;
}

.styled-slider::-webkit-slider-thumb:hover {
    background: var(--accent-hover);
}

/* ── Floating Action Buttons ─────────────────────────────── */
.float-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.2s, background 0.2s;
    opacity: 1;
    font-size: 18px;
}

/* Hide buttons only when sidebar is closed and not hovered */
body:not(.sidebar-open) .floating-controls:not(:hover) .float-btn {
    opacity: 0;
}

.float-btn:hover {
    background: var(--accent-hover);
}

/* ── Active Streams List ─────────────────────────────────── */
.stream-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stream-item {
    display: flex;
    align-items: center;
    background: rgba(46, 46, 54, 0.6);
    padding: 6px 12px 6px 8px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: grab;
    user-select: none;
    transition: transform 0.2s, background 0.2s, border-color 0.2s;
    gap: 8px;
}

.drag-handle {
    color: var(--text-muted);
    font-size: 12px;
    cursor: grab;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.stream-item:hover .drag-handle {
    opacity: 1;
}

.stream-item:active {
    cursor: grabbing;
}

.stream-item.dragging {
    opacity: 0.4;
    cursor: grabbing;
    background: rgba(169, 112, 255, 0.1);
    border: 1px dashed var(--accent);
}

.stream-item.drag-over {
    border-top: 2px solid var(--accent);
    transform: translateY(2px);
}

.stream-item-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stream-item-info i.fa-twitch {
    color: #a970ff;
}

.stream-item-info i.fa-youtube {
    color: #ff0000;
}

.stream-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.focus-stream-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.focus-stream-btn:hover {
    color: white;
}

.focus-stream-btn.active {
    color: #ffd700;
}

.remove-stream-btn {
    background: transparent;
    border: none;
    color: #ff6b6b;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.remove-stream-btn:hover {
    opacity: 1;
}

.empty-msg {
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    margin-top: 6px;
}

/* ── Section Header Row ──────────────────────────────────── */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-header-row h3 {
    margin-bottom: 0;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-all-btn {
    background: transparent;
    color: #ff6b6b;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.clear-all-btn:hover {
    background: rgba(255, 107, 107, 0.12);
}

.save-group-btn {
    background: transparent;
    color: var(--accent);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.save-group-btn:hover {
    background: rgba(169, 112, 255, 0.12);
}

/* ── Dropdown Select ───────────────────────────────────────── */
.styled-select {
    width: 100%;
    background: #111115;
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.styled-select:focus {
    border-color: var(--accent);
}

.styled-select option {
    background: #18181b;
    color: white;
}

/* ═══════════════════════════════════════════════════════════
   Stream Groups Browser
════════════════════════════════════════════════════════════ */
.groups-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.group-item {
    border-radius: 8px;
    border: 1px solid var(--sidebar-border);
    background: rgba(24, 24, 27, 0.6);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.group-header:hover {
    background: #2e2e36;
}

.group-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.group-chevron {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.group-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.group-count-badge {
    background: rgba(169, 112, 255, 0.18);
    color: var(--accent);
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    flex-shrink: 0;
}

.group-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.group-action-btn {
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: background 0.15s, color 0.15s;
}

.group-load-btn {
    color: #4ade80;
}

.group-load-btn:hover {
    background: rgba(74, 222, 128, 0.12);
    color: #22c55e;
}

.group-delete-btn {
    color: #ff6b6b;
}

.group-delete-btn:hover {
    background: rgba(255, 107, 107, 0.12);
}

/* Expanded stream rows */
.group-stream-list {
    border-top: 1px solid var(--sidebar-border);
    background: #111115;
    display: flex;
    flex-direction: column;
}

.group-stream-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid rgba(46, 46, 54, 0.5);
    transition: background 0.15s;
}

.group-stream-row:last-child {
    border-bottom: none;
}

.group-stream-row:hover {
    background: rgba(46, 46, 54, 0.6);
}

.group-stream-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-primary);
    min-width: 0;
}

.group-stream-info i.fa-twitch {
    color: #a970ff;
    flex-shrink: 0;
}

.group-stream-info span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-stream-add-btn {
    background: rgba(169, 112, 255, 0.15);
    border: 1px solid rgba(169, 112, 255, 0.3);
    color: var(--accent);
    border-radius: 5px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.group-stream-add-btn:hover {
    background: rgba(169, 112, 255, 0.3);
    border-color: var(--accent);
}

.group-empty-note {
    padding: 10px 14px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════
   Save Group Modal
════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: rgba(28, 28, 34, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--sidebar-border);
    border-radius: 14px;
    padding: 28px 28px 24px;
    width: 420px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.modal-title i {
    color: var(--accent);
}

.modal-disclaimer {
    background: rgba(169, 112, 255, 0.08);
    border: 1px solid rgba(169, 112, 255, 0.22);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
}

.modal-disclaimer i {
    color: var(--accent);
    margin-right: 8px;
}

.modal-disclaimer strong {
    color: #c084fc;
}

.modal-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

.modal-input {
    width: 100%;
    background: #111115;
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    color: white;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: flex-end;
}

.modal-btn {
    border: none;
    border-radius: 8px;
    padding: 9px 20px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.modal-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.modal-btn-cancel {
    background: #2e2e36;
    color: var(--text-muted);
}

.modal-btn-save {
    background: linear-gradient(135deg, #a970ff, #7c3aed);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   Followed Channels List
════════════════════════════════════════════════════════════ */
.followed-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.followed-item {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    text-decoration: none;
}

.followed-item:hover {
    background: rgba(46, 46, 54, 0.6);
}

.followed-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
}

.followed-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.followed-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.followed-game {
    font-size: 11px;
    color: #a0a0ab;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.followed-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-primary);
    flex-shrink: 0;
    font-weight: 500;
}

.followed-viewers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background-color: #ff0000;
    border-radius: 50%;
}

/* ── Dropdown Menus ──────────────────────────────────────── */
.menu-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.dropdown-menu-container {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    /* Default relative to container if not set by JS */
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #18181b;
    border: 1px solid var(--sidebar-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    min-width: 150px;
    flex-direction: column;
    padding: 4px 4px;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.dropdown-item i {
    width: 16px;
    text-align: center;
}

.dropdown-item:hover {
    background: rgba(46, 46, 54, 0.8);
}

.dropdown-item.danger {
    color: #ff6b6b;
}

.dropdown-item.danger:hover {
    background: rgba(255, 107, 107, 0.15);
}