/* ═══════════════════════════════════════════════════════════
   MileTube — YouTube-style design system (clean rebuild)
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth}
body{min-height:100vh;line-height:1.5;overflow-x:hidden}
img,video{display:block;max-width:100%;height:auto}
a{color:inherit;text-decoration:none}
ul,ol{list-style:none}
button{background:none;border:none;cursor:pointer;font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--mt-accent);outline-offset:2px}
::selection{background:var(--mt-accent);color:#fff}

/* ── Tokens ── */
:root{
  --mt-bg:#0f0f0f;
  --mt-bg-raised:#1a1a1a;
  --mt-bg-hover:#272727;
  --mt-bg-active:#3a3a3a;
  --mt-surface:#222;
  --mt-text:#f1f1f1;
  --mt-text-secondary:#aaa;
  --mt-text-muted:#717171;
  --mt-border:#333;
  --mt-accent:#e94560;
  --mt-accent-hover:#d63851;
  --mt-blue:#3ea6ff;
  --mt-topbar-h:56px;
  --mt-sidebar-w:240px;
  --mt-sidebar-mini:72px;
  --mt-font:'Roboto',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
  --mt-radius:12px;
  --mt-radius-sm:8px;
  --mt-transition:200ms ease;
}
body{font-family:var(--mt-font);background:var(--mt-bg);color:var(--mt-text)}

/* ── Light theme ── */
[data-theme="light"]{
  --mt-bg:#fff;--mt-bg-raised:#fff;--mt-bg-hover:#f2f2f2;--mt-bg-active:#e5e5e5;
  --mt-surface:#f2f2f2;--mt-text:#0f0f0f;--mt-text-secondary:#606060;
  --mt-text-muted:#909090;--mt-border:#e5e5e5;
}

/* ═══════════════════════════════
   TOP BAR
   ═══════════════════════════════ */
.mt-topbar{
  position:fixed;top:0;left:0;right:0;height:var(--mt-topbar-h);
  background:var(--mt-bg);display:flex;align-items:center;
  justify-content:space-between;padding:0 16px;z-index:200;
}
.admin-bar .mt-topbar{top:32px}
.admin-bar .mt-app{padding-top:calc(var(--mt-topbar-h) + 32px)}
.admin-bar .mt-sidebar{top:calc(var(--mt-topbar-h) + 32px)}
.admin-bar .mt-chip-bar{top:calc(var(--mt-topbar-h) + 32px)}
@media(max-width:782px){
  .admin-bar .mt-topbar{top:46px}
  .admin-bar .mt-app{padding-top:calc(var(--mt-topbar-h) + 46px)}
  .admin-bar .mt-sidebar{top:calc(var(--mt-topbar-h) + 46px)}
  .admin-bar .mt-chip-bar{top:calc(var(--mt-topbar-h) + 46px)}
}

.mt-topbar__left{display:flex;align-items:center;gap:16px;min-width:180px}
.mt-topbar__menu{
  width:40px;height:40px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;color:var(--mt-text);transition:background var(--mt-transition);
}
.mt-topbar__menu:hover{background:var(--mt-bg-hover)}
.mt-topbar__logo{display:flex;align-items:center;gap:8px;font-size:20px;font-weight:700;letter-spacing:-.5px}
.mt-topbar__logo-svg{flex-shrink:0}
.mt-topbar__logo:hover{opacity:.9}

.mt-topbar__center{flex:1;max-width:640px;margin:0 40px}
.mt-topbar__search{display:flex;width:100%}
.mt-topbar__search-input{
  flex:1;height:40px;padding:0 16px;background:var(--mt-bg);
  border:1px solid var(--mt-border);border-right:none;
  border-radius:20px 0 0 20px;font-size:16px;color:var(--mt-text);outline:none;
}
.mt-topbar__search-input::placeholder{color:var(--mt-text-muted)}
.mt-topbar__search-input:focus{border-color:var(--mt-blue)}
.mt-topbar__search-btn{
  width:64px;height:40px;background:var(--mt-surface);border:1px solid var(--mt-border);
  border-radius:0 20px 20px 0;display:flex;align-items:center;justify-content:center;
  color:var(--mt-text);transition:background var(--mt-transition);
}
.mt-topbar__search-btn:hover{background:var(--mt-bg-hover)}

.mt-topbar__right{display:flex;align-items:center;gap:8px;min-width:180px;justify-content:flex-end}
.mt-topbar__icon-btn{
  width:40px;height:40px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-size:20px;transition:background var(--mt-transition);
}
.mt-topbar__icon-btn:hover{background:var(--mt-bg-hover)}

/* ═══════════════════════════════
   LAYOUT
   ═══════════════════════════════ */
.mt-app{display:flex;padding-top:var(--mt-topbar-h);min-height:100vh}

/* ═══════════════════════════════
   SIDEBAR
   ═══════════════════════════════ */
.mt-sidebar{
  position:fixed;top:var(--mt-topbar-h);left:0;bottom:0;width:var(--mt-sidebar-w);
  background:var(--mt-bg);overflow-y:auto;padding:12px 0;z-index:50;
  scrollbar-width:thin;scrollbar-color:transparent transparent;transition:width .2s ease;
}
.mt-sidebar:hover{scrollbar-color:var(--mt-border) transparent}
.mt-sidebar::-webkit-scrollbar{width:8px}
.mt-sidebar::-webkit-scrollbar-thumb{background:transparent;border-radius:4px}
.mt-sidebar:hover::-webkit-scrollbar-thumb{background:var(--mt-border)}

.mt-sidebar__nav{padding:0 12px}
.mt-sidebar__item{
  display:flex;align-items:center;gap:24px;padding:0 12px;height:40px;
  border-radius:10px;font-size:14px;color:var(--mt-text);
  transition:background var(--mt-transition);white-space:nowrap;overflow:hidden;
}
.mt-sidebar__item:hover{background:var(--mt-bg-hover)}
.mt-sidebar__item.active{background:var(--mt-bg-hover);font-weight:600}
.mt-sidebar__item svg{flex-shrink:0;opacity:.85}

.mt-sidebar__divider{height:1px;background:var(--mt-border);margin:12px 0}
.mt-sidebar__section{padding:0 12px}
.mt-sidebar__heading{padding:8px 12px 4px;font-size:14px;font-weight:600}
.mt-sidebar__item--event,.mt-sidebar__item--style{gap:12px;font-size:13px}
.mt-sidebar__event-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.mt-sidebar__badge{margin-left:auto;font-size:10px}
.mt-sidebar__style-color{width:20px;height:20px;border-radius:50%;flex-shrink:0}

/* Sidebar collapsed */
.mt-app.sidebar-collapsed .mt-sidebar{width:var(--mt-sidebar-mini);padding:4px 0}
.mt-app.sidebar-collapsed .mt-sidebar__item{
  flex-direction:column;gap:4px;height:auto;padding:16px 0 12px;
  justify-content:center;align-items:center;margin:0 4px;border-radius:10px;
}
.mt-app.sidebar-collapsed .mt-sidebar__label{font-size:10px;line-height:1.2}
.mt-app.sidebar-collapsed .mt-sidebar__divider,
.mt-app.sidebar-collapsed .mt-sidebar__section{display:none}
.mt-app.sidebar-collapsed .mt-content{margin-left:var(--mt-sidebar-mini);max-width:calc(100vw - var(--mt-sidebar-mini))}

/* ═══════════════════════════════
   CONTENT
   ═══════════════════════════════ */
.mt-content{flex:1;margin-left:var(--mt-sidebar-w);transition:margin-left .2s ease;min-width:0;overflow:hidden}

/* ═══════════════════════════════
   CHIP BAR
   ═══════════════════════════════ */
.mt-chip-bar{
  position:sticky;top:var(--mt-topbar-h);z-index:40;display:flex;gap:12px;
  padding:12px 24px;background:var(--mt-bg);border-bottom:none;
  overflow-x:auto;scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.mt-chip-bar::-webkit-scrollbar{display:none}
.mt-chip{
  padding:6px 12px;border-radius:8px;font-size:14px;font-weight:500;white-space:nowrap;
  background:var(--mt-surface);color:var(--mt-text);border:none;
  transition:background var(--mt-transition),color var(--mt-transition);
}
.mt-chip:hover{background:var(--mt-bg-hover)}
.mt-chip.active{background:var(--mt-text);color:var(--mt-bg)}

/* ═══════════════════════════════
   VIDEO GRID
   ═══════════════════════════════ */
.mt-video-grid{
  display:grid;grid-template-columns:1fr;gap:36px 16px;padding:16px 24px;
}
@media(min-width:600px){.mt-video-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1000px){.mt-video-grid{grid-template-columns:repeat(3,1fr)}}
@media(min-width:1600px){.mt-video-grid{grid-template-columns:repeat(4,1fr)}}

/* ═══════════════════════════════
   SLIDER (horizontal scroll shelf)
   ═══════════════════════════════ */
.mt-slider{
  display:flex;gap:16px;overflow-x:auto;padding:0 24px 8px;
  scroll-snap-type:x mandatory;scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}
.mt-slider::-webkit-scrollbar{display:none}
.mt-slider__item{
  flex:0 0 calc(33.333% - 11px);min-width:280px;scroll-snap-align:start;
}
@media(max-width:1000px){.mt-slider__item{flex:0 0 calc(50% - 8px);min-width:260px}}
@media(max-width:640px){.mt-slider__item{flex:0 0 85%;min-width:0}.mt-slider{padding:0 12px 8px;gap:10px}}

/* ═══════════════════════════════
   VIDEO CARD
   ═══════════════════════════════ */
.mt-vcard{display:flex;flex-direction:column}
.mt-vcard__thumb-link{display:block}
.mt-vcard__thumb{
  position:relative;aspect-ratio:16/9;border-radius:var(--mt-radius);
  overflow:hidden;background:var(--mt-surface);
}
.mt-vcard__thumb img{width:100%;height:100%;object-fit:cover;transition:transform .3s ease}
.mt-vcard:hover .mt-vcard__thumb img{transform:scale(1.05)}

/* Hover progress bar */
.mt-vcard__thumb::after{
  content:'';position:absolute;bottom:0;left:0;height:3px;
  background:var(--mt-accent);z-index:5;width:0;
  border-radius:0 0 var(--mt-radius) var(--mt-radius);transition:none;
}
.mt-vcard:hover .mt-vcard__thumb::after{width:100%;transition:width 10s linear}
.mt-vcard:hover .mt-vcard__duration{background:var(--mt-accent);transition:background .2s}

/* Preview iframe (loads behind thumb, fades in) */
.mt-vcard__preview{
  position:absolute;inset:0;z-index:4;pointer-events:none;
  border-radius:var(--mt-radius);overflow:hidden;
  opacity:0;transition:opacity .5s ease;
}
.mt-vcard__preview iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:none}
.mt-vcard__preview.loaded{opacity:1}

.mt-vcard__overlay{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  opacity:0;transition:opacity var(--mt-transition);
}
.mt-vcard:hover .mt-vcard__overlay{opacity:0}

.mt-vcard__play{
  width:54px;height:54px;background:rgba(0,0,0,.75);border-radius:50%;
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:22px;
  backdrop-filter:blur(4px);
}
.mt-vcard__duration{
  position:absolute;bottom:4px;right:4px;padding:3px 4px;
  background:rgba(0,0,0,.8);color:#fff;font-size:12px;font-weight:500;
  border-radius:4px;line-height:1;letter-spacing:.3px;z-index:6;
  transition:background .2s;
}
.mt-vcard__progress{position:absolute;bottom:0;left:0;height:3px;background:var(--mt-accent);z-index:5}

.mt-vcard__info{display:flex;gap:12px;padding:12px 0 0}
.mt-vcard__event-avatar{
  width:36px;height:36px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;color:#fff;font-size:14px;font-weight:700;flex-shrink:0;
}
.mt-vcard__details{flex:1;min-width:0}
.mt-vcard__title{
  font-size:14px;font-weight:500;line-height:1.4;color:var(--mt-text);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;margin-bottom:4px;
}
.mt-vcard__title a{color:inherit}
.mt-vcard__meta{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--mt-text-muted);line-height:1.6}
.mt-vcard__event-name{color:var(--mt-text-secondary)}
.mt-vcard__event-name:hover{color:var(--mt-text)}
.mt-vcard__style{font-weight:500}

/* ═══════════════════════════════
   WATCH PAGE
   ═══════════════════════════════ */
.mt-watch-page{padding:0 24px 40px}
.mt-watch{display:flex;gap:24px;max-width:1800px}
.mt-watch__main{flex:1;min-width:0;max-width:1100px}

.mt-watch__player,.mt-player{
  position:relative;width:100%;aspect-ratio:16/9;background:#000;
  border-radius:var(--mt-radius);overflow:hidden;
}
.mt-player__poster{position:absolute;inset:0;z-index:2}
.mt-player__poster img{width:100%;height:100%;object-fit:cover}
.mt-player.playing .mt-player__poster{display:none}
.mt-player iframe,.mt-watch__player iframe{
  position:absolute;inset:0;width:100%;height:100%;border:none;z-index:1;
}

.mt-watch__player-overlay{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  background:rgba(0,0,0,.3);transition:background var(--mt-transition);
}
.mt-watch__player:hover .mt-watch__player-overlay{background:rgba(0,0,0,.15)}
.mt-watch__player-play{
  width:68px;height:68px;background:rgba(0,0,0,.65);border-radius:50%;
  display:flex;align-items:center;justify-content:center;color:#fff;font-size:32px;
  backdrop-filter:blur(4px);transition:transform .15s;
}
.mt-watch__player:hover .mt-watch__player-play{transform:scale(1.1)}

.mt-watch__info{padding:12px 0 0}
.mt-watch__title{font-size:20px;font-weight:600;line-height:1.4;margin-bottom:12px}
.mt-watch__meta-row{
  display:flex;align-items:center;justify-content:space-between;
  flex-wrap:wrap;gap:12px;padding-bottom:16px;
  border-bottom:1px solid var(--mt-border);margin-bottom:16px;
}
.mt-watch__channel{display:flex;align-items:center;gap:12px}
.mt-watch__channel-name{font-size:16px;font-weight:600;color:var(--mt-text)}
.mt-watch__channel-sub{font-size:12px;color:var(--mt-text-muted)}

.mt-watch__actions{display:flex;gap:8px}
.mt-watch__action-btn{
  display:flex;align-items:center;gap:6px;padding:8px 16px;border-radius:18px;
  font-size:14px;font-weight:500;background:var(--mt-surface);color:var(--mt-text);
  transition:background var(--mt-transition);
}
.mt-watch__action-btn:hover{background:var(--mt-bg-hover)}
.mt-watch__action-btn--download{background:var(--mt-accent);color:#fff}
.mt-watch__action-btn--download:hover{background:var(--mt-accent-hover);color:#fff}

.mt-watch__desc{
  background:var(--mt-surface);border-radius:var(--mt-radius);
  padding:12px;font-size:14px;color:var(--mt-text-secondary);line-height:1.5;
  cursor:pointer;transition:background var(--mt-transition);
}
.mt-watch__desc:hover{background:var(--mt-bg-hover)}
.mt-watch__desc-meta{font-size:14px;font-weight:500;color:var(--mt-text);margin-bottom:4px}

/* ═══════════════════════════════
   PLAYLIST SIDEBAR
   ═══════════════════════════════ */
.mt-watch__sidebar{width:402px;flex-shrink:0}
.mt-playlist-box{
  background:var(--mt-bg-raised);border:1px solid var(--mt-border);
  border-radius:var(--mt-radius);overflow:hidden;
}
.mt-playlist-box__header{padding:12px 16px;display:flex;justify-content:space-between;align-items:flex-start}
.mt-playlist-box__title{font-size:16px;font-weight:600;line-height:1.3}
.mt-playlist-box__count{font-size:12px;color:var(--mt-text-muted);white-space:nowrap;margin-left:12px}
.mt-playlist-box__list{max-height:calc(100vh - 200px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:transparent transparent}
.mt-playlist-box__list:hover{scrollbar-color:var(--mt-border) transparent}

.mt-playlist-item{
  display:flex;align-items:center;gap:8px;padding:4px 8px 4px 0;
  transition:background var(--mt-transition);border-left:3px solid transparent;
}
.mt-playlist-item:hover{background:var(--mt-bg-hover)}
.mt-playlist-item.active{background:var(--mt-bg-hover);border-left-color:var(--mt-accent)}
.mt-playlist-item__num{width:24px;text-align:center;font-size:12px;color:var(--mt-text-muted);flex-shrink:0}
.mt-playlist-item.active .mt-playlist-item__num{color:var(--mt-accent);font-weight:700}
.mt-playlist-item__thumb{
  position:relative;width:100px;aspect-ratio:16/9;border-radius:6px;
  overflow:hidden;flex-shrink:0;background:var(--mt-bg);
}
.mt-playlist-item__thumb img{width:100%;height:100%;object-fit:cover}
.mt-playlist-item__dur{
  position:absolute;bottom:2px;right:2px;padding:1px 4px;
  background:rgba(0,0,0,.85);color:#fff;font-size:10px;border-radius:3px;line-height:1.4;
}
.mt-playlist-item__info{flex:1;min-width:0;padding:2px 0}
.mt-playlist-item__title{
  font-size:13px;font-weight:500;color:var(--mt-text);display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.3;margin-bottom:2px;
}
.mt-playlist-item__meta{font-size:11px;color:var(--mt-text-muted)}

/* ═══════════════════════════════
   SEARCH RESULTS
   ═══════════════════════════════ */
.mt-search-results{max-width:1050px;margin:0 auto;padding:16px 24px}
.mt-search-item{display:flex;gap:16px;padding:8px 0}
.mt-search-item__thumb{
  width:360px;aspect-ratio:16/9;border-radius:var(--mt-radius);
  overflow:hidden;flex-shrink:0;background:var(--mt-surface);position:relative;
}
.mt-search-item__thumb img{width:100%;height:100%;object-fit:cover}
.mt-search-item__dur{
  position:absolute;bottom:4px;right:4px;padding:2px 4px;
  background:rgba(0,0,0,.8);color:#fff;font-size:12px;border-radius:4px;line-height:1;
}
.mt-search-item__info{flex:1;padding:4px 0}
.mt-search-item__title{
  font-size:18px;font-weight:500;line-height:1.4;margin-bottom:6px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
}
.mt-search-item__title a{color:var(--mt-text)}
.mt-search-item__meta{font-size:12px;color:var(--mt-text-muted);margin-bottom:8px;display:flex;gap:6px;align-items:center}
.mt-search-item__channel{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.mt-search-item__channel-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0}
.mt-search-item__channel-name{font-size:12px;color:var(--mt-text-secondary)}
.mt-search-item__desc{
  font-size:12px;color:var(--mt-text-muted);display:-webkit-box;
  -webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.5;
}

/* ═══════════════════════════════
   EVENT BANNER
   ═══════════════════════════════ */
.mt-event-banner{position:relative;overflow:hidden;height:200px;display:flex;align-items:flex-end}
@media(min-width:768px){.mt-event-banner{height:240px}}
.mt-event-banner__bg{position:absolute;inset:0;z-index:0}
.mt-event-banner__bg img{width:100%;height:100%;object-fit:cover;filter:brightness(.4) blur(8px);transform:scale(1.1)}
.mt-event-banner__bg--gradient{background:linear-gradient(135deg,#1a1a2e 0%,#16213e 50%,#0f3460 100%)}
.mt-event-banner__bg::after{content:'';position:absolute;inset:0;background:linear-gradient(to top,var(--mt-bg) 0%,transparent 60%)}
.mt-event-banner__content{position:relative;z-index:1;padding:24px;width:100%}
.mt-event-banner__title{font-size:clamp(1.4rem,4vw,2.2rem);font-weight:700;color:#fff;margin-bottom:8px;line-height:1.2}
.mt-event-banner__meta{display:flex;flex-wrap:wrap;gap:12px;font-size:13px;color:rgba(255,255,255,.7)}

/* ═══════════════════════════════
   TABS
   ═══════════════════════════════ */
.mt-tabs{
  display:flex;gap:0;border-bottom:1px solid var(--mt-border);
  margin:0 24px 24px;overflow-x:auto;scrollbar-width:none;
}
.mt-tabs::-webkit-scrollbar{display:none}
.mt-tabs__item{
  padding:12px 24px;font-size:14px;font-weight:500;color:var(--mt-text-muted);
  border-bottom:2px solid transparent;white-space:nowrap;cursor:pointer;
  background:none;border-top:none;border-left:none;border-right:none;
  transition:color var(--mt-transition);
}
.mt-tabs__item:hover{color:var(--mt-text)}
.mt-tabs__item.active{color:var(--mt-text);border-bottom-color:var(--mt-text)}
.mt-tab-panel{display:none;padding:0 24px}
.mt-tab-panel.active{display:block}

/* ═══════════════════════════════
   BADGES
   ═══════════════════════════════ */
.mt-badge{
  display:inline-flex;align-items:center;padding:3px 8px;font-size:12px;font-weight:500;
  background:var(--mt-surface);color:var(--mt-text-secondary);border-radius:4px;
}
.mt-badge--style{border-left:3px solid var(--badge-color,var(--mt-accent))}
.mt-badge--live{background:rgba(255,0,0,.15);color:#f00;animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.6}}

/* ═══════════════════════════════
   SECTION HELPERS
   ═══════════════════════════════ */
.mt-section{padding:0 24px 24px}
.mt-section__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}
.mt-section__title{font-size:20px;font-weight:600}
.mt-section__link{font-size:14px;font-weight:500;color:var(--mt-text-muted)}

/* ═══════════════════════════════
   PHOTO GRID + LIGHTBOX
   ═══════════════════════════════ */
.mt-grid--photos{display:grid;gap:3px;padding:0 24px;grid-template-columns:repeat(3,1fr)}
@media(min-width:768px){.mt-grid--photos{grid-template-columns:repeat(4,1fr);gap:4px}}
@media(min-width:1200px){.mt-grid--photos{grid-template-columns:repeat(5,1fr)}}
@media(max-width:640px){.mt-grid--photos{padding:0;gap:2px}}

.mt-card--photo{
  position:relative;aspect-ratio:1;overflow:hidden;cursor:pointer;border-radius:2px;
  background:var(--mt-surface);
}
/* Shimmer loading animation while image loads */
.mt-card--photo::before{
  content:'';position:absolute;inset:0;z-index:1;
  background:linear-gradient(90deg,var(--mt-surface) 25%,var(--mt-bg-hover) 50%,var(--mt-surface) 75%);
  background-size:200% 100%;animation:mt-photo-shimmer 1.5s infinite;
}
@keyframes mt-photo-shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.mt-card--photo img{
  width:100%;height:100%;object-fit:cover;transition:transform .3s;
  position:relative;z-index:2;
}
/* Hide shimmer once image loads */
.mt-card--photo img.loaded ~ ::before,
.mt-card--photo:has(img.loaded)::before{display:none}
.mt-card--photo:hover img{transform:scale(1.05)}

.mt-lightbox{
  position:fixed;inset:0;z-index:1000;background:rgba(0,0,0,.85);
  backdrop-filter:blur(10px);display:flex;align-items:center;justify-content:center;
  opacity:0;visibility:hidden;transition:opacity .25s,visibility .25s;
}
.mt-lightbox.open{opacity:1;visibility:visible}
.mt-lightbox__content{position:relative;max-width:90vw;max-height:90vh;transform:scale(.95);transition:transform .3s cubic-bezier(.16,1,.3,1)}
.mt-lightbox.open .mt-lightbox__content{transform:scale(1)}
.mt-lightbox__img{max-width:90vw;max-height:85vh;object-fit:contain;border-radius:4px}
.mt-lightbox__close{
  position:absolute;top:-44px;right:0;width:40px;height:40px;
  display:flex;align-items:center;justify-content:center;border-radius:50%;
  background:rgba(255,255,255,.1);color:#fff;font-size:24px;transition:background var(--mt-transition);
}
.mt-lightbox__close:hover{background:rgba(255,255,255,.2)}
.mt-lightbox__nav{
  position:absolute;top:50%;transform:translateY(-50%);width:48px;height:48px;
  display:flex;align-items:center;justify-content:center;border-radius:50%;
  background:rgba(255,255,255,.1);color:#fff;font-size:28px;transition:background var(--mt-transition);
}
.mt-lightbox__nav:hover{background:rgba(255,255,255,.25)}
.mt-lightbox__nav--prev{left:-56px}
.mt-lightbox__nav--next{right:-56px}
.mt-lightbox__counter{position:absolute;bottom:-36px;left:50%;transform:translateX(-50%);font-size:13px;color:rgba(255,255,255,.6)}
.mt-lightbox__download{
  position:absolute;bottom:-36px;right:0;padding:4px 12px;border-radius:14px;
  background:rgba(255,255,255,.1);color:#fff;font-size:12px;transition:background var(--mt-transition);
}
.mt-lightbox__download:hover{background:var(--mt-accent);color:#fff}
@media(max-width:768px){.mt-lightbox__nav--prev{left:8px}.mt-lightbox__nav--next{right:8px}}

/* ═══════════════════════════════
   ANIMATIONS
   ═══════════════════════════════ */
.mt-reveal{
  opacity:0;transform:translateY(12px);
  transition:opacity .4s cubic-bezier(.16,1,.3,1),transform .4s cubic-bezier(.16,1,.3,1);
  transition-delay:calc(var(--stagger-index,0)*50ms);
}
.mt-reveal.revealed{opacity:1;transform:translateY(0)}
.mt-fade-in-up{opacity:0;transform:translateY(24px);animation:fadeInUp .6s cubic-bezier(.16,1,.3,1) forwards}
@keyframes fadeInUp{to{opacity:1;transform:translateY(0)}}

/* Skeleton */
.mt-skeleton{background:var(--mt-surface);border-radius:var(--mt-radius);position:relative;overflow:hidden}
.mt-skeleton::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.04),transparent);animation:shimmer 1.5s infinite}
@keyframes shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}

/* Empty state */
.mt-empty{text-align:center;padding:80px 24px;color:var(--mt-text-muted)}

/* Buttons */
.mt-btn{
  display:inline-flex;align-items:center;gap:8px;padding:10px 16px;
  font-size:14px;font-weight:500;border-radius:18px;
  transition:background var(--mt-transition);cursor:pointer;border:none;white-space:nowrap;
}
.mt-btn--primary{background:var(--mt-accent);color:#fff}
.mt-btn--primary:hover{background:var(--mt-accent-hover);color:#fff}
.mt-btn--ghost{background:var(--mt-surface);color:var(--mt-text)}
.mt-btn--ghost:hover{background:var(--mt-bg-hover)}

/* ═══════════════════════════════
   VISIBILITY + MOBILE BOTTOM NAV
   ═══════════════════════════════ */
.mt-mobile-only{display:none!important}
@media(max-width:1024px){
  .mt-desktop-only{display:none!important}
  .mt-mobile-only{display:flex!important}
}

.mt-bottom-nav{
  position:fixed;bottom:0;left:0;right:0;height:56px;
  background:var(--mt-bg);border-top:1px solid var(--mt-border);
  display:flex;align-items:center;justify-content:space-around;z-index:200;padding:0 8px;
}
.mt-bottom-nav__item{
  display:flex;flex-direction:column;align-items:center;gap:2px;
  padding:6px 16px;font-size:10px;color:var(--mt-text-muted);
  transition:color var(--mt-transition);min-width:0;
}
.mt-bottom-nav__item svg{width:24px;height:24px;opacity:.7}
.mt-bottom-nav__item.active{color:var(--mt-text)}
.mt-bottom-nav__item.active svg{opacity:1}

/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */
@media(max-width:1200px){.mt-watch__sidebar{width:340px}}
@media(max-width:1024px){
  .mt-sidebar{display:none}
  .mt-content{margin-left:0!important;max-width:100vw!important}
  .mt-watch{flex-direction:column}
  .mt-watch__sidebar{width:100%}
  .mt-watch__main{max-width:100%}
  .mt-search-item__thumb{width:240px}
  .mt-app{padding-bottom:56px}
}
@media(max-width:640px){
  /* Compact topbar */
  .mt-topbar{height:48px;padding:0 10px}
  .mt-topbar__center{margin:0 6px}
  .mt-topbar__search-input{font-size:14px;height:36px;padding:0 12px}
  .mt-topbar__search-btn{height:36px;width:48px}
  .mt-topbar__left{min-width:auto;gap:8px}
  .mt-topbar__logo-text{display:none}
  .mt-topbar__logo-svg{width:28px;height:28px}
  .mt-topbar__right{min-width:auto;gap:4px}
  .mt-topbar__icon-btn{width:34px;height:34px;font-size:16px}
  .mt-user-menu__toggle{width:28px;height:28px}
  .mt-user-menu__avatar{width:28px;height:28px}

  /* Kill the gap: app padding = topbar height only */
  .mt-app{padding-top:48px;padding-bottom:56px}

  /* Chips: sticky right under topbar, no gap */
  .mt-chip-bar{padding:8px 12px;gap:6px;top:48px}

  /* Grid: 1 column, full width, YouTube mobile */
  .mt-video-grid{padding:0;gap:20px 0;grid-template-columns:1fr}

  /* Cards: full bleed thumbnails */
  .mt-vcard__thumb{border-radius:0}
  .mt-vcard__info{padding:8px 12px 0}
  .mt-vcard__title{font-size:14px}
  .mt-vcard__event-avatar{width:32px;height:32px;font-size:12px}

  /* Sections */
  .mt-section{padding:0 0 16px}
  .mt-section__header{padding:0 12px}
  .mt-section__title{font-size:16px}

  /* Watch page */
  .mt-watch-page{padding:0 0 24px}
  .mt-watch__player,.mt-player{border-radius:0}
  .mt-watch__info{padding:8px 12px 0}
  .mt-watch__title{font-size:16px}
  .mt-watch__meta-row{padding:0 12px 12px}
  .mt-watch__desc{margin:0 12px;border-radius:8px}
  .mt-watch__actions{flex-wrap:wrap}
  .mt-watch__action-btn{font-size:13px;padding:6px 12px}

  /* Search */
  .mt-search-item{flex-direction:column;gap:8px}
  .mt-search-item__thumb{width:100%}

  /* Tabs */
  .mt-tabs{margin:0 12px 16px}

  /* Comments */
  .mt-comments{padding:0 12px}

  /* Admin bar: shift everything down by admin bar height */
  .admin-bar .mt-topbar{top:46px}
  .admin-bar .mt-app{padding-top:calc(48px + 46px)}
  .admin-bar .mt-chip-bar{top:calc(48px + 46px)}
}

/* Hide WP default pagination */
.nav-links{display:none}

/* ═══════════════════════════════
   CONTACT BUBBLE
   ═══════════════════════════════ */
.mt-contact-bubble{
  position:fixed;bottom:24px;right:24px;z-index:190;
  width:56px;height:56px;border-radius:50%;border:none;
  background:linear-gradient(135deg,#e94560,#ff6b8a);
  color:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:0 4px 20px rgba(233,69,96,.4);
  transition:transform .2s,box-shadow .2s;
  cursor:pointer;
}
.mt-contact-bubble:hover{
  transform:scale(1.1);
  box-shadow:0 6px 30px rgba(233,69,96,.5);
  color:#fff;
}

/* Popup */
.mt-contact-popup{
  position:fixed;bottom:92px;right:24px;z-index:191;
  width:300px;background:var(--mt-bg-raised);border:1px solid var(--mt-border);
  border-radius:16px;box-shadow:0 12px 40px rgba(0,0,0,.3);
  display:none;overflow:hidden;
  animation:mt-popup-in .25s ease;
}
.mt-contact-popup.open{display:block}

@keyframes mt-popup-in{
  from{opacity:0;transform:translateY(10px) scale(.95)}
  to{opacity:1;transform:translateY(0) scale(1)}
}

.mt-contact-popup__header{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 20px;background:linear-gradient(135deg,#e94560,#ff6b8a);color:#fff;
}
.mt-contact-popup__header strong{font-size:15px}
.mt-contact-popup__close{
  background:rgba(255,255,255,.2);border:none;color:#fff;
  width:28px;height:28px;border-radius:50%;font-size:18px;
  display:flex;align-items:center;justify-content:center;cursor:pointer;
  transition:background .2s;
}
.mt-contact-popup__close:hover{background:rgba(255,255,255,.35)}

.mt-contact-popup__body{padding:20px}
.mt-contact-popup__body p{font-size:14px;color:var(--mt-text-secondary);margin-bottom:16px;line-height:1.5}

.mt-contact-popup__btn{
  display:flex;align-items:center;gap:10px;padding:12px 16px;
  background:var(--mt-surface);border-radius:10px;font-size:14px;
  font-weight:500;color:var(--mt-text);transition:background .2s;
  width:100%;
}
.mt-contact-popup__btn:hover{background:var(--mt-bg-hover);color:var(--mt-text)}
.mt-contact-popup__btn svg{opacity:.6;flex-shrink:0}

@media(max-width:1024px){
  .mt-contact-bubble{bottom:72px}
  .mt-contact-popup{bottom:140px}
}

/* ═══════════════════════════════
   USER MENU (YouTube-style avatar dropdown)
   ═══════════════════════════════ */
.mt-user-menu{position:relative}
.mt-user-menu__toggle{
  width:32px;height:32px;border-radius:50%;overflow:hidden;cursor:pointer;
  border:none;padding:0;background:none;
}
.mt-user-menu__avatar{width:32px;height:32px;border-radius:50%;object-fit:cover}
.mt-user-menu__avatar-lg{width:40px;height:40px;border-radius:50%;object-fit:cover;flex-shrink:0}

.mt-user-menu__dropdown{
  display:none;position:absolute;top:calc(100% + 8px);right:0;
  width:280px;background:var(--mt-bg-raised);border:1px solid var(--mt-border);
  border-radius:var(--mt-radius);box-shadow:0 8px 30px rgba(0,0,0,.3);
  z-index:300;overflow:hidden;
}
.mt-user-menu__dropdown.open{display:block}

.mt-user-menu__header{display:flex;align-items:center;gap:12px;padding:16px}
.mt-user-menu__divider{height:1px;background:var(--mt-border)}
.mt-user-menu__item{
  display:flex;align-items:center;gap:12px;padding:10px 16px;
  font-size:14px;color:var(--mt-text);transition:background var(--mt-transition);
}
.mt-user-menu__item:hover{background:var(--mt-bg-hover)}
.mt-user-menu__item svg{opacity:.7;flex-shrink:0}

/* ═══════════════════════════════
   POWERED BY CLICKAH
   ═══════════════════════════════ */
.mt-powered{
  text-align:center;padding:16px;font-size:12px;color:var(--mt-text-muted);
  border-top:none;margin-top:40px;
}
.mt-powered a{color:var(--mt-accent);font-weight:600}
.mt-powered a:hover{text-decoration:underline}

/* Home content transition for chip filtering */
#mt-home-content{transition:opacity .3s ease, transform .3s ease}

/* ═══════════════════════════════
   COMMENTS (YouTube style)
   ═══════════════════════════════ */
.mt-comments{margin-top:24px}
.mt-comments__header{margin-bottom:24px}
.mt-comments__title{font-size:16px;font-weight:600;color:var(--mt-text)}

/* Comment form — YouTube style (avatar + underline input) */
.mt-comments__form{display:flex;gap:12px;margin-bottom:32px}
.mt-comments__form-avatar{flex-shrink:0}
.mt-avatar{width:40px;height:40px;border-radius:50%;object-fit:cover}
.mt-avatar--placeholder{
  display:flex;align-items:center;justify-content:center;
  background:var(--mt-surface);color:var(--mt-text-muted);
}
.mt-comments__form-body{flex:1;min-width:0}
.mt-comments__form-fields{display:flex;gap:8px;margin-bottom:8px}
@media(max-width:480px){.mt-comments__form-fields{flex-direction:column}}

.mt-input{
  width:100%;padding:8px 0;font-size:14px;font-family:var(--mt-font);
  color:var(--mt-text);background:transparent;border:none;
  border-bottom:1px solid var(--mt-border);border-radius:0;outline:none;
  transition:border-color .2s;
}
.mt-input::placeholder{color:var(--mt-text-muted)}
.mt-input:focus{border-bottom-color:var(--mt-text)}
.mt-input--textarea{
  resize:none;min-height:24px;max-height:200px;overflow-y:auto;
  line-height:1.5;font-size:14px;border-bottom:1px solid var(--mt-border);padding:4px 0;
}
.mt-input--textarea:focus{border-bottom-color:var(--mt-text)}

.mt-comments__form-actions{
  display:flex;align-items:center;justify-content:flex-end;
  gap:8px;padding-top:8px;
}
.mt-comments__replying-to{
  font-size:12px;color:var(--mt-accent);display:flex;align-items:center;gap:4px;margin-right:auto;
}
.mt-comments__cancel-reply{background:none;border:none;cursor:pointer;font-size:16px;color:var(--mt-text-muted);padding:0}
.mt-comments__cancel-reply:hover{color:var(--mt-accent)}

#mt-comment-submit{
  padding:8px 16px;font-size:14px;font-weight:500;border-radius:18px;
  background:var(--mt-surface);color:var(--mt-text-muted);border:none;cursor:pointer;
  transition:all .15s;
}
#mt-comment-submit:hover,#mt-comment-submit:focus{
  background:var(--mt-accent);color:#fff;
}

/* Cancel button (YouTube has Cancel + Comment) */
.mt-comments__form-actions .mt-btn--cancel{
  padding:8px 16px;font-size:14px;font-weight:500;border-radius:18px;
  background:transparent;color:var(--mt-text);border:none;cursor:pointer;
}
.mt-comments__form-actions .mt-btn--cancel:hover{background:var(--mt-bg-hover)}

/* Comment items — YouTube style */
.mt-comments__list{display:flex;flex-direction:column}
.mt-comment{display:flex;gap:12px;padding:12px 0}
.mt-comment__avatar{flex-shrink:0}
.mt-comment__avatar img{width:40px;height:40px;border-radius:50%;object-fit:cover}
.mt-comment__body{flex:1;min-width:0}
.mt-comment__header{display:flex;align-items:center;gap:6px;margin-bottom:2px}
.mt-comment__name{font-size:13px;font-weight:500;color:var(--mt-text)}
.mt-comment__time{font-size:12px;color:var(--mt-text-muted)}

.mt-comment__text{font-size:14px;color:var(--mt-text);line-height:1.5;margin-bottom:4px;word-break:break-word}

/* Action buttons (like, reply) — YouTube style pill buttons */
.mt-comment__actions{display:flex;align-items:center;gap:0;margin-left:-8px}
.mt-comment__action{
  display:inline-flex;align-items:center;gap:4px;padding:6px 8px;
  background:none;border:none;font-size:12px;color:var(--mt-text-muted);
  cursor:pointer;border-radius:50%;transition:background .15s;
}
.mt-comment__action:hover{background:var(--mt-bg-hover)}
.mt-comment__action--like.liked{color:var(--mt-accent)}
.mt-comment__action--like.liked svg{fill:var(--mt-accent)}

/* Replies — indented with smaller avatars */
.mt-comment__replies{padding-left:52px;margin-top:4px}
.mt-comment__replies .mt-comment{padding:8px 0}
.mt-comment__replies .mt-comment__avatar img{width:24px;height:24px}
@media(max-width:480px){.mt-comment__replies{padding-left:32px}}

/* Load more */
.mt-comments__load-more{
  padding:8px 16px;font-size:14px;font-weight:500;color:var(--mt-accent);
  border:none;background:none;cursor:pointer;border-radius:18px;
  margin-top:8px;transition:background .15s;
}
.mt-comments__load-more:hover{background:var(--mt-bg-hover)}

/* States */
.mt-comment--pending{opacity:.5}

/* ═══════════════════════════════
   TESTIMONIALS (Homepage featured comments)
   ═══════════════════════════════ */
.mt-testimonials{padding:0 24px 24px}
.mt-testimonial-grid{display:grid;grid-template-columns:1fr;gap:16px}
@media(min-width:640px){.mt-testimonial-grid{grid-template-columns:repeat(2,1fr)}}
@media(min-width:1024px){.mt-testimonial-grid{grid-template-columns:repeat(3,1fr)}}

.mt-testimonial{
  background:var(--mt-surface);border-radius:var(--mt-radius);padding:20px;
  transition:background .2s;
}
.mt-testimonial:hover{background:var(--mt-bg-hover)}
.mt-testimonial__quote{font-size:24px;color:var(--mt-accent);line-height:1;margin-bottom:8px;opacity:.5}
.mt-testimonial__text{font-size:14px;color:var(--mt-text);line-height:1.6;margin-bottom:12px;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.mt-testimonial__footer{display:flex;align-items:center;gap:8px}
.mt-testimonial__avatar{width:28px;height:28px;border-radius:50%;object-fit:cover;flex-shrink:0}
.mt-testimonial__info{min-width:0}
.mt-testimonial__name{font-size:13px;font-weight:500;color:var(--mt-text)}
.mt-testimonial__video{font-size:12px;color:var(--mt-text-muted);display:block;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mt-testimonial__video:hover{color:var(--mt-accent)}
