/* TubeNow "Modern" site theme: day/night modes, collapsible sidebar, card grid.
   Loaded after the vendor CSS and themes/modern-dark.css (generated night-mode overrides for the vendor pages).
   Markup: layouts/user/modern/*.blade.php, user/partials/video-card.blade.php. Behaviour: streamtube/js/modern-theme.js */

/* ===== 1. Colour + size tokens ===== */
:root {
    --mt-header-h: 56px;
    --mt-side-w: 240px;
    --mt-side-mini: 72px;
    --mt-bottom-h: 52px;
    --mt-radius: 12px;
    --mt-font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

:root,
:root[data-theme="light"] {
    color-scheme: light;
    --mt-bg: #ffffff;           /* page */
    --mt-surface: #f2f2f2;      /* chips, skeletons */
    --mt-surface-2: #e5e5e5;    /* active nav item, thumbnail placeholder */
    --mt-elevated: #ffffff;     /* menus, dropdowns */
    --mt-text-1: #0f0f0f;       /* titles */
    --mt-text-2: #606060;       /* channel names, meta */
    --mt-text-3: #909090;       /* hints */
    --mt-border: #e5e5e5;
    --mt-hover: rgba(0, 0, 0, .05);
    --mt-pressed: rgba(0, 0, 0, .1);
    --mt-accent: #e0322b;       /* brand accent: change this one line to re-brand */
    --mt-accent-text: #ffffff;
    --mt-link: #065fd4;
    --mt-focus: #1a73e8;
    --mt-input-bg: #ffffff;
    --mt-input-border: #d3d3d3;
    --mt-search-btn: #f8f8f8;
    --mt-overlay: rgba(0, 0, 0, .8);
    --mt-backdrop: rgba(0, 0, 0, .4);
    --mt-shadow: 0 4px 32px rgba(0, 0, 0, .12);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --mt-bg: #0f0f0f;
    --mt-surface: #212121;
    --mt-surface-2: #272727;
    --mt-elevated: #282828;
    --mt-text-1: #f1f1f1;
    --mt-text-2: #aaaaaa;
    --mt-text-3: #717171;
    --mt-border: #303030;
    --mt-hover: rgba(255, 255, 255, .08);
    --mt-pressed: rgba(255, 255, 255, .14);
    --mt-accent: #ff4d45;
    --mt-accent-text: #ffffff;
    --mt-link: #3ea6ff;
    --mt-focus: #3ea6ff;
    --mt-input-bg: #121212;
    --mt-input-border: #303030;
    --mt-search-btn: #222222;
    --mt-overlay: rgba(0, 0, 0, .8);
    --mt-backdrop: rgba(0, 0, 0, .6);
    --mt-shadow: 0 4px 32px rgba(0, 0, 0, .6);
}

/* ===== 2. Base ===== */
html { scroll-padding-top: var(--mt-header-h); scrollbar-color: var(--mt-text-3) transparent; }
html, body { height: auto; }
body {
    background: var(--mt-bg);
    color: var(--mt-text-1);
    font-family: var(--mt-font);
    padding-top: var(--mt-header-h);
}
a { color: var(--mt-link); }
.wrapper_content, .common-streamtube, .y-content { background: transparent; }
.common-streamtube { min-height: calc(100vh - var(--mt-header-h)); }
hr { border-color: var(--mt-border); }
.material-icons { user-select: none; }
/* smooth day/night swap: modern-theme.js adds .mt-anim for the duration of the switch */
html.mt-anim, html.mt-anim * { transition: background-color .25s ease, color .25s ease, border-color .25s ease, fill .25s ease !important; }

/* ===== 3. Header ===== */
.mt-header {
    position: fixed; inset: 0 0 auto 0; z-index: 1030;
    height: var(--mt-header-h);
    display: flex; align-items: center; gap: 16px;
    padding: 0 16px;
    background: var(--mt-bg);
}
.mt-header__start, .mt-header__end { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.mt-header__end { margin-left: auto; }
.mt-logo { display: inline-flex; align-items: center; height: 40px; padding: 0 8px; }
.mt-logo img { max-height: 26px; max-width: 140px; width: auto; display: block; }
.mt-logo__dark { display: none !important; }
[data-theme="dark"] .mt-logo--has-dark .mt-logo__light { display: none !important; }
[data-theme="dark"] .mt-logo--has-dark .mt-logo__dark { display: block !important; }

.mt-icon-btn {
    width: 40px; height: 40px; flex: 0 0 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%; padding: 0;
    background: transparent; color: var(--mt-text-1);
    cursor: pointer; text-decoration: none !important;
}
.mt-icon-btn:hover, .mt-icon-btn:focus { background: var(--mt-hover); color: var(--mt-text-1); }
.mt-icon-btn:active { background: var(--mt-pressed); }
.mt-icon-btn .material-icons { font-size: 24px; }
:is(.mt-header, .mt-sidebar, .mt-bottom-nav) :is(a, button, input):focus-visible { outline: 2px solid var(--mt-focus); outline-offset: 2px; }

/* theme toggle shows the mode you would switch TO */
.mt-theme-toggle .mt-to-light { display: none; }
[data-theme="dark"] .mt-theme-toggle .mt-to-light { display: inline-block; }
[data-theme="dark"] .mt-theme-toggle .mt-to-dark { display: none; }

/* search pill */
.mt-search { flex: 0 1 640px; min-width: 0; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.mt-search__field { flex: 1; min-width: 0; display: flex; }
.mt-search input[type="search"] {
    flex: 1; min-width: 0; height: 40px; margin: 0;
    padding: 0 16px; font-size: 16px;
    color: var(--mt-text-1); background: var(--mt-input-bg);
    border: 1px solid var(--mt-input-border); border-right: 0;
    border-radius: 40px 0 0 40px !important; box-shadow: none; outline: none;   /* vendor: input { border-radius: 2px !important } */
    -webkit-appearance: none; appearance: none;
}
.mt-search input[type="search"]:focus { border-color: var(--mt-focus); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .2); }
.mt-search input[type="search"]::placeholder { color: var(--mt-text-3); }
.mt-search__submit {
    width: 64px; height: 40px; flex: 0 0 64px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--mt-input-border); border-radius: 0 40px 40px 0;
    background: var(--mt-search-btn); color: var(--mt-text-1); cursor: pointer;
}
.mt-search__submit:hover { background: var(--mt-surface-2); }
.mt-search__back, .mt-search-open { display: none; }
.ui-autocomplete { background: var(--mt-elevated) !important; color: var(--mt-text-1); border: 0 !important; border-radius: var(--mt-radius); box-shadow: var(--mt-shadow); padding: 8px 0 !important; z-index: 1050 !important; }
.ui-autocomplete .ui-menu-item, .ui-autocomplete .ui-menu-item-wrapper { color: var(--mt-text-1); padding: 6px 16px; border: 0 !important; background: none !important; margin: 0 !important; }
.ui-autocomplete .ui-state-active, .ui-autocomplete .ui-menu-item:hover { background: var(--mt-hover) !important; }

.mt-signin {
    display: inline-flex; align-items: center; gap: 6px;
    height: 36px; padding: 0 14px 0 10px; margin-left: 4px;
    border: 1px solid var(--mt-border); border-radius: 18px;
    color: var(--mt-link); font-size: 14px; font-weight: 500; text-decoration: none !important;
}
.mt-signin:hover, .mt-signin:focus { background: var(--mt-hover); color: var(--mt-link); }
.mt-avatar-btn img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--mt-surface-2); }

/* dropdown menus (Bootstrap 3 .dropdown-menu) */
.mt-menu.dropdown-menu {
    margin-top: 4px; padding: 8px 0; min-width: 260px;
    background: var(--mt-elevated); color: var(--mt-text-1);
    border: 0; border-radius: var(--mt-radius); box-shadow: var(--mt-shadow);
}
.mt-menu > li > a, .mt-menu__item {
    display: flex !important; align-items: center; gap: 16px;
    padding: 8px 16px !important; color: var(--mt-text-1) !important; font-size: 14px; line-height: 24px;
    background: none; white-space: nowrap; text-decoration: none !important;
}
.mt-menu > li > a:hover, .mt-menu > li > a:focus, .mt-menu__item:hover { background: var(--mt-hover) !important; }
.mt-menu .material-icons { font-size: 22px; color: var(--mt-text-2); }
.mt-menu .divider { background: var(--mt-border); margin: 8px 0; }
.mt-menu__profile { display: flex; gap: 14px; padding: 8px 16px 12px; }
.mt-menu__profile img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.mt-menu__profile strong { display: block; font-weight: 500; font-size: 16px; color: var(--mt-text-1); }
.mt-menu__profile, .mt-menu__profile * { text-transform: none !important; }   /* vendor capitalises the email */
.mt-menu__profile span { display: block; font-size: 14px; color: var(--mt-text-2); overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.mt-menu__profile a { font-size: 14px; color: var(--mt-link) !important; }
.mt-menu__title { padding: 4px 16px 8px; font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--mt-border); margin-bottom: 8px; }
.mt-menu__foot { display: block; text-align: center; padding: 8px 16px 0; border-top: 1px solid var(--mt-border); margin-top: 8px; font-size: 14px; color: var(--mt-link) !important; }
.mt-notify-menu { width: 360px; max-height: 70vh; overflow-y: auto; }
.mt-notify-menu .notification-box { padding: 8px 16px; list-style: none; }
.mt-notify-menu .notification-box a { color: var(--mt-text-1); text-decoration: none; }
.mt-notify-menu .notification-box img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.mt-notify-menu .notification-box .text-warning { display: none; }   /* vendor hard-codes a fake date */

/* ===== 4. Sidebar ===== */
.mt-sidebar {
    position: fixed; top: var(--mt-header-h); bottom: 0; left: 0; z-index: 1020;
    width: var(--mt-side-w);
    padding: 12px 12px 24px;
    overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
    background: var(--mt-bg);
    scrollbar-width: thin; scrollbar-color: transparent transparent;
    transition: transform .2s ease;
}
.mt-sidebar:hover { scrollbar-color: var(--mt-text-3) transparent; }
.mt-nav { list-style: none; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--mt-border); }
.mt-nav:last-of-type { border-bottom: 0; }
.mt-nav__title { margin: 0; padding: 6px 12px 4px; font-size: 16px; font-weight: 500; color: var(--mt-text-1); }
.mt-nav li a {
    display: flex; align-items: center; gap: 24px;
    height: 40px; padding: 0 12px; border-radius: 10px;
    color: var(--mt-text-1); font-size: 14px; text-decoration: none;
    white-space: nowrap; overflow: hidden;
}
.mt-nav li a:hover, .mt-nav li a:focus { background: var(--mt-hover); color: var(--mt-text-1); }
.mt-nav li a:active { background: var(--mt-pressed); }
.mt-nav li.active { background: none; color: inherit; }   /* vendor: .active { background: #cc181e } */
.mt-nav li.active a { background: var(--mt-surface-2); font-weight: 500; }
.mt-nav li.active .material-icons { color: var(--mt-accent); }
.mt-nav .material-icons { font-size: 24px; width: 24px; flex: 0 0 24px; }
.mt-nav__label { overflow: hidden; text-overflow: ellipsis; }
.mt-nav__avatar { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; object-fit: cover; background: var(--mt-surface-2); }
.mt-sidebar__note { padding: 4px 12px 16px; margin-bottom: 12px; border-bottom: 1px solid var(--mt-border); font-size: 14px; line-height: 20px; color: var(--mt-text-1); }
.mt-sidebar__note p { margin: 0 0 12px; }
.mt-sidebar__note .mt-signin { margin-left: 0; }
.mt-sidebar__apps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 12px; }
.mt-sidebar__apps img { height: 36px; width: auto; }
.mt-sidebar__social { display: flex; gap: 4px; padding: 0 8px 12px; }
.mt-sidebar__social .mt-icon-btn { color: var(--mt-text-2); }
.mt-sidebar__footer { padding: 4px 12px; font-size: 12px; line-height: 18px; color: var(--mt-text-3); }
.mt-sidebar__footer a { color: var(--mt-text-2); margin-right: 8px; }
.mt-backdrop { display: none; position: fixed; inset: 0; z-index: 1025; background: var(--mt-backdrop); }

/* ===== 5. Page area next to the sidebar (every sidebar page is .row > nav + .page-inner) ===== */
.content-row { margin: 0; }
.mt-sidebar ~ .page-inner {
    float: none; width: auto;
    margin-top: 0 !important;   /* vendor offsets the old header with margin-top: 60px */
    margin-left: var(--mt-side-w);
    padding: 24px 24px 48px;
    min-height: calc(100vh - var(--mt-header-h));
    background: var(--mt-bg);
    overflow: visible !important;
}
.mt-sidebar ~ .page-inner > hr { margin: 8px 0 24px; }
.mt-sidebar ~ .page-inner > hr:first-of-type { display: none; }   /* no rule above the first shelf */

/* ===== 6. Video grid + cards ===== */
.slide-area, .recom-area { margin: 0 0 16px; padding: 0; background: none; box-shadow: none; border: 0; }
.box-head { padding: 0; margin: 0; background: none; border: 0; }
.box-head h3 { margin: 0 0 16px; padding: 0; font-size: 20px; line-height: 28px; font-weight: 700; color: var(--mt-text-1); text-transform: none; }
.mt-grid, .slide-area > .box, .recommend-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 40px 16px;
    margin: 0; padding: 0;
}
.slide-box {
    width: auto !important; height: auto !important; float: none !important;
    margin: 0 !important; padding: 0 !important;
    background: none !important; border: 0 !important; box-shadow: none !important;
    min-width: 0;
}
.slide-image {
    position: relative; overflow: hidden;
    width: 100%; height: auto !important; aspect-ratio: 16 / 9;
    border-radius: var(--mt-radius);
    background: var(--mt-surface-2);
}
.slide-image > a { display: block; width: 100%; height: 100%; }
.bg_img_video { background-position: center; }
.recommend-list::before, .recommend-list::after { display: none; }   /* Bootstrap .row clearfix would take a grid cell */
.slide-image img, .slide-img1 { display: block; width: 100%; height: 100% !important; min-height: 0; object-fit: cover; border-radius: 0; }
.slide-img1[src$="placeholder.gif"] { opacity: 0; }   /* show the surface colour until the lazy image arrives */
.video_duration, .video_amount {
    position: absolute; z-index: 2;
    padding: 1px 4px; border-radius: 4px; opacity: 1;
    font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: .3px;
}
.video_duration { right: 8px; bottom: 8px; left: auto; top: auto; background: var(--mt-overlay); color: #fff; }
.video_amount { left: 8px; top: 8px; bottom: auto; right: auto; background: var(--mt-accent); color: var(--mt-accent-text); text-transform: uppercase; }
.video_duration:empty { display: none; }
.video_mobile_views { display: none !important; }

.video-details {
    display: flex; align-items: flex-start; gap: 12px;
    height: auto !important; padding: 12px 0 0 !important; margin: 0;
    background: none !important; border: 0 !important;
}
.mt-card-avatar { flex: 0 0 36px; }
.mt-card-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--mt-surface-2); }
.mt-card-text { flex: 1; min-width: 0; }
.video-head { height: auto !important; margin: 0 0 4px !important; padding: 0 !important; }
.video-head a {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    overflow: hidden; white-space: normal;
    max-height: none; height: auto;
    color: var(--mt-text-1) !important; font-size: 16px; line-height: 22px; font-weight: 500;
    text-decoration: none;
}
.video_views { display: block; color: var(--mt-text-2) !important; font-size: 14px !important; line-height: 20px; }
.video_views a { color: var(--mt-text-2) !important; text-decoration: none; }
.video_views a:hover { color: var(--mt-text-1) !important; }
.video_views .hidden-mobile { display: block !important; }
.video_views .fa-eye { display: none; }
.video_views b { font-size: 0; font-weight: 400; }                 /* vendor "." separator -> bullet */
.video_views b::before { content: "\2022"; font-size: 14px; margin: 0 4px; }

/* ===== 7. Vendor page chrome brought in line ===== */
.form-control { border-radius: 8px; border-color: var(--mt-input-border); background-color: var(--mt-input-bg); color: var(--mt-text-1); box-shadow: none; }
.form-control:focus { border-color: var(--mt-focus); box-shadow: 0 0 0 1px var(--mt-focus); }
.btn { border-radius: 18px; font-weight: 500; }
.btn-danger, .btn-primary, .y-signin, .st_video_upload_btn.subscribe_btn {
    background: var(--mt-accent) !important; border-color: var(--mt-accent) !important; color: var(--mt-accent-text) !important;
}
.btn-danger:hover, .btn-primary:hover { filter: brightness(1.08); }
.pagination > li > a, .pagination > li > span { background: transparent; border-color: var(--mt-border); color: var(--mt-text-1); }
.pagination > .active > a, .pagination > .active > span { background: var(--mt-accent); border-color: var(--mt-accent); color: var(--mt-accent-text); }

.footer {
    position: static !important; width: auto !important;   /* vendor: absolute, 100% wide */
    margin-left: var(--mt-side-w);
    padding: 16px 24px;
    background: var(--mt-bg) !important; border-top: 1px solid var(--mt-border); color: var(--mt-text-2);
}
.footer .footer1 { margin: 0; }
.footer a, .footer .term li { color: var(--mt-text-2) !important; }
.bottom-height { display: none; }
:root:not(:has(.mt-sidebar)) .footer { margin-left: 0; }

/* login / register pages (layouts/user/focused): their own static top bar instead of .mt-header */
:root:not(:has(.mt-header)) body { padding-top: 0; }
.signup-nav { background: var(--mt-bg) !important; border-bottom: 1px solid var(--mt-border); box-shadow: none !important; }
.signup-nav img { max-height: 28px; width: auto; }
.signup-nav .pull-right { display: flex; align-items: center; gap: 8px; }

/* ===== 8. Mobile bottom navigation ===== */
.mt-bottom-nav { display: none; }

/* ===== 9. Responsive ===== */
/* collapsed ("mini") sidebar: desktop when the user collapsed it, tablet always (the menu button opens a drawer) */
@media (min-width: 1200px) {
    html.mt-mini .mt-sidebar { width: var(--mt-side-mini); padding: 4px; }
    html.mt-mini .mt-sidebar ~ .page-inner, html.mt-mini .footer { margin-left: var(--mt-side-mini); }
    html.mt-mini .mt-sidebar .mt-nav:not(.mt-nav--primary),
    html.mt-mini .mt-sidebar .mt-nav__title,
    html.mt-mini .mt-sidebar :is(.mt-sidebar__note, .mt-sidebar__apps, .mt-sidebar__social, .mt-sidebar__footer) { display: none; }
    html.mt-mini .mt-nav { border: 0; padding: 0; margin: 0; }
    html.mt-mini .mt-nav li a { flex-direction: column; justify-content: center; gap: 6px; height: 74px; padding: 0 2px; font-size: 10px; }
    html.mt-mini .mt-nav li.active a { background: none; }
    html.mt-mini .mt-nav__label { max-width: 64px; text-align: center; }
}
@media (min-width: 768px) and (max-width: 1199px) {
    html:not(.mt-drawer-open) .mt-sidebar { width: var(--mt-side-mini); padding: 4px; }
    html:not(.mt-drawer-open) .mt-sidebar .mt-nav:not(.mt-nav--primary),
    html:not(.mt-drawer-open) .mt-sidebar .mt-nav__title,
    html:not(.mt-drawer-open) .mt-sidebar :is(.mt-sidebar__note, .mt-sidebar__apps, .mt-sidebar__social, .mt-sidebar__footer) { display: none; }
    html:not(.mt-drawer-open) .mt-nav { border: 0; padding: 0; margin: 0; }
    html:not(.mt-drawer-open) .mt-nav li a { flex-direction: column; justify-content: center; gap: 6px; height: 74px; padding: 0 2px; font-size: 10px; }
    html:not(.mt-drawer-open) .mt-nav li.active a { background: none; }
    html:not(.mt-drawer-open) .mt-nav__label { max-width: 64px; text-align: center; }
    .mt-sidebar ~ .page-inner, .footer { margin-left: var(--mt-side-mini); }
    html.mt-drawer-open .mt-sidebar { z-index: 1035; box-shadow: var(--mt-shadow); }
    html.mt-drawer-open .mt-backdrop { display: block; }
}
@media (max-width: 991px) {
    .mt-search { flex-basis: 420px; }
}
@media (max-width: 767px) {
    body { padding-bottom: var(--mt-bottom-h); }
    .mt-header { gap: 4px; padding: 0 8px 0 4px; }
    .mt-search { display: none; }
    .mt-search-open { display: inline-flex; }
    html.mt-searching .mt-header__start, html.mt-searching .mt-header__end { display: none; }
    html.mt-searching .mt-search { display: flex; flex: 1; }
    html.mt-searching .mt-search__back { display: inline-flex; }
    .mt-upload { display: none !important; }

    .mt-sidebar { transform: translateX(-100%); z-index: 1035; box-shadow: none; }
    html.mt-drawer-open .mt-sidebar { transform: none; box-shadow: var(--mt-shadow); }
    html.mt-drawer-open .mt-backdrop { display: block; }
    .mt-sidebar ~ .page-inner { margin-left: 0; padding: 12px 15px 32px; }   /* 15px: Bootstrap .row margins */
    .footer { margin-left: 0; padding-bottom: calc(var(--mt-bottom-h) + 16px); }

    .mt-grid, .slide-area > .box { grid-template-columns: 1fr; gap: 24px; }
    .box-head h3 { font-size: 18px; margin-bottom: 12px; }

    .mt-bottom-nav {
        position: fixed; inset: auto 0 0 0; z-index: 1030;
        height: var(--mt-bottom-h);
        display: flex; justify-content: space-around; align-items: stretch;
        background: var(--mt-bg); border-top: 1px solid var(--mt-border);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mt-bottom-nav a {
        flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        color: var(--mt-text-1); font-size: 10px; text-decoration: none;
    }
    .mt-bottom-nav a.active .material-icons { color: var(--mt-accent); }
    .mt-bottom-nav .material-icons { font-size: 24px; }
    .mt-notify-menu { width: calc(100vw - 16px); }
}
@media (min-width: 560px) and (max-width: 767px) {
    .mt-grid, .slide-area > .box { grid-template-columns: repeat(2, 1fr); gap: 32px 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .mt-sidebar, html.mt-anim, html.mt-anim * { transition: none !important; }
}
