/**
 * Watchmi Main Application Stylesheet
 * Responsive Material 3 Layout & Safe Area System
 */

/* Anti-Zoom Mobile Input Engine */
@media (max-width: 768px) {
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="file"],
  select,
  textarea,
  .form-control {
    font-size: 16px !important;
    touch-action: manipulation;
  }
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--md-sys-typescale-body-font);
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
  height: 100%;
  overflow-x: hidden !important;
  max-width: 100vw;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  overflow-x: hidden !important;
  max-width: 100vw;
}

/* Google / YouTube Top Bar Progress Line Loader */
#watchmi-top-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #ff0000, #ff4d4d, #ff8000, #ff0000);
  background-size: 300% 100%;
  z-index: 999999;
  opacity: 0;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 4px rgba(255, 0, 0, 0.5);
  pointer-events: none;
}
#watchmi-top-loader.active {
  opacity: 1;
  animation: watchmiTopLoaderGlow 1.2s infinite linear;
}
@keyframes watchmiTopLoaderGlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 300% 0%; }
}

/* Material Symbols Icon Utility - Prevents Icon Text String Flash (FOUC) */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  user-select: none;
  font-display: block;
  opacity: 0;
  transition: opacity 150ms ease-in;
}

html.icons-loaded .material-symbols-outlined,
.material-symbols-outlined.loaded {
  opacity: 1 !important;
}

/* Material 3 Skeleton Shimmer UI Loader System */
@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-box {
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-container-high) 25%,
    var(--md-sys-color-surface-dim) 50%,
    var(--md-sys-color-surface-container-high) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite linear;
  border-radius: var(--md-shape-corner-md);
  pointer-events: none;
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: var(--md-shape-corner-lg);
  overflow: hidden;
}

.skeleton-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--md-shape-corner-md);
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
}

.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }

/* ==========================================================================
   Safe Area Header & Top Navigation Bar
   ========================================================================== */
.top-app-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  height: calc(64px + var(--sat));
  padding-top: var(--sat);
  padding-left: max(16px, var(--sal));
  padding-right: max(16px, var(--sar));
  background-color: var(--md-sys-color-surface) !important;
  background: var(--md-sys-color-surface) !important;
  border-bottom: 1px solid var(--md-sys-color-outline-variant) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-sizing: border-box;
  transition: background-color var(--md-transition-standard);
}

@media (max-width: 768px) {
  body.shorts-page .top-app-bar {
    display: none !important;
  }
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--md-sys-color-brand-gradient);
  border-radius: var(--md-shape-corner-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 0, 51, 0.35);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title span.sub {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Search Bar Component */
.header-search-form {
  flex: 1;
  max-width: 640px;
  display: flex;
  align-items: center;
  position: relative;
}

.mobile-search-trigger-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .header-search-form {
    display: none !important;
  }
  .mobile-search-trigger-btn {
    display: flex !important;
  }
}

.mobile-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--md-sys-color-surface);
  z-index: 100005;
  display: none;
  flex-direction: column;
}

.mobile-search-overlay.active {
  display: flex;
}

.mobile-search-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  padding-top: max(8px, var(--sat));
  border-bottom: none;
  background-color: transparent;
  background: transparent;
}

.mobile-search-form {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.12) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.8) !important;
  border-radius: var(--md-shape-corner-full);
  padding: 0 4px 0 14px;
  height: 42px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.mobile-search-input::placeholder {
  color: rgba(255, 255, 255, 0.75) !important;
  opacity: 1;
}

.mobile-search-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
}

.mobile-search-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
  transition: background-color 150ms;
}

.mobile-search-item:hover, .mobile-search-item:active {
  background-color: var(--md-sys-color-surface-dim);
}

.mobile-search-item .item-icon {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 20px;
}

.mobile-search-item .item-title {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-search-item .item-thumb {
  width: 54px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.search-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 18px;
  border-radius: var(--md-shape-corner-full);
  border: 1.5px solid rgba(255, 255, 255, 0.8) !important;
  background-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--md-transition-standard);
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.75) !important;
  opacity: 1;
}

.search-input:focus {
  border-color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3) !important;
}

.search-btn {
  position: absolute;
  right: 4px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: #ffffff !important;
  border-radius: var(--md-shape-corner-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
  border-radius: var(--md-shape-corner-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--md-transition-standard);
}

.search-btn:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

/* Suggestions Dropdown */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-lg);
  box-shadow: var(--md-sys-shadow-3);
  overflow: hidden;
  z-index: 120;
  display: none;
}

.search-suggestions.active {
  display: block;
}

.suggestion-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 150ms;
}

.suggestion-item:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--md-shape-corner-full);
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color var(--md-transition-standard);
  text-decoration: none;
}

.icon-btn:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border-radius: var(--md-shape-corner-full);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--md-sys-color-outline-variant);
  transition: all var(--md-transition-standard);
}

.btn-upload:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  border-color: transparent;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: var(--md-shape-corner-full);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity var(--md-transition-standard), transform 150ms;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface) !important;
  border-radius: var(--md-shape-corner-full);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid var(--md-sys-color-outline-variant);
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.btn-secondary:hover {
  background-color: var(--md-sys-color-surface-dim);
  color: var(--md-sys-color-on-surface) !important;
  border-color: var(--md-sys-color-outline);
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* YouTube-Grade High-Contrast Primary, Secondary & Danger Buttons */
.btn-yt-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  background: #f1f1f1;
  color: #0f0f0f !important;
  border: none;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-yt-primary:hover {
  background: #ffffff;
}
.btn-yt-primary:active {
  transform: scale(0.98);
}
[data-theme="light"] .btn-yt-primary {
  background: #0f0f0f;
  color: #ffffff !important;
}
[data-theme="light"] .btn-yt-primary:hover {
  background: #272727;
}

.btn-yt-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--md-sys-color-on-surface) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-yt-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}
[data-theme="light"] .btn-yt-secondary {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .btn-yt-secondary:hover {
  background: rgba(0, 0, 0, 0.09);
}

.btn-yt-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-yt-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--md-shape-corner-full);
  object-fit: cover;
  border: none !important;
  cursor: pointer;
}

/* User Menu Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 16px;
  width: 240px;
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-lg);
  box-shadow: var(--md-sys-shadow-3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999 !important;
}

.user-dropdown.active {
  display: flex !important;
}

.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.dropdown-header .name {
  font-weight: 700;
  font-size: 0.95rem;
}

.dropdown-header .handle {
  font-size: 0.8rem;
  color: var(--md-sys-color-on-surface-variant);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 150ms;
}

.dropdown-item:hover {
  background-color: var(--md-sys-color-surface-container-high);
}

/* ==========================================================================
   Main Layout & Responsive Drawer
   ========================================================================== */
.app-container {
  display: flex;
  flex: 1;
  margin-top: calc(64px + var(--sat));
  min-height: calc(100vh - 64px - var(--sat));
}

.nav-drawer {
  width: 250px;
  background-color: var(--md-sys-color-surface);
  border-right: none;
  padding: 12px 12px 60px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
  position: fixed !important;
  top: calc(64px + var(--sat)) !important;
  left: 0 !important;
  height: calc(100vh - 64px - var(--sat)) !important;
  height: calc(100dvh - 64px - var(--sat)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  z-index: 900 !important;
  box-sizing: border-box;

  /* Hide Vertical Scrollbar across all browsers (Firefox, IE, Edge) */
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

/* Chrome, Safari, WebKit Scrollbar Hiding */
.nav-drawer::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

@media (min-width: 769px) {
  .main-content {
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    transition: margin-left 220ms cubic-bezier(0.05, 0, 0, 1), width 220ms cubic-bezier(0.05, 0, 0, 1);
  }

  .nav-drawer {
    width: 250px !important;
    transition: width 220ms cubic-bezier(0.05, 0, 0, 1), padding 220ms cubic-bezier(0.05, 0, 0, 1);
    overflow-x: hidden !important;
  }

  .drawer-link {
    display: flex !important;
    align-items: center !important;
    transition: all 220ms cubic-bezier(0.05, 0, 0, 1);
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .drawer-link-text {
    display: inline-block !important;
    max-width: 160px;
    opacity: 1;
    white-space: nowrap !important;
    overflow: hidden !important;
    transition: max-width 220ms cubic-bezier(0.05, 0, 0, 1), opacity 180ms ease, margin 220ms ease;
  }

  .nav-group-title {
    max-height: 24px;
    opacity: 1;
    overflow: hidden !important;
    transition: max-height 220ms cubic-bezier(0.05, 0, 0, 1), opacity 150ms ease, padding 220ms ease, margin 220ms ease;
  }

  /* YouTube-Style Collapsible Sidebar (Collapsed Mode) */
  html.sidebar-collapsed .nav-drawer,
  body.sidebar-collapsed .nav-drawer {
    width: 72px !important;
    padding: 10px 4px 60px 4px !important;
    gap: 6px !important;
  }

  html.sidebar-collapsed .main-content,
  body.sidebar-collapsed .main-content {
    margin-left: 72px !important;
    width: calc(100% - 72px) !important;
  }

  html.sidebar-collapsed .nav-group,
  body.sidebar-collapsed .nav-group {
    background: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    gap: 6px !important;
  }

  html.sidebar-collapsed .nav-group-title,
  body.sidebar-collapsed .nav-group-title {
    max-height: 0 !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
  }

  html.sidebar-collapsed .drawer-link-text,
  body.sidebar-collapsed .drawer-link-text {
    max-width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  html.sidebar-collapsed .drawer-link,
  body.sidebar-collapsed .drawer-link {
    justify-content: center !important;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin: 2px auto !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
    gap: 0 !important;
  }

  /* Active/Selected Tab in Collapsed Mode - Complete Rounded Pill Border */
  html.sidebar-collapsed .drawer-link.active,
  body.sidebar-collapsed .drawer-link.active {
    background-color: var(--md-sys-color-surface-container-high) !important;
    color: var(--md-sys-color-on-surface) !important;
    border-radius: 16px !important;
    border: 1px solid var(--md-sys-color-outline-variant) !important;
    box-shadow: var(--md-sys-shadow-1) !important;
  }

  html.sidebar-collapsed .drawer-link:hover,
  body.sidebar-collapsed .drawer-link:hover {
    background-color: var(--md-sys-color-surface-container-high) !important;
    border-radius: 16px !important;
  }

  html.sidebar-collapsed .drawer-link .material-symbols-outlined,
  body.sidebar-collapsed .drawer-link .material-symbols-outlined {
    font-size: 24px !important;
    margin: 0 !important;
  }
}

/* Watchmi Unique Grouped Navigation Drawer Containers */
.nav-group {
  background-color: var(--md-sys-color-surface-dim);
  border: none;
  border-radius: var(--md-shape-corner-xl);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--md-sys-color-on-surface-variant);
  padding: 6px 12px 2px 12px;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-radius: var(--md-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--md-transition-standard);
}

.drawer-link:hover {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.drawer-link.active {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  font-weight: 700;
  border-radius: var(--md-shape-corner-full);
}

.drawer-link.active .material-symbols-outlined {
  color: var(--md-sys-color-primary);
}

/* ==========================================================================
   Offline Downloads Page Header & Recommended Sidebar Layout
   ========================================================================== */
.offline-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--md-sys-color-surface-dim);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  padding: 22px 28px;
  margin-bottom: 24px;
  gap: 16px;
}

.offline-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.offline-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.offline-icon-circle .material-symbols-outlined {
  font-size: 30px;
}

.offline-page-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
}

.offline-page-desc {
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
}

.offline-storage-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--md-shape-corner-full);
  background-color: var(--md-sys-color-surface-container-high);
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  flex-shrink: 0;
}

.downloads-layout-wrapper {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 768px) {
  .offline-header-card {
    padding: 10px 14px;
    margin-bottom: 14px;
    border-radius: var(--md-shape-corner-lg);
  }
  .offline-icon-circle {
    display: none;
  }
  .offline-page-desc {
    display: none;
  }
  .offline-page-title {
    font-size: 1.1rem;
    font-weight: 800;
  }
  .offline-storage-badge {
    padding: 4px 10px;
    font-size: 0.725rem;
  }
}

@media (max-width: 992px) {
  .downloads-layout-wrapper {
    grid-template-columns: 1fr;
  }
}

.downloads-sidebar-pane {
  background-color: var(--md-sys-color-surface-dim);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-pane-header {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.recommended-downloads-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rec-download-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.rec-thumb-wrap {
  position: relative;
  width: 120px;
  aspect-ratio: 16 / 9;
  border-radius: var(--md-shape-corner-md);
  overflow: hidden;
  flex-shrink: 0;
}

.rec-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-duration {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 3px;
}

.rec-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.rec-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-channel {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.rec-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-full);
  color: var(--md-sys-color-on-surface);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  width: fit-content;
  transition: all 150ms;
}

.rec-download-btn:hover {
  background-color: var(--md-sys-color-primary);
  color: #ffffff;
  border-color: var(--md-sys-color-primary);
}

.drawer-divider {
  height: 1px;
  background-color: var(--md-sys-color-outline-variant);
  margin: 8px 0;
}

.main-content {
  flex: 1;
  padding: 20px max(24px, var(--sar)) 40px max(24px, var(--sal));
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 1800px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ==========================================================================
   Category Filters Chips
   ========================================================================== */
.category-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 20px;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.chip {
  padding: 8px 16px;
  border-radius: var(--md-shape-corner-full);
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--md-transition-standard);
  border: 1px solid transparent;
}

.chip:hover {
  background-color: var(--md-sys-color-outline-variant);
}

.chip.active {
  background-color: var(--md-sys-color-on-surface);
  color: var(--md-sys-color-surface);
}

/* ==========================================================================
   Material 3 & YouTube-Style Shimmering Skeleton Loading System
   ========================================================================== */
@keyframes ytShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.yt-skeleton-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.yt-skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-dim) 25%,
    var(--md-sys-color-surface-container-high) 37%,
    var(--md-sys-color-surface-dim) 63%
  );
  background-size: 200% 100%;
  animation: ytShimmer 1.4s ease-in-out infinite;
  border-radius: 0;
}

@media (min-width: 769px) {
  .yt-skeleton-thumb {
    border-radius: var(--md-shape-corner-lg);
  }
}

.yt-skeleton-details {
  display: flex;
  gap: 12px;
  padding: 12px 14px 0 14px;
}

.yt-skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-dim) 25%,
    var(--md-sys-color-surface-container-high) 37%,
    var(--md-sys-color-surface-dim) 63%
  );
  background-size: 200% 100%;
  animation: ytShimmer 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.yt-skeleton-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.yt-skeleton-line {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--md-sys-color-surface-dim) 25%,
    var(--md-sys-color-surface-container-high) 37%,
    var(--md-sys-color-surface-dim) 63%
  );
  background-size: 200% 100%;
  animation: ytShimmer 1.4s ease-in-out infinite;
}

.yt-skeleton-line.w-80 { width: 80%; }
.yt-skeleton-line.w-40 { width: 40%; }

/* ==========================================================================
   Video Grid & Cards Layout — Mobile-First
   ========================================================================== */

/* Mobile (default — no media query needed, mobile is base) */
.video-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.video-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  border-radius: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 0 16px 0;
  background: transparent !important;
  box-sizing: border-box;
}

.video-card:hover {
  transform: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.thumbnail-container {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  border-radius: 0 !important;
  border: none !important;
  background-color: var(--md-sys-color-surface-container-high);
}

.thumbnail-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-details {
  display: flex;
  gap: 12px;
  padding: 12px 12px 0 12px;
}

.main-content {
  padding: 0 0 70px 0;
}

.category-bar {
  padding: 8px 12px 10px 12px;
  margin-bottom: 4px;
}

/* Full Width Watch Page Player on Mobile */
.watch-container {
  padding: 0;
  gap: 0;
}

.player-wrapper {
  border-radius: 0;
  margin: 0;
  width: 100%;
}

.video-watch-meta {
  padding: 14px 14px 20px 14px;
}

/* ── Desktop overrides (769px+) ── */
@media (min-width: 769px) {
  .video-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px 16px !important;
  }

  .video-card {
    border-radius: 16px !important;
    border: 1px solid transparent !important;
    padding: 10px;
    background-color: var(--md-sys-color-surface);
    overflow: hidden !important;
    transition: transform 250ms cubic-bezier(0.2, 0, 0, 1), background-color 250ms ease, box-shadow 250ms ease, border-color 250ms ease !important;
  }

  .video-card:hover {
    transform: translateY(-4px) !important;
    background-color: var(--card-accent-bg, var(--md-sys-color-surface-container-high)) !important;
    border-color: var(--card-accent-border, var(--md-sys-color-outline-variant)) !important;
    box-shadow: 0 12px 28px -4px var(--card-accent-glow, rgba(0, 0, 0, 0.25)) !important;
  }

  .thumbnail-container {
    border-radius: 12px !important;
    overflow: hidden !important;
  }

  .thumbnail-img {
    border-radius: 12px !important;
    transition: transform 300ms ease !important;
  }

  .video-card:hover .thumbnail-img {
    transform: scale(1.03) !important;
  }

  .video-details {
    padding-top: 12px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .main-content {
    padding: 20px max(24px, var(--sar)) 40px max(24px, var(--sal));
  }

  .category-bar {
    padding-bottom: 12px;
    margin-bottom: 20px;
    padding-left: 0;
    padding-right: 0;
  }

  .watch-container {
    padding: unset;
    gap: 24px;
  }

  .player-wrapper {
    border-radius: var(--md-shape-corner-lg);
    margin: unset;
  }

  .video-watch-meta {
    padding: unset;
  }
}

/* ==========================================================================
   Watch Page — Top App Bar Visible on Mobile (Back Arrow + Title + Search)
   ========================================================================== */
@media (max-width: 768px) {
  body.watch-page .top-app-bar {
    display: flex !important;
  }

  /* Hide brand logo on watch page mobile — back arrow + title display instead */
  body.watch-page .watch-brand-container {
    display: none !important;
  }

  body.watch-page .watch-back-btn {
    display: flex !important;
    align-items: center !important;
  }

  .watch-back-btn-icon {
    display: flex !important;
  }

  body.watch-page .main-content {
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.watch-page .player-wrapper {
    border-radius: 0 !important;
    width: 100% !important;
  }
}

@media (min-width: 769px) {
  .watch-back-btn-icon {
    display: none !important;
  }
}

/* ==========================================================================
   Shorts Page — Full Screen 9:16 Fills iPhone Notch Area (no top bar)
   ========================================================================== */
@media (max-width: 768px) {
  body.shorts-page .top-app-bar {
    display: none !important;
  }

  body.shorts-page .app-container {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  body.shorts-page .main-content {
    padding: 0 !important;
    overflow: hidden !important;
  }

  body.shorts-page .shorts-feed-wrapper {
    /* Start from the very top of the screen (behind the status bar / notch) */
    top: 0 !important;
    height: 100dvh !important;
    /* Leave room for the bottom nav only */
    bottom: calc(56px + var(--sab, 0px)) !important;
    height: calc(100dvh - 56px - var(--sab, 0px)) !important;
  }

  body.shorts-page .short-overlay-top {
    /* Respect the notch safe area for the back button / search bar */
    top: max(20px, env(safe-area-inset-top, 20px)) !important;
  }
}


.disable-theme-transitions,
.disable-theme-transitions *,
.disable-theme-transitions *::before,
.disable-theme-transitions *::after {
  transition: none !important;
}


.card-dropdown-item:hover {
  background-color: var(--md-sys-color-surface-dim);
  color: var(--md-sys-color-on-surface) !important;
}

.video-card-link {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}


.card-dropdown-menu {
  position: absolute;
  top: 36px;
  right: 0;
  width: 190px;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-md);
  box-shadow: var(--md-sys-shadow-3);
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
}

.card-dropdown-menu.active {
  display: flex;
}

.card-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface);
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background-color 150ms;
}

.card-dropdown-item:hover {
  background-color: var(--md-sys-color-surface-dim);
  color: var(--md-sys-color-primary);
}




/* ── Thumbnail & Card Base Component Rules ── */
.thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--md-sys-color-surface-container-high);
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

@media (min-width: 769px) {
  .video-card:hover .thumbnail-img {
    transform: scale(1.04);
  }
}

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 3px 6px;
  border-radius: var(--md-shape-corner-xs);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.video-details {
  display: flex;
  gap: 12px;
}

.channel-avatar {

  width: 36px;
  height: 36px;
  border-radius: var(--md-shape-corner-full);
  object-fit: cover;
  flex-shrink: 0;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.video-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  position: relative;
}

.video-title-link {
  flex: 1;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
  min-width: 0;
}

.video-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--md-sys-color-on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-more-menu-wrapper {
  position: relative;
  flex-shrink: 0;
}

.card-more-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms, color 150ms;
}

.card-more-btn:hover {
  background: var(--md-sys-color-surface-dim);
  color: var(--md-sys-color-on-surface);
}

.channel-name {
  font-size: 0.825rem;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  gap: 4px;
}

.video-stats {
  font-size: 0.8rem;
  color: var(--md-sys-color-on-surface-variant);
}

/* ==========================================================================
   Watch Page Layout & Custom Material Video Player — Mobile-First
   ========================================================================== */
.watch-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

@media (min-width: 1250px) {
  .watch-container {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
  }
}

.watch-primary-pane {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.watch-sidebar-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.rec-watch-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (max-width: 1249px) {
  .rec-watch-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
  }
}

.rec-watch-item {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--md-shape-corner-md);
  padding: 4px;
  transition: background-color 150ms;
}

.rec-watch-item:hover {
  background-color: var(--md-sys-color-surface-dim);
}

.rec-watch-thumb-wrap {
  width: 140px;
  aspect-ratio: 16 / 9;
  position: relative;
  flex-shrink: 0;
  border-radius: var(--md-shape-corner-md);
  overflow: hidden;
  background: var(--md-sys-color-surface-container-high);
}

.rec-watch-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rec-watch-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.rec-watch-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--md-sys-color-on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rec-watch-channel, .rec-watch-stats {
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
}

.player-wrapper {
  width: 100%;
  background: #000;
  border-radius: var(--md-shape-corner-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--md-sys-shadow-3);
  aspect-ratio: 16 / 9;
  z-index: 1;
}

.ambient-glow-canvas {
  position: absolute;
  top: -25%;
  left: -25%;
  width: 150%;
  height: 150%;
  filter: blur(50px) brightness(0.85) saturate(1.5);
  opacity: 0.75;
  pointer-events: none;
  z-index: 1;
  transition: opacity 300ms ease;
}

.custom-video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 2;
}

/* Video Player Controls Overlay */
.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transition: opacity 200ms ease;
  z-index: 10;
}

.player-wrapper:hover .player-controls-overlay,
.player-wrapper.paused .player-controls-overlay,
.progress-bar-container.scrubbing ~ .controls-row,
.player-controls-overlay:has(.scrubbing) {
  opacity: 1;
}

/* Progress Scrubber (YouTube Style Thin Progress Bar) */
.progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: height 150ms ease;
}

.progress-bar-container:hover,
.progress-bar-container.scrubbing {
  height: 5px;
}

.progress-bar-filled {
  height: 100%;
  background: #ff0033;
  border-radius: 999px;
  width: 0%;
  position: relative;
}

.progress-bar-filled::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 12px;
  height: 12px;
  background: #ff0033;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 150ms ease;
}

.progress-bar-container:hover .progress-bar-filled::after,
.progress-bar-container.scrubbing .progress-bar-filled::after {
  transform: translateY(-50%) scale(1);
}

/* YouTube Style Translucent Buffer Ahead Track */
.progress-bar-buffered {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  width: 0%;
  pointer-events: none;
  transition: width 200ms ease;
  z-index: 1;
}

.progress-bar-filled {
  z-index: 2;
}

/* Material 3 Centered Circular Buffering Spinner */
.player-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  pointer-events: none;
  z-index: 15;
}
.player-spinner .spinner-circle {
  width: 100%;
  height: 100%;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ff0033;
  border-radius: 50%;
  animation: watchmi-player-spin 0.8s linear infinite;
}
@keyframes watchmi-player-spin {
  to { transform: rotate(360deg); }
}

/* YouTube Mobile Double-Tap to Seek Overlays */
.seek-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 38%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  z-index: 12;
  pointer-events: none;
  transition: opacity 250ms ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.seek-ripple-left {
  left: 0;
  border-radius: 0 100px 100px 0;
}
.seek-ripple-right {
  right: 0;
  border-radius: 100px 0 0 100px;
}
.seek-ripple .material-symbols-outlined {
  font-size: 38px;
}
.seek-ripple .seek-text {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 4px;
}

/* Big Center Play/Pause Ripple Indicator */
.center-play-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 14;
  pointer-events: none;
  animation: watchmi-center-pop 450ms ease forwards;
}
.center-play-indicator .material-symbols-outlined {
  font-size: 38px;
}
@keyframes watchmi-center-pop {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}

/* Playback Speed Menu Dropdown */
.speed-dropdown {
  position: absolute;
  bottom: 100%;
  right: 0;
  margin-bottom: 12px;
  background: rgba(24, 24, 27, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 6px 0;
  min-width: 130px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  z-index: 30;
}
.speed-opt {
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 150ms ease;
  white-space: nowrap;
}
.speed-opt:hover {
  background: rgba(255, 255, 255, 0.14);
}
.speed-opt.active {
  color: #ff0033;
  font-weight: 800;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.p-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 150ms;
}

.p-btn:hover {
  opacity: 1;
}

.time-display {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Watch Meta Details */
/* Watch Meta Details */
.video-watch-meta {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.watch-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  margin: 0;
}

@media (min-width: 769px) {
  .watch-title {
    font-size: 1.35rem;
  }
}

.watch-action-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

@media (min-width: 600px) {
  .watch-action-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

.channel-info-block {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  flex-shrink: 0;
}

.channel-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.channel-text .c-name {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-text .c-subs {
  font-size: 0.78rem;
  color: var(--md-sys-color-on-surface-variant);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-subscribe {
  padding: 8px 18px;
  border-radius: var(--md-shape-corner-full);
  font-weight: 700;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--md-transition-standard);
  background-color: var(--md-sys-color-on-surface);
  color: var(--md-sys-color-surface);
}

.btn-subscribe.subscribed {
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
}

.watch-actions-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.watch-actions-scroll::-webkit-scrollbar {
  display: none;
}

.action-buttons-group {
  display: flex;
  align-items: center;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: var(--md-shape-corner-full);
  overflow: hidden;
  flex-shrink: 0;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 150ms;
  white-space: nowrap;
}

.action-btn:hover {
  background-color: var(--md-sys-color-outline-variant);
}

.action-btn .material-symbols-outlined {
  color: var(--md-sys-color-on-surface);
  transition: color 150ms ease;
}

.action-btn.active .material-symbols-outlined {
  color: #ff0033;
}

.action-btn span:not(.material-symbols-outlined),
.action-btn #like-count {
  color: var(--md-sys-color-on-surface) !important;
}

.action-divider {
  width: 1px;
  height: 20px;
  background-color: var(--md-sys-color-outline);
}

/* Description Box */
.video-description-box {
  background-color: var(--md-sys-color-surface-container);
  border-radius: var(--md-shape-corner-md);
  padding: 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  width: 100%;
  box-sizing: border-box;
}

/* Comments Section */
.comments-section {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-input-form {
  display: flex;
  gap: 12px;
}

.comment-textarea {
  flex: 1;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 0.9rem;
  padding: 8px 0;
  resize: vertical;
  min-height: 40px;
  outline: none;
  transition: border-color var(--md-transition-standard);
}

.comment-textarea:focus {
  border-color: var(--md-sys-color-primary);
}

.comment-card {
  display: flex;
  gap: 12px;
}

.comment-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.comment-author {
  font-weight: 700;
  font-size: 0.85rem;
}

.comment-date {
  font-weight: 400;
  font-size: 0.75rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-left: 6px;
}

.comment-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

/* ==========================================================================
   Mobile Bottom Navigation & Safe Areas
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--sab));
  padding-bottom: var(--sab);
  background-color: rgba(15, 15, 15, 0.75) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
}

[data-theme="light"] .mobile-bottom-nav {
  background-color: rgba(255, 255, 255, 0.82) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 600;
  width: 20%;
}

.mobile-nav-item.active,
.mobile-nav-item.active *,
.mobile-nav-item.active .material-symbols-outlined {
  color: var(--md-sys-color-on-surface) !important;
  font-weight: 800;
}

/* Notification Bell Dropdown & Badges */
.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background-color: var(--md-sys-color-primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 420px;
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-lg);
  box-shadow: var(--md-sys-shadow-3);
  display: none;
  flex-direction: column;
  z-index: 2000;
  overflow: hidden;
}

.notif-dropdown.active {
  display: flex;
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-list {
  overflow-y: auto;
  max-height: 340px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: background-color 150ms;
}

.notif-item.unread {
  background-color: var(--md-sys-color-surface-container-high);
}

/* Mobile Account Settings Drawer & Triggers */
.mobile-settings-trigger {
  display: none;
}

.mobile-account-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: none;
  opacity: 0;
  transition: opacity 250ms ease;
}

.mobile-account-backdrop.active {
  display: block;
  opacity: 1;
}

.mobile-account-drawer {
  position: fixed;
  bottom: 0; right: 0; left: 0;
  background-color: var(--md-sys-color-surface);
  border-top-left-radius: var(--md-shape-corner-xl);
  border-top-right-radius: var(--md-shape-corner-xl);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-shadow-3);
  z-index: 10001;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.0, 0, 1.0);
  padding: 20px;
}

.mobile-account-drawer.active {
  transform: translateY(0);
}

.mobile-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  margin-bottom: 12px;
}

.mobile-account-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--md-shape-corner-md);
  transition: background-color 150ms;
}

.mobile-account-item:hover,
.mobile-account-item:active {
  background-color: var(--md-sys-color-surface-container-high);
}

/* Standard Native OS/Windows Mouse Cursor */
.watchmi-cursor-dot,
.watchmi-cursor-ring {
  display: none !important;
}

/* Responsive Mobile & Desktop Layout Overrides */
@media (max-width: 768px) {
  .btn-upload {
    display: none !important;
  }
  .mobile-settings-trigger {
    display: inline-flex !important;
  }
  .user-avatar-wrapper,
  .user-avatar-btn,
  .guest-signin-btn {
    display: none !important;
  }
  .nav-drawer {
    display: none !important;
  }
  .mobile-bottom-nav {
    display: flex !important;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-bottom: calc(72px + var(--sab));
  }
  .brand-title span.sub {
    display: none;
  }
}

/* Auth Cards */
.auth-card {
  max-width: 440px;
  margin: 40px auto;
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  padding: 32px;
  box-shadow: var(--md-sys-shadow-2);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.form-control {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--md-shape-corner-md);
  border: 1px solid var(--md-sys-color-outline);
  background-color: var(--md-sys-color-surface-dim);
  color: var(--md-sys-color-on-surface);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--md-transition-standard);
}

.form-control:focus {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface);
  box-shadow: 0 0 0 3px var(--md-sys-color-primary-container);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--md-shape-corner-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--md-sys-color-outline);
  border-radius: var(--md-shape-corner-xl);
  padding: 48px 24px;
  text-align: center;
  background-color: var(--md-sys-color-surface-dim);
  cursor: pointer;
  transition: all var(--md-transition-standard);
}

.upload-dropzone:hover {
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container);
}

/* ==========================================================================
   Share & Social Media Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100000 !important;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  padding: 24px;
  box-shadow: var(--md-sys-shadow-3);
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalPop 200ms ease;
}

@keyframes modalPop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-weight: 800;
  font-size: 1.25rem;
}

.social-share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}

.social-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: var(--md-shape-corner-lg);
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  font-size: 0.725rem;
  font-weight: 700;
  transition: all var(--md-transition-standard);
  border: none;
  cursor: pointer;
  word-break: break-word;
}

.social-share-btn:hover {
  transform: translateY(-2px);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-primary);
}

.social-icon-wrapper {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
}

.share-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--md-sys-color-surface-dim);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-shape-corner-full);
  padding: 4px 6px 4px 14px;
}

.share-url-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-size: 0.825rem;
  outline: none;
  min-width: 0;
}

/* Mobile Small Screen Optimizations for Share Modal */
@media (max-width: 480px) {
  .modal-overlay {
    padding: 10px;
  }

  .modal-card {
    padding: 16px;
    gap: 14px;
    max-height: calc(100dvh - 20px);
  }

  .modal-title {
    font-size: 1.1rem;
  }

  .social-share-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 4px;
  }

  .social-share-btn {
    padding: 8px 2px;
    font-size: 0.65rem;
    gap: 4px;
  }

  .social-icon-wrapper {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   Material 3 Smooth Modal & Popup Transitions System
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms cubic-bezier(0.2, 0, 0, 1), visibility 250ms cubic-bezier(0.2, 0, 0, 1);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background-color: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  box-shadow: var(--md-sys-shadow-3);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  transform: scale(0.92) translateY(12px);
  transition: transform 250ms cubic-bezier(0.2, 0, 0, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   Material 3 Responsive Toast Notification System
   ========================================================================== */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 100010 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 32px);
}

@media (max-width: 768px) {
  #toast-container {
    top: auto;
    bottom: 74px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.toast-msg {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--md-shape-corner-lg);
  background-color: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-12px) scale(0.95);
  transition: all 250ms cubic-bezier(0.2, 0, 0, 1);
}

.toast-msg.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-msg.toast-error {
  border-left: 4px solid #ff3355;
}

.toast-msg.toast-error .toast-icon {
  color: #ff3355;
}

.toast-msg.toast-success {
  border-left: 4px solid #10b981;
}

.toast-msg.toast-success .toast-icon {
  color: #10b981;
}

.toast-msg.toast-info {
  border-left: 4px solid var(--md-sys-color-primary);
}

.toast-msg.toast-info .toast-icon {
  color: var(--md-sys-color-primary);
}

.toast-close-btn {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  transition: color 150ms;
}

.toast-close-btn:hover {
  color: var(--md-sys-color-on-surface);
}

/* Material 3 Scroll Reveal Animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 450ms cubic-bezier(0.2, 0, 0, 1), transform 450ms cubic-bezier(0.2, 0, 0, 1);
}

.scroll-reveal.reveal-active {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 480px) {
  .share-input-group {
    padding: 4px 6px 4px 10px;
  }
  .onboarding-grid-row {
    grid-template-columns: 1fr !important;
  }
  #post-login-onboarding-modal .modal-card {
    padding: 20px 14px !important;
    max-height: calc(100vh - 32px) !important;
    border-radius: var(--md-shape-corner-lg) !important;
  }
}

/* Responsive Top Bar Navigation Controls */
.topbar-back-btn,
.watch-back-btn-icon,
.icon-btn-back,
.mobile-back-btn,
.mobile-history-back {
  display: inline-flex;
}

@media (max-width: 768px) {
  /* Hide Sidebar Hamburger Button on Mobile */
  .sidebar-toggle-btn,
  #sidebar-toggle-btn {
    display: none !important;
  }
  
  /* Show Top Bar Back Button on Mobile */
  .topbar-back-btn,
  .watch-back-btn-icon {
    display: inline-flex !important;
  }

  .desktop-only-brand {
    display: none !important;
  }

  /* Full-width mobile Auth cards (Login / Register / Verify / Forgot Password) */
  .auth-card-container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 8px 0 32px 0 !important;
    padding: 24px 16px !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
    box-shadow: none !important;
  }
}

@media (min-width: 769px) {
  /* Hide Top Bar Back Button on Desktop (Desktop Browsers already have titlebar back buttons) */
  .topbar-back-btn:not(.show-desktop),
  .watch-back-btn-icon,
  .icon-btn-back,
  .mobile-back-btn,
  .mobile-history-back {
    display: none !important;
  }
  
  .topbar-back-btn.show-desktop {
    display: inline-flex !important;
  }
  
  .desktop-only-brand {
    display: flex !important;
  }
}

.auth-card-container {
  max-width: 460px;
  margin: 32px auto;
  background: var(--md-sys-color-surface);
  padding: 32px;
  border-radius: var(--md-shape-corner-xl);
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: var(--md-sys-shadow-3);
  position: relative;
  box-sizing: border-box;
}

/* Mobile Account Settings Drawer - Drawable Sidebar (Right-to-Left) */
.mobile-account-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999900 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms cubic-bezier(0.2, 0, 0, 1), visibility 250ms cubic-bezier(0.2, 0, 0, 1);
}

.mobile-account-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-account-drawer {
  position: fixed;
  top: 0;
  right: 0 !important;
  left: auto !important;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background-color: var(--md-sys-color-surface);
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.45);
  z-index: 999950 !important;
  display: flex;
  flex-direction: column;
  transform: translateX(100%) !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  border-radius: 0 !important;
  transition: transform 300ms cubic-bezier(0.2, 0, 0, 1), visibility 300ms, opacity 300ms;
  overflow-y: auto;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.mobile-account-drawer::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

.mobile-account-drawer.active {
  transform: translateX(0) !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.mobile-account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(24px + var(--sat)) !important;
  padding-bottom: 16px;
  padding-left: 20px;
  padding-right: 20px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

/* YouTube Shorts Horizontal Carousel on Homepage */
.home-shorts-section {
  grid-column: 1 / -1;
  margin: 12px 0 16px 0;
  padding: 0;
  border: none !important;
  box-sizing: border-box;
}

.home-shorts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.home-shorts-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--md-sys-color-on-background);
}

.home-shorts-title-badge .material-symbols-outlined {
  color: #ff0033;
  font-size: 26px;
}

.home-shorts-carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.home-shorts-carousel::-webkit-scrollbar {
  height: 4px;
}

.home-shorts-carousel::-webkit-scrollbar-thumb {
  background: var(--md-sys-color-outline-variant);
  border-radius: 4px;
}

.home-shorts-card {
  flex: 0 0 170px;
  width: 170px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--md-sys-color-surface-container);
  border: 1px solid var(--md-sys-color-outline-variant);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-shorts-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.home-shorts-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-shorts-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.25) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px;
  color: #ffffff;
  box-sizing: border-box;
}

.home-shorts-card-title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.home-shorts-views {
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 768px) {
  .home-shorts-card {
    flex: 0 0 145px;
    width: 145px;
    border-radius: 12px;
  }
}

/* Mobile-First Settings Page Layout */
.settings-page-wrapper {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .settings-page-wrapper {
    padding: 24px 16px 48px 16px;
  }
}

.settings-directory-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-group-header {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--md-sys-color-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.settings-menu-card {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-shape-corner-xl);
  overflow: hidden;
  box-shadow: var(--md-sys-shadow-1);
}

.settings-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: background-color 150ms ease;
  box-sizing: border-box;
}

.settings-menu-item:last-child {
  border-bottom: none;
}

.settings-menu-item:hover,
.settings-menu-item:active {
  background-color: var(--md-sys-color-surface-container-high);
}

.item-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-text-box {
  flex: 1;
  min-width: 0;
}

.item-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--md-sys-color-on-surface);
  line-height: 1.3;
}

.item-sub {
  font-size: 0.8rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-top: 2px;
  line-height: 1.3;
}

.item-arrow {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 20px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .settings-page-wrapper {
    padding: 8px 12px 32px 12px;
  }
  .settings-menu-card {
    border-radius: var(--md-shape-corner-lg);
  }
  .settings-menu-item {
    padding: 12px 14px;
  }
  .item-icon-box {
    width: 36px;
    height: 36px;
  }
  .item-label {
    font-size: 0.9rem;
  }
  .item-sub {
    font-size: 0.775rem;
  }
}
