:root {
    --bg-dark: #070709;
    --card-bg: rgba(18, 18, 24, 0.45);
    --card-bg-solid: #121218;
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-glow: rgba(139, 92, 246, 0.2);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary-accent: #a78bfa;
    --primary-glow: rgba(139, 92, 246, 0.35);
    --primary-hover: #c084fc;
    --success-color: #34d399;
    --danger-color: #f87171;
    --input-bg: rgba(255, 255, 255, 0.03);
    --glass-blur: blur(20px);

    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    padding: 40px 20px;
}

/* Background Glowing Accents */
.glass-bg-glows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-1 {
    position: absolute;
    top: 10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
}

.glow-2 {
    position: absolute;
    bottom: 10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
}

/* Main Card Overhaul */
.card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    max-width: 1160px;
    width: 100%;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    position: relative;
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    transition:
        max-width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.4s ease;
}

.card.sidebar-collapsed {
    max-width: 660px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Two-Column Grid */
.grid-container {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    transition:
        grid-template-columns 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        gap 0.4s ease;
}

.card.sidebar-collapsed .grid-container {
    grid-template-columns: 1fr 0fr;
    gap: 0;
}

.sidebar-toggle {
    position: absolute;
    left: 100%; /* Sits exactly flush after the right edge of the card */
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 120px;
    background: rgba(18, 18, 24, 0.75); /* Glassmorphic matching card bg */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(139, 92, 246, 0.45);
    border-left: none; /* Open on the left, flush against the card border */
    border-radius: 0 12px 12px 0; /* Rounded top-right and bottom-right, flat left */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #c084fc;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
    box-shadow: 6px 0 15px rgba(139, 92, 246, 0.15); /* Shadow extends to the right */
    padding: 10px 0;
}

.sidebar-toggle .toggle-text {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #c084fc;
    user-select: none;
    transition: color 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: rgba(168, 85, 247, 0.8);
    border-left: none;
    color: #ffffff;
    width: 30px; /* Expands slightly outwards on hover */
    box-shadow: 8px 0 20px rgba(139, 92, 246, 0.3);
}

.sidebar-toggle:hover .toggle-text {
    color: #ffffff;
}

.sidebar-toggle:active {
    width: 24px;
}

.sidebar-toggle .toggle-icon {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Rotate chevron when collapsed */
.card.sidebar-collapsed .sidebar-toggle .toggle-icon {
    transform: rotate(180deg);
}

@media (max-width: 900px) {
    .grid-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .card.sidebar-collapsed .grid-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Hide button on small screens since emulator collapses completely */
    .sidebar-toggle {
        display: none;
    }
}

/* Brand Header */
.brand-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px; /* Improved spacing */
    width: fit-content;
    margin-left: 0;
    transform: translateX(0);
    transition:
        margin-left 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card.sidebar-collapsed .brand-header {
    margin-left: 50%;
    transform: translateX(-50%);
}

.brand-logo {
    width: 52px;
    height: 52px;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    background: linear-gradient(135deg, #ffffff 40%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.pro-tag {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.8px;
    background: linear-gradient(135deg, #8b5cf6, #38bdf8);
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

/* Features Intro Section */
.features-container {
    margin-bottom: 32px;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.features-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-accent);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(56, 189, 248, 0.08) 100%);
    border: 1px solid rgba(139, 92, 246, 0.25);
    padding: 6px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 16px;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.06);
    transition: all 0.3s ease;
}

.features-badge:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18) 0%, rgba(56, 189, 248, 0.12) 100%);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.badge-icon {
    width: 13px;
    height: 13px;
    color: var(--primary-accent);
    flex-shrink: 0;
}

.tagline {
    font-size: 14px;
    line-height: 1.6;
    color: #e5e7eb;
    margin-bottom: 24px;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-item:hover {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.22);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.08);
}

.feature-item .icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-accent);
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-item:hover .icon-wrapper {
    background: rgba(139, 92, 246, 0.22);
    color: var(--primary-hover);
    transform: scale(1.08);
}

.feature-svg {
    width: 15px;
    height: 15px;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-text strong {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.feature-text span {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Collapsed Sidebar Alignment */
.card.sidebar-collapsed .features-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card.sidebar-collapsed .features-badge {
    justify-content: center;
}

.card.sidebar-collapsed .tagline {
    text-align: center;
}

.card.sidebar-collapsed .features-grid {
    grid-template-columns: repeat(2, 1fr);
    max-width: 580px;
    justify-content: center;
}

.card.sidebar-collapsed .feature-item {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 14px;
}

.card.sidebar-collapsed .feature-text {
    align-items: center;
    text-align: center;
}

/* Mobile & Small Screens Alignment */
@media (max-width: 600px) {
    .features-grid {
        grid-template-columns: 1fr !important;
    }
    .features-container {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .features-badge {
        justify-content: center;
    }
    .tagline {
        text-align: center;
    }
    .feature-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 16px 14px;
    }
    .feature-text {
        align-items: center;
        text-align: center;
    }
}

/* Inputs & Form Groups */
.input-group {
    text-align: left;
    margin-bottom: 32px; /* Improved spacing */
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e5e7eb;
    letter-spacing: 0.3px;
}

input[type='password'],
input[type='text'] {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

input[type='password']:focus,
input[type='text']:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
    background: rgba(255, 255, 255, 0.05);
}

/* Custom Glassmorphic Select Styles */
.custom-select-container {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-trigger:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.custom-select-trigger .chevron {
    color: var(--text-muted);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-container.open .chevron {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: 100%;
    background: rgba(20, 20, 27, 0.95);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    z-index: 100;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-container.open .custom-select-options {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.custom-option {
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.custom-option:hover,
.custom-option:focus {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    outline: none;
}

.custom-option.selected {
    background: rgba(139, 92, 246, 0.18);
    color: var(--text-main);
    font-weight: 500;
    border-left: 3px solid var(--primary-accent);
    padding-left: 9px;
}

/* Checkboxes */
.checkboxes-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px; /* Improved spacing */
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-group input[type='checkbox'] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--input-bg);
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: all 0.15s ease;
    margin-right: 12px;
    outline: none;
    flex-shrink: 0;
}

.checkbox-group input[type='checkbox']:hover {
    border-color: var(--primary-accent);
}

.checkbox-group input[type='checkbox']:checked {
    border-color: var(--primary-accent);
    background: var(--primary-accent);
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.checkbox-group input[type='checkbox']::before {
    content: '';
    width: 8px;
    height: 8px;
    transform: scale(0);
    transition: 100ms transform ease-in-out;
    box-shadow: inset 1em 1em white;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-group input[type='checkbox']:checked::before {
    transform: scale(1.2);
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    color: #d1d5db;
}

.optional-text {
    font-size: 11px;
    color: var(--text-muted);
    display: block;
    margin-top: 6px; /* Improved spacing */
    font-weight: 400;
}

/* Buttons */
.primary-btn {
    background: linear-gradient(135deg, var(--primary-accent), var(--primary-hover));
    color: #0c0a0f;
    border: none;
    padding: 14px;
    font-size: 15px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    width: 100%;
    margin-top: 12px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(0);
}

/* API Key wrapper */
.api-key-input-wrapper {
    position: relative;
}

.api-key-input-wrapper input {
    padding-right: 42px;
}

.api-key-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.api-key-toggle:hover {
    color: var(--text-main);
}

.error-text {
    color: var(--danger-color);
    font-size: 12px;
    margin-top: 6px;
    display: none;
}

/* Result Container */
#result-container {
    display: none;
    margin-top: 24px;
    border: 1px dashed var(--border-color-glow);
    border-radius: 12px;
    padding: 16px;
    background: rgba(139, 92, 246, 0.03);
    animation: fadeUp 0.4s ease;
}

.success-message {
    font-size: 13px;
    color: var(--success-color);
    margin-bottom: 12px;
    font-weight: 500;
}

.code-box {
    background: rgba(0, 0, 0, 0.45);
    padding: 12px;
    border-radius: 8px;
    word-break: break-all;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: var(--primary-accent);
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    text-align: left;
}

.copy-btn {
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid var(--primary-accent);
    color: var(--primary-accent);
    padding: 10px;
    font-weight: 600;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

/* Emulator Panel Styling */
.emulator-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition:
        opacity 0.3s ease,
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.4s;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    min-width: 0;
}

.card.sidebar-collapsed .emulator-panel {
    opacity: 0;
    visibility: hidden;
    transform: translateX(24px);
    pointer-events: none;
    overflow: hidden;
}

/* Interactive Test Bench Card */
.test-bench {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
}

.preview-label {
    font-family: var(--font-heading);
    font-size: 11px;
    color: var(--primary-accent);
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: block;
}

.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
}

.search-row input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 10px 36px 10px 14px;
    font-size: 13px;
    width: 100%;
    outline: none;
    font-family: inherit;
    transition: border 0.15s ease;
}

.search-row input:focus {
    border-color: var(--primary-accent);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.clear-search-btn:hover {
    color: var(--text-main);
}

.search-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 8px;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.search-btn:hover {
    background: var(--primary-accent);
    color: #0c0a0f;
    border-color: var(--primary-accent);
}

.lookup-status {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: none;
}

.lookup-status.error {
    color: var(--danger-color);
}

.lookup-status.success {
    color: var(--success-color);
}

.manual-toggles-section {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 14px;
}

.small-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

/* Test Control Toggles */
.test-controls {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.test-controls::-webkit-scrollbar {
    height: 4px;
}

.test-controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.test-controls label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--input-bg);
    padding: 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.15s ease;
    cursor: pointer;
    white-space: nowrap;
    margin-bottom: 0;
}

.test-controls label:hover {
    border-color: var(--primary-accent);
    color: var(--text-main);
}

.test-controls label:has(input:checked) {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary-accent);
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.15);
}

.test-controls label:has(input:disabled) {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.test-controls input[type='checkbox'] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Stremio Client Emulator Sidebar Mockup */
.stremio-emulator {
    background: #0f1015;
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.emulator-header {
    background: #151722;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.emulator-dots {
    display: flex;
    gap: 6px;
    margin-right: 14px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.dot.red {
    background-color: #ef4444;
}
.dot.yellow {
    background-color: #f59e0b;
}
.dot.green {
    background-color: #10b981;
}

.emulator-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.emulator-body {
    padding: 16px;
    background-color: #0c0d12;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.streams-header {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    color: #5d606f;
    letter-spacing: 1.2px;
    margin-bottom: 12px;
    padding-left: 2px;
}

.streams-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden; /* Prevent horizontal scrollbar on hover */
    padding-right: 2px;
}

.streams-list::-webkit-scrollbar {
    width: 6px;
}

.streams-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

/* Stremio Stream Box */
.stream-box {
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.stinger-stream {
    background: rgba(139, 92, 246, 0.07);
    border-color: rgba(139, 92, 246, 0.15);
    border-left: 4px solid var(--primary-accent);
}

.stinger-stream:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateX(4px);
}

.stream-details {
    flex-grow: 1;
    min-width: 0;
}

.stream-addon-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    align-self: flex-start; /* Align logo to top of stream box */
    margin-top: 2px; /* Slight offset to align with title text */
}

.stream-box:hover .stream-addon-logo {
    transform: scale(1.1);
}

.stream-title {
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.stream-desc {
    color: #b3b3b9;
    font-size: 11px;
    line-height: 1.65; /* Improved line spacing between sections of text */
    word-break: break-word;
    font-family: var(--font-body);
}

/* Dummy Stream styling */
.dummy-stream {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.04);
}

.dummy-stream:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.dummy-stream-meta {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 4px;
}

.source-name {
    color: #9ca3af;
}

.resolution {
    background: #1f2937;
    color: #d1d5db;
    padding: 0px 4px;
    border-radius: 3px;
    font-size: 9px;
}

.dummy-stream-filename {
    color: #6b7280;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 8px 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer styling */
.footer {
    margin-top: 40px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 20px;
    text-align: center;
}

.footer-link {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
}

/* Checkbox alignment helpers */
.checkbox-group--top-align {
    align-items: flex-start;
}

.checkbox-group--top-align input[type='checkbox'] {
    margin-top: 3px;
}

/* Powered by Section */
.powered-by-section {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.powered-by-label {
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.5;
}

.powered-by-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.powered-by-item {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.powered-by-item:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.powered-by-item svg,
.powered-by-item img {
    display: block;
}

.logo-aftercredits {
    height: 32px;
    width: auto;
}

.logo-tmdb {
    height: 32px;
    width: auto;
}

.logo-wikipedia {
    height: 32px;
    width: auto;
}
