
/* ══════════════════════════════════════════════════════════
DARK MODE — Select2
The dropdown is appended to <body>, so it doesn't inherit
data-bs-theme automatically. We target both the in-page
elements and the detached dropdown via [data-bs-theme=dark].
══════════════════════════════════════════════════════════ */

/* Selection box */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
    background-color: #131318;
    border-color: var(--mt-border-input);
    color: var(--bs-body-color);
    transition: border-color var(--mt-ease), box-shadow var(--mt-ease);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 textarea.select2-search__field::placeholder {
   color: #454558;
}

/* Selected pills */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--bs-secondary-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: var(--bs-danger);
    color: #fff;
}

/* Placeholder */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection .select2-selection__placeholder {
    color: var(--bs-secondary-color);
}

/* Clear button */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__clear,
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__clear {
    color: var(--bs-secondary-color);
}

/* Focus ring */
[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--focus .select2-selection,
[data-bs-theme="dark"] .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: rgba(230, 57, 80, 0.5);
    box-shadow: 0 0 0 3px var(--mt-accent-dim);
}

/* Validation error: Symfony puts is-invalid on the hidden <select>, the tube form also on .artists-wrapper */
[data-bs-theme="dark"] select.is-invalid + .select2-container--bootstrap-5 .select2-selection,
[data-bs-theme="dark"] .is-invalid > .select2-container--bootstrap-5 .select2-selection {
    border-color: var(--bs-form-invalid-border-color);
}

[data-bs-theme="dark"] select.is-invalid + .select2-container--bootstrap-5.select2-container--focus .select2-selection,
[data-bs-theme="dark"] select.is-invalid + .select2-container--bootstrap-5.select2-container--open .select2-selection,
[data-bs-theme="dark"] .is-invalid > .select2-container--bootstrap-5.select2-container--focus .select2-selection,
[data-bs-theme="dark"] .is-invalid > .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--bs-form-invalid-border-color);
    box-shadow: 0 0 0 3px rgba(var(--bs-danger-rgb), 0.25);
}

/* Dropdown panel — appended to <body>, needs its own dark vars */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
    border-color: rgba(230, 57, 80, 0.5);
    border-radius: .25rem;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
    padding: .25em .45em;
    font-size: .85rem;
}

[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field {
    background-color: var(--bs-secondary-bg);
    border-color: var(--mt-border-input);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

/* Results list */
[data-bs-theme="dark"] .select2-results__option {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
    background-color: var(--bs-primary);
    color: #fff;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option[aria-selected="true"],
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--selected {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-secondary-color);
}

/* Group headers */
[data-bs-theme="dark"] .select2-results__option[role="group"] .select2-results__group {
    color: var(--bs-secondary-color);
}

/* Loading / no-results message */
[data-bs-theme="dark"] .select2-results__message {
    color: var(--bs-secondary-color);
}

/* Inline search (non-dropdown) */
[data-bs-theme="dark"] .select2-search--inline .select2-search__field {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field {
    color: inherit;
    background-color: inherit;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23dee2e6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

h1.tube-watch-title {
    font-size: 2rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Smaller title and description of the video on phones */
@media (max-width: 575px) {
    h1.tube-watch-title {
        font-size: 1.4rem;
        line-height: 1.25;
        margin-top: .75rem;
    }

    .tube-description {
        font-size: .875rem;
        line-height: 1.5;
    }
}


.xdebug-error * {
    color: #000;
}

/* ── Home page header ─────────────────────────── */
.home-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--mt-text);
}

.home-count {
    font-size: 0.8rem;
    color: var(--mt-text-muted);
    font-weight: 400;
}

/* ── About page ───────────────────────────────── */
.about-page {
    max-width: 760px;
}

.about-lead {
    font-size: 1.1rem;
    color: var(--mt-text-muted);
    margin-bottom: 2.5rem;
}

.about-section {
    margin-bottom: 2rem;
}

.about-section h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.about-section p,
.about-section ul {
    color: var(--mt-text-muted);
    line-height: 1.7;
}

/* ── Help page (uses the About page styles) ───── */
.help-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-bottom: 2.5rem;
}

.help-part {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2.5rem 0 0.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--mt-border);
}

/* Anchors from the menus do not end under the fixed navbar */
.help-part,
.help-section {
    scroll-margin-top: calc(var(--mt-navbar-height, 74px) + 1rem);
}

.help-content {
    max-width: 760px;
}

/* Side menu: stays in place while the content scrolls, ScrollSpy marks the section in view as .active */
.help-sidebar {
    position: sticky;
    top: calc(var(--mt-navbar-height, 74px) + 1.5rem);
    max-height: calc(100vh - var(--mt-navbar-height, 74px) - 3rem);
    overflow-y: auto;
    padding: 0.5rem 0;
    border-left: 1px solid var(--mt-border);
}

.help-sidebar .nav-link {
    padding: 0.3rem 0.9rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--mt-text-muted);
    font-size: 0.9rem;
    transition: color var(--mt-ease), border-color var(--mt-ease);
}

.help-sidebar .nav-link:hover {
    color: var(--mt-text);
}

.help-sidebar .help-nav-part {
    margin-top: 0.75rem;
    font-weight: 600;
    color: var(--mt-text);
}

.help-sidebar .help-nav-part:first-child {
    margin-top: 0;
}

.help-sidebar .help-nav-item {
    padding-left: 1.6rem;
    font-size: 0.85rem;
}

.help-sidebar .nav-link.active {
    color: var(--mt-accent);
    border-left-color: var(--mt-accent);
}

.help-page .about-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.help-page .about-section ol {
    color: var(--mt-text-muted);
    line-height: 1.7;
}

.help-keys {
    list-style: none;
    padding-left: 0;
}

.help-keys kbd {
    display: inline-block;
    min-width: 2.2em;
    margin-right: 0.5rem;
    text-align: center;
    background: var(--mt-surface-2);
    border: 1px solid var(--mt-border-hover);
    color: var(--mt-text);
}

/* ── My timeline (profile) ───────────────────── */
.profile-timeline-day {
    margin: 1.5rem 0 0.5rem;
    padding-bottom: 0.3rem;
    font-weight: 600;
    border-bottom: 1px solid var(--mt-border);
}

.profile-timeline-day:first-child {
    margin-top: 0;
}

.profile-timeline-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--mt-radius-sm);
}

.profile-timeline-item:hover {
    background: var(--mt-surface);
}

.profile-timeline-item time {
    flex: none;
    width: 3rem;
    font-size: 0.85rem;
    color: var(--mt-text-muted);
    font-variant-numeric: tabular-nums;
}

.profile-timeline-thumb {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--mt-radius-sm);
    background: var(--mt-surface-2);
    color: var(--mt-text-muted);
}

.profile-timeline-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-timeline-channel img {
    width: auto;
    aspect-ratio: 1;
    border-radius: 50%;
}

.profile-timeline-body {
    min-width: 0;
}

.profile-timeline-body > a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Sort bar ─────────────────────────────────── */
.sort-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    padding: 0.6rem 0.9rem;
    background: var(--mt-surface);
    border: 1px solid var(--mt-border);
    border-radius: var(--mt-radius);
}

.sort-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--mt-text-subtle);
    margin-right: 0.25rem;
}

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.sort-group-label {
    font-size: 0.78rem;
    color: var(--mt-text-muted);
    margin-right: 0.15rem;
}

.active .sort-group-label {
    color: var(--mt-text);
}

/* ── Pagination bar ───────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--mt-text-muted);
}


.create-badge {
    background-color: #ffca28;
    margin-left: .5rem;
    padding: 5px;
    font-size: 80%;
}

.create-badge:hover {
    background-color: #ffc107;
}


/* Tag input in the tube form, templates/_includes/_tag_input.html.twig */
.ti { position: relative; }
.ti-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    min-height: calc(1.5em + .75rem + 2px);
    cursor: text;
}
.ti-box:focus-within {
    border-color: var(--bs-primary-border-subtle);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}
.ti-text {
    flex: 1 0 8rem;
    min-width: 8rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    padding: 0;
}
.ti-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .1rem .2rem .1rem .55rem;
    border-radius: 1rem;
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    font-size: .875rem;
    line-height: 1.4;
}
.ti-chip-new {
    background: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
}
.ti-chip-count {
    font-size: .7rem;
    color: var(--bs-secondary-color);
}
.ti-remove {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color);
    padding: 0 .3rem;
    border-radius: 50%;
    line-height: 1;
    font-size: 1rem;
}
.ti-remove:hover { color: var(--bs-danger); }
.ti-menu {
    position: absolute;
    z-index: 1060;
    left: 0;
    right: 0;
    max-height: 18rem;
    overflow-y: auto;
    margin-top: .2rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    box-shadow: var(--bs-box-shadow);
}
.ti-option {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .35rem .75rem;
    cursor: pointer;
}
.ti-option.active { background: var(--bs-primary); color: #fff; }
.ti-option.active .ti-chip-count { color: rgba(255, 255, 255, .8); }
.ti-option mark { padding: 0; background: transparent; font-weight: 700; color: inherit; }
.ti-option-new { border-top: 1px solid var(--bs-border-color); }
.ti-option-new .ti-chip-count { color: var(--bs-warning-text-emphasis); }
.ti-suggest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem;
    margin-top: .5rem;
}
.ti-suggest-label {
    font-size: .8rem;
    color: var(--bs-secondary-color);
    margin-right: .25rem;
}
.ti-suggestion {
    border: 1px dashed var(--bs-border-color);
    background: transparent;
    color: inherit;
    border-radius: 1rem;
    padding: .1rem .55rem;
    font-size: .8rem;
}
.ti-suggestion:hover { background: var(--bs-secondary-bg); border-style: solid; }
.ti.is-invalid .ti-box { border-color: var(--bs-form-invalid-border-color); }
