@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&display=swap');

:root {
    --bst-font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --bst-bg-main: #000;
    --bst-bg-secondary: rgba(255, 255, 255, 0.06);
    --bst-bg-secondary-hover: rgba(255, 255, 255, 0.1);
    --bst-pill-bg: rgba(255, 255, 255, 0.12);
    --bst-type-primary: var(--primaryTextColor, #fff);
    --bst-type-secondary: var(--secondaryTextColor, rgba(255, 255, 255, 0.6));
    --bst-accent: var(--theme-primary-color, var(--buttonBackground, #00a4dc));
    --bst-accent-hover: var(--theme-primary-color, var(--buttonBackgroundHover, #0aa7dc));
    --bst-border-primary: rgba(255, 255, 255, 0.12);
}

.bst-popout-wrapper,
.bst-popout-wrapper *,
.bst-quality-wrapper,
.bst-quality-wrapper * {
    font-family: var(--bst-font-family) !important;
}

.bst-popout-wrapper button,
.bst-popout-wrapper .bst-btn-request,
.bst-popout-wrapper .bst-btn-request-4k,
.bst-popout-wrapper .bst-btn-trailer,
.bst-popout-wrapper .bst-modal-close,
.bst-popout-wrapper h1,
.bst-popout-wrapper h3,
.bst-popout-wrapper p,
.bst-popout-wrapper span,
.bst-popout-wrapper bdi,
.bst-popout-wrapper .bst-overview,
.bst-popout-wrapper .bst-sidebar-lines,
.bst-popout-wrapper .bst-sidebar-lines .bst-label,
.bst-popout-wrapper .bst-hero-title-fallback,
.bst-popout-wrapper .bst-hero-meta,
.bst-popout-wrapper .bst-meta-emphasis,
.bst-popout-wrapper .bst-vote-muted,
.bst-popout-wrapper .bst-genre-pill,
.bst-popout-wrapper .bst-cast-name,
.bst-popout-wrapper .bst-cast-role,
.bst-popout-wrapper .bst-modal-loading,
.bst-quality-wrapper button,
.bst-quality-wrapper h3,
.bst-quality-wrapper .bst-quality-option,
.bst-quality-wrapper .bst-quality-empty {
    font-family: var(--bst-font-family) !important;
}

@keyframes bst-scale-in {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.bst-popout-wrapper {
    position: fixed;
    inset: 0;
    z-index: 999999;
    overflow: hidden;
    pointer-events: auto;
    user-select: none;
}

.bst-popout-backdrop {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0.9;
}

.bst-popout-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: env(safe-area-inset-top, 0);
    pointer-events: none;
}

.bst-aether-card {
    position: relative;
    width: 70%;
    height: 75%;
    max-width: 1200px;
    max-height: 850px;
    margin: -0.705em;
    border-radius: 1.5rem;
    background: var(--bst-bg-main);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .bst-aether-card {
        width: 95%;
        height: 97%;
    }
}

.bst-aether-card-inner {
    position: relative;
    height: 100%;
    transition: transform 0.3s ease;
}

.bst-modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    pointer-events: auto;
    border: none;
    border-radius: 9999px;
    background: #000;
    padding: 0;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.55);
    transition: color 0.15s ease;
}

.bst-modal-close svg {
    width: 1.35em;
    height: 1.35em;
}

.bst-modal-close:hover {
    color: #fff;
}

.bst-pill-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    border: 2px solid transparent;
    background: var(--bst-pill-bg);
    color: var(--bst-type-primary);
    transition: background-color 0.075s ease, color 0.075s ease, border-color 0.075s ease;
}

.bst-pill-btn svg {
    width: 1em;
    height: 1em;
}

.bst-modal-scroll {
    position: relative;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    pointer-events: auto;
    user-select: text;
    scrollbar-width: none;
}

.bst-modal-scroll::-webkit-scrollbar {
    display: none;
}

.bst-modal-layout {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.bst-hero {
    position: relative;
    z-index: 20;
    margin-top: -3rem;
    min-height: 480px;
    flex-shrink: 0;
    overflow: hidden;
}

.bst-hero-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgb(0, 0, 0) 150px);
    mask-image: linear-gradient(to top, rgba(0, 0, 0, 0), rgb(0, 0, 0) 150px);
}

.bst-hero-backdrop::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
}

.bst-hero-title-wrap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4.5rem;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0 1.5rem;
}

.bst-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--bst-type-secondary);
}

.bst-hero-meta .bst-dot {
    color: var(--bst-type-secondary);
}

.bst-meta-emphasis {
    color: rgba(255, 255, 255, 0.92);
}

.bst-hero-logo {
    max-width: 16rem;
    max-height: 12rem;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.5));
    background: transparent;
}

@media (min-width: 768px) {
    .bst-hero-logo {
        max-width: 20rem;
    }
}

@media (min-width: 1024px) {
    .bst-hero-logo {
        max-width: 30rem;
    }
}

.bst-hero-title-fallback {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--bst-type-primary);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8);
    margin: 0;
    line-height: 1.15;
}

.bst-content {
    padding: 0 1.5rem 1.5rem;
    margin-top: -70px;
    flex-grow: 1;
    position: relative;
    z-index: 30;
}

.bst-tmdb-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bst-tmdb-rating svg {
    width: 2em;
    height: 2em;
}

.bst-vote-muted {
    color: var(--bst-type-secondary);
}

.bst-request-notice {
    margin: 0 0 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.55rem;
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 600;
    color: #fecaca;
    background: #7f1d1d8c;
    border: 1px solid #f8717173;
}

.bst-actions-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .bst-actions-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.bst-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.bst-btn-request {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #005499;
    cursor: pointer;
    transition: background-color 0.1s ease, opacity 0.1s ease;
    flex: 1;
}

@media (min-width: 640px) {
    .bst-btn-request {
        flex: initial;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

.bst-btn-request:hover {
    background: #008bff;
}

.bst-btn-request:active {
    opacity: 0.85;
}

.bst-btn-request:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bst-btn-request-4k {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #5f6060;
    background: #0c0d0d;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, opacity 0.1s ease;
    flex: 1;
}

@media (min-width: 640px) {
    .bst-btn-request-4k {
        flex: initial;
    }
}

.bst-btn-request-4k:hover {
    background: #161818;
    color: #787a7a;
}

.bst-btn-request-4k:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.bst-btn-trailer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #5f6060;
    background: #0c0d0d;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, opacity 0.1s ease;
    flex: 1;
}

@media (min-width: 640px) {
    .bst-btn-trailer {
        flex: initial;
    }
}

.bst-btn-trailer:hover {
    background: #161818;
    color: #787a7a;
}

.bst-details-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.75rem;
    width: 100%;
    padding-top: 1.25rem;
    box-sizing: border-box;
}

.bst-details-main {
    flex: 1 1 0;
    min-width: 0;
}

.bst-overview {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--bst-type-primary);
    margin: 0 0 1rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

.bst-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.bst-genre-pill {
    display: inline-block;
    font-size: 0.8125rem;
    padding: 0.4rem 0.875rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bst-type-primary);
}

.bst-sidebar {
    flex: 0 0 auto;
    width: min(17.5rem, 34%);
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.125rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}

@media (max-width: 639px) {
    .bst-details-layout {
        flex-direction: column;
        gap: 1.25rem;
    }

    .bst-sidebar {
        width: 100%;
        max-width: none;
    }
}

.bst-sidebar-lines {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--bst-type-primary);
}

.bst-sidebar-lines {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.bst-quality-value {
    font-weight: 600;
}

.bst-sidebar-lines .bst-label {
    font-weight: 500;
    color: var(--bst-type-primary);
}

.bst-runtime-sep {
    color: var(--bst-type-secondary);
}

.bst-external-links {
    display: flex;
    gap: 0.75rem;
}

.bst-external-link {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    animation: bst-scale-in 0.6s ease-out forwards;
    transform: scale(0);
    opacity: 0;
}

.bst-external-link.tmdb {
    background: #0d253f;
    color: var(--bst-type-primary);
}

.bst-external-link.imdb {
    background: #f5c518;
    color: #000;
}

.bst-external-link svg {
    width: 1.25em;
    height: 1.25em;
}

.bst-cast-section {
    padding-top: 2.75rem;
    width: 100%;
}

.bst-cast-scroll {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    padding-bottom: 1rem;
    scrollbar-width: none;
}

.bst-cast-scroll::-webkit-scrollbar {
    display: none;
}

.bst-cast-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    width: 8rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.bst-cast-card:hover {
    opacity: 0.8;
}

.bst-cast-avatar {
    width: 8rem;
    height: 8rem;
    border-radius: 9999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.bst-cast-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bst-cast-name {
    font-weight: 500;
    font-size: 0.875rem;
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    margin-top: 0.5rem;
}

.bst-cast-role {
    font-size: 0.875rem;
    color: var(--bst-type-secondary);
    text-align: center;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bst-quality-wrapper {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

.bst-quality-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

.bst-quality-panel {
    position: relative;
    width: 92%;
    max-width: 420px;
    max-height: 80vh;
    border-radius: 1rem;
    background: var(--bst-bg-main);
    border: 1px solid var(--bst-border-primary);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bst-quality-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--bst-border-primary);
}

.bst-quality-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--bst-type-primary);
}

.bst-quality-close {
    border: none;
    background: transparent;
    color: var(--bst-type-secondary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

.bst-quality-close:hover {
    color: var(--bst-type-primary);
}

.bst-quality-list {
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bst-quality-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bst-border-primary);
    border-radius: 0.5rem;
    background: var(--bst-bg-secondary);
    color: var(--bst-type-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bst-quality-option:hover {
    background: var(--bst-bg-secondary-hover);
    border-color: var(--bst-border-primary);
}

.bst-quality-option-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--bst-type-secondary);
    margin-top: 0.25rem;
}

.bst-quality-empty,
.bst-quality-loading {
    padding: 1.5rem;
    text-align: center;
    color: var(--bst-type-secondary);
    font-size: 0.875rem;
}

.bst-quality-footer {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--bst-border-primary);
}

.bst-quality-continue {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: var(--bst-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, opacity 0.15s ease;
}

.bst-quality-continue:hover:not(:disabled) {
    background: var(--bst-accent-hover);
}

.bst-quality-continue:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bst-season-option {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bst-border-primary);
    border-radius: 0.5rem;
    background: var(--bst-bg-secondary);
    color: var(--bst-type-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.bst-season-option:hover {
    background: var(--bst-bg-secondary-hover);
}

.bst-season-select-all {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.bst-season-checkbox {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    accent-color: var(--bst-accent);
    cursor: pointer;
}

.bst-season-label {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bst-season-episodes {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--bst-type-secondary);
}

.bst-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bst-type-secondary);
    font-size: 0.875rem;
}
