/* ============================================
   Zahava Media
   (c) Zahava Media
   ============================================ */

:root {
  --blue: #2E67AB;
  --blue-light: #3a7bc8;
  --blue-bg: rgba(46, 103, 171, 0.08);
  --blue-dark: #0b1628;
  --blue-body: #0f1f38;
  --coral: #ED6D53;
  --coral-light: #f28570;
  --coral-bg: rgba(237, 109, 83, 0.08);
  --bg: #f9f9f9;
  --white: #ffffff;
  --dark: #1e1e32;
  --muted: #78829a;
  --border: #e2e6ef;
  --border-light: #f0f2f7;
  --green: #34c759;
  --green-bg: rgba(52, 199, 89, 0.08);
  --red: #ff3b30;
  --red-bg: rgba(255, 59, 48, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
  --transition: 0.2s ease;
  --accent: #2E67AB;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--blue-body);
  color: var(--dark);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---- Auth Screens ---- */
.screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.screen.hidden { display: none !important; }

.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo { width: 280px; margin: 0 auto 24px; display: block; }
.auth-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.auth-subtitle { font-size: 14px; color: var(--muted); margin-bottom: 28px; line-height: 1.5; }
.auth-hint { font-size: 13px; color: var(--muted); margin-top: 20px; }
.auth-hint a { color: var(--blue); text-decoration: none; font-weight: 600; }

/* ---- Inputs ---- */
.input-group { margin-bottom: 16px; text-align: left; }
.input-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input-group input, .input-full {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--dark);
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition);
}
.input-group input:focus, .input-full:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-bg);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px; font-size: 14px; font-weight: 600;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-light); }
.btn-outline { background: transparent; color: var(--blue); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); background: var(--blue-bg); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Social Sign-In Buttons ---- */
.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; font-size: 15px; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: all var(--transition); font-family: inherit;
  border: 1.5px solid var(--border); margin-bottom: 10px;
  position: relative;
}
.btn-google {
  background: var(--white); color: var(--dark);
}
.btn-google:hover { background: #f5f5f5; border-color: #ccc; }

.btn-apple {
  background: var(--white); color: var(--dark);
  opacity: 0.45; cursor: not-allowed;
  filter: grayscale(0.4);
}
.coming-soon-badge {
  font-size: 10px; font-weight: 700; color: var(--white);
  background: var(--muted); border-radius: 10px;
  padding: 2px 8px; margin-left: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: var(--muted); font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}

.error-text { color: var(--red); font-size: 13px; margin-bottom: 8px; text-align: left; }
.error-text.hidden { display: none; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,0.3); border-top-color: var(--white);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 16px auto 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   TOP BAR
   ============================================ */
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: var(--blue-dark);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; z-index: 100;
}
.topbar-left {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; flex-shrink: 0;
}
.topbar-logo { height: 46px; }

.topbar-spacer { flex: 1; }

.gear-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: transparent; color: rgba(255,255,255,0.5);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.gear-btn:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.gear-btn.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   BROWSE VIEW
   ============================================ */
#browse-view {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.section-heading {
  margin-bottom: 16px;
  margin-top: 8px;
}
.section-heading h2 {
  font-size: 18px; font-weight: 700; color: rgba(255,255,255,0.9);
}
.section-heading:not(:first-child) {
  margin-top: 32px;
}

/* ---- Regular Video Grid ---- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  background: var(--coral);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.video-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.video-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #e0e0e0;
}
.video-card-body {
  padding: 12px 14px;
  display: flex;
  gap: 10px;
}
.video-card-info { flex: 1; min-width: 0; }
.video-card-title {
  font-size: 14px; font-weight: 600; color: var(--white);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  line-height: 1.4; margin-bottom: 4px;
}
.video-card-channel {
  font-size: 12px; color: rgba(255,255,255,0.8);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.video-card-meta {
  font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 2px;
}

/* ---- Shorts Carousel ---- */
.shorts-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.shorts-carousel::-webkit-scrollbar { height: 6px; }
.shorts-carousel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }
.shorts-carousel::-webkit-scrollbar-track { background: transparent; }

.short-card {
  min-width: 155px;
  max-width: 155px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  flex-shrink: 0;
  position: relative;
  background: #000;
  transition: transform var(--transition);
}
.short-card:hover { transform: scale(1.04); }
.short-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
}
.short-card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 28px 8px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}
.short-card-title {
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.short-card-channel {
  color: rgba(255,255,255,0.6);
  font-size: 10px;
  margin-top: 3px;
}

.grid-loading { text-align: center; padding: 40px; }
.grid-empty { text-align: center; color: rgba(255,255,255,0.6); padding: 60px 20px; font-size: 15px; }

/* ============================================
   PLAYER VIEW
   ============================================ */
#player-view {
  padding: 20px;
  max-width: 960px;
  margin: 0 auto;
}
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; font-size: 14px; font-weight: 600;
  border: none; background: rgba(255,255,255,0.1); color: var(--white);
  cursor: pointer; border-radius: var(--radius-sm);
  transition: background var(--transition); margin-bottom: 12px;
  font-family: inherit;
}
.back-btn:hover { background: rgba(255,255,255,0.18); }

.player-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.player-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* YouTube native controls are used — no custom controls needed */

/* Fullscreen styles */
.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  padding-bottom: 0;
  border-radius: 0;
}

/* ---- End-Screen Overlay ---- */
.player-ended-overlay {
  position: absolute;
  inset: 0;
  background: rgba(46, 103, 171, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeInOverlay 0.3s ease;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.overlay-logo { width: 170px; margin-bottom: 16px; }
.overlay-title {
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 24px;
  text-align: center;
  padding: 0 20px;
  max-width: 400px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.overlay-buttons { display: flex; gap: 12px; }
.overlay-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}
.overlay-btn-primary {
  background: var(--coral);
  color: var(--white);
  border: none;
}
.overlay-btn-primary:hover { background: var(--coral-light); }
.overlay-btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.4);
}
.overlay-btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }

.player-info { padding: 16px 0; }
.player-info h2 { font-size: 18px; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.player-info .player-channel { font-size: 14px; color: rgba(255,255,255,0.65); margin-bottom: 4px; }
.player-info .player-stats { font-size: 13px; color: rgba(255,255,255,0.45); }
.player-info .player-desc {
  margin-top: 12px; font-size: 13px; color: rgba(255,255,255,0.75);
  line-height: 1.6; white-space: pre-line;
  max-height: 120px; overflow: hidden;
  background: rgba(255,255,255,0.06);
  padding: 12px; border-radius: var(--radius-sm);
}
.player-info .player-desc.expanded { max-height: none; }
.show-more-btn {
  border: none; background: none; color: var(--coral);
  font-weight: 600; font-size: 13px; cursor: pointer;
  padding: 4px 0; font-family: inherit;
}

/* ============================================
   SHORTS PLAYER (full-screen flip-through)
   ============================================ */
.shorts-player-view {
  position: fixed;
  inset: 0;
  background: var(--blue-dark);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
}
.shorts-player-view.hidden { display: none !important; }

.shorts-close-btn {
  position: absolute;
  top: 16px; left: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: background var(--transition);
}
.shorts-close-btn:hover { background: rgba(255,255,255,0.2); }

.shorts-brand-logo {
  position: absolute;
  top: 20px; right: 20px;
  height: 44px;
  opacity: 0.7;
  z-index: 10;
}

.shorts-player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 400px;
  width: 100%;
}

.shorts-video-wrap {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  background: #000;
}
.shorts-video-wrap iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
/* YouTube native controls used for shorts — no custom overlays needed */

.shorts-player-info {
  padding: 12px 4px;
  width: 100%;
}
.shorts-info-title {
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.shorts-info-channel {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  margin-top: 4px;
}

.shorts-nav {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  z-index: 10;
}
.shorts-nav-btn {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.12);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.shorts-nav-btn:hover { background: rgba(255,255,255,0.25); }
.shorts-nav-btn:disabled { opacity: 0.3; cursor: default; }
.shorts-counter {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
  font-weight: 600;
}

/* ============================================
   SETTINGS OVERLAY
   ============================================ */
.settings-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; justify-content: flex-end;
}
.settings-overlay.hidden { display: none !important; }
.settings-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  animation: fadeInBg 0.2s ease;
}
@keyframes fadeInBg { from { opacity: 0; } to { opacity: 1; } }

.settings-panel {
  position: relative;
  width: 100%; max-width: 440px;
  background: var(--white);
  height: 100%;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.settings-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--white); z-index: 1;
}
.settings-header h2 { font-size: 17px; font-weight: 700; }
.settings-close-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: var(--bg); color: var(--dark);
  font-size: 22px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  transition: background var(--transition);
}
.settings-close-btn:hover { background: var(--border); }

.settings-body { padding: 20px; }
.settings-auth-text { font-size: 14px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }

.settings-section {
  margin-bottom: 28px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; margin-bottom: 6px;
}
.section-desc { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.4; }

.mode-toggle-wrap {
  display: flex; background: var(--bg);
  border-radius: 8px; padding: 3px; border: 1px solid var(--border);
}
.mode-btn {
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  border: none; background: transparent; color: var(--muted);
  border-radius: 6px; cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.mode-btn.active { background: var(--blue); color: var(--white); }

.channel-search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.channel-search-row .input-full { flex: 1; }
.channel-results { margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.channel-results.hidden { display: none; }
.channel-result-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.channel-result-item:last-child { border-bottom: none; }
.channel-result-item:hover { background: var(--blue-bg); }
.channel-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.channel-initial { display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-subs { font-size: 11px; color: var(--muted); }
.channel-add-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 600;
  border: 1.5px solid var(--blue); background: transparent; color: var(--blue);
  border-radius: 6px; cursor: pointer; transition: all var(--transition); font-family: inherit;
}
.channel-add-btn:hover { background: var(--blue); color: var(--white); }
.channel-add-btn.added { border-color: var(--green); color: var(--green); pointer-events: none; }

.channel-list { margin-top: 4px; }
.channel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.channel-item:last-child { border-bottom: none; }
.channel-remove-btn {
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: var(--red-bg); color: var(--red);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0; transition: all var(--transition);
}
.channel-remove-btn:hover { background: var(--red); color: var(--white); }

/* Preset Channel Categories (Accordion) */
/* Collapsible Sections */
.collapsible-section { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-top: 12px; overflow: hidden; }
.collapsible-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: #ccc;
  transition: background var(--transition);
}
.collapsible-header:hover { background: var(--blue-bg); }
.collapsible-arrow { font-size: 10px; color: var(--muted); transition: transform 0.2s; }
.collapsible-section.open .collapsible-arrow { transform: rotate(180deg); }
.collapsible-body { display: none; padding: 0 14px 12px; }
.collapsible-section.open .collapsible-body { display: block; }

/* Channel Filter Tabs */
.channel-tabs {
  display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.channel-tabs::-webkit-scrollbar { display: none; }
.channel-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--border); background: transparent; color: #aaa;
  cursor: pointer; white-space: nowrap; transition: all var(--transition); flex-shrink: 0;
}
.channel-tab:hover { border-color: var(--blue); color: var(--blue); }
.channel-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.channel-tab img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* Load More Button */
.load-more-btn { padding: 12px 32px; font-size: 14px; border-radius: 24px; }

/* Legal links inside settings */
.settings-legal-links {
  text-align: center; padding: 12px 0 0; font-size: 12px; color: #888;
}
.settings-legal-links a { color: #666; text-decoration: none; }
.settings-legal-links a:hover { text-decoration: underline; color: var(--blue); }
.settings-legal-links span { margin: 0 6px; }

.preset-channels { margin-top: 8px; }
.preset-category { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 6px; overflow: hidden; }
.preset-category-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; cursor: pointer; transition: background var(--transition);
}
.preset-category-header:hover { background: var(--blue-bg); }
.preset-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.preset-category-name { flex: 1; font-size: 13px; font-weight: 600; color: #333; }
.preset-arrow { font-size: 10px; color: var(--muted); transition: transform 0.2s; }
.preset-category.open .preset-arrow { transform: rotate(180deg); }
.preset-channel-list {
  display: none; padding: 0 12px 8px;
}
.preset-category.open .preset-channel-list { display: block; }
.preset-channel-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-top: 1px solid var(--border-light);
}
.preset-channel-thumb { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.preset-channel-initial { display: flex; align-items: center; justify-content: center; background: var(--border); color: #999; font-size: 11px; font-weight: 700; }
.preset-channel-name { font-size: 12px; color: #555; flex: 1; }
.preset-add-btn { margin-left: auto; }

/* Preset add buttons (shared) */
.preset-add-btn {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 12px; border: 1px solid var(--blue);
  background: transparent; color: var(--blue); cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.preset-add-btn:hover { background: var(--blue); color: var(--white); }
.preset-add-btn.added {
  background: rgba(46, 103, 171, 0.15); border-color: transparent;
  color: var(--muted); cursor: default;
}
.preset-add-btn:disabled { opacity: 0.6; cursor: wait; }

/* Profile PIN edit button */
.profile-pin-edit-btn { margin-left: auto; flex-shrink: 0; }

.empty-state { font-size: 12px; color: var(--muted); text-align: center; padding: 12px; font-style: italic; }
.empty-state.hidden { display: none; }

.keyword-input-row { display: flex; gap: 8px; margin-bottom: 10px; }
.keyword-input-row .input-full { flex: 1; }
.keyword-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 20px; }
.keyword-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 8px 5px 10px;
  background: var(--coral-bg); border: 1px solid rgba(237,109,83,0.2);
  border-radius: 16px; font-size: 12px; font-weight: 500; color: var(--coral);
}
.keyword-remove {
  width: 16px; height: 16px; border-radius: 50%;
  border: none; background: rgba(237,109,83,0.15); color: var(--coral);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.keyword-remove:hover { background: var(--coral); color: var(--white); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
}
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; margin-right: 12px; }
.setting-label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 1px; }
.setting-desc { font-size: 11px; color: var(--muted); }

.toggle { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 26px; transition: all var(--transition);
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 20px; height: 20px; left: 3px; bottom: 3px;
  background: var(--white); border-radius: 50%;
  transition: all var(--transition); box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* Sign-Out PIN Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0.5); display: flex;
  align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: var(--white); border-radius: 12px;
  padding: 24px; width: 300px; max-width: 90vw;
  box-shadow: var(--shadow-lg); text-align: center;
}
.modal-card h3 { font-size: 16px; color: var(--dark); margin-bottom: 4px; }
.modal-card .pin-hint { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.modal-card .text-input {
  width: 100%; padding: 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14px;
  text-align: center; color: var(--dark); background: #f8f9fb;
}
.modal-card .error-text { font-size: 11px; color: var(--red); margin-top: 6px; }

/* Profile Picker Screen */
.profile-picker-card {
  background: var(--white);
  border-radius: 16px; padding: 40px 36px;
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); text-align: center;
}
.profile-list {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center; margin-top: 20px;
}
.profile-card {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; padding: 12px 16px; border-radius: var(--radius);
  transition: all var(--transition); min-width: 80px;
  border: 2px solid transparent;
}
.profile-card:hover { background: var(--blue-bg); border-color: var(--blue); }
.profile-avatar {
  font-size: 40px; width: 60px; height: 60px;
  background: var(--bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 6px;
}
.profile-card-name {
  font-size: 13px; font-weight: 600; color: var(--dark);
}

/* Profile Indicator in Topbar */
.profile-indicator {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08); border: none;
  color: rgba(255,255,255,0.8); padding: 4px 10px 4px 6px;
  border-radius: 20px; cursor: pointer; font-family: inherit;
  font-size: 12px; font-weight: 600;
  transition: background var(--transition); flex-shrink: 0;
}
.profile-indicator:hover { background: rgba(255,255,255,0.15); }
.profile-indicator.hidden { display: none; }
.profile-avatar-sm { font-size: 18px; }
.profile-name-text { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Profile Manager in Settings */
.settings-profile-list { margin-top: 8px; }
.settings-profile-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border-light);
}
.settings-profile-item:last-child { border-bottom: none; }
.settings-profile-avatar { font-size: 24px; }
.settings-profile-info { flex: 1; min-width: 0; }
.settings-profile-name { font-size: 13px; font-weight: 600; }
.settings-profile-meta { font-size: 11px; color: var(--muted); }
.profile-delete-btn {
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: var(--red-bg); color: var(--red);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; flex-shrink: 0;
  transition: all var(--transition);
}
.profile-delete-btn:hover { background: var(--red); color: var(--white); }
.avatar-picker {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px;
}
.avatar-option {
  width: 40px; height: 40px; font-size: 22px;
  border: 2px solid var(--border); border-radius: 50%;
  background: var(--bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.avatar-option:hover { border-color: var(--blue); }
.avatar-option.selected { border-color: var(--blue); background: var(--blue-bg); }

/* Activity Dashboard */
.dashboard-stats {
  display: flex; gap: 8px; margin-top: 8px;
}
.stat-card {
  flex: 1; background: var(--blue-bg); border: 1px solid rgba(46,103,171,0.12);
  border-radius: var(--radius-sm); padding: 12px 8px; text-align: center;
}
.stat-value {
  font-size: 20px; font-weight: 700; color: var(--blue);
}
.stat-label {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}
.dashboard-chart {
  margin-top: 8px;
}
.chart-bar-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.chart-bar-label {
  font-size: 11px; color: var(--muted); width: 40px;
  text-align: right; flex-shrink: 0;
}
.chart-bar-track {
  flex: 1; height: 18px; background: var(--bg);
  border-radius: 4px; overflow: hidden; position: relative;
}
.chart-bar-fill {
  height: 100%; background: var(--blue); border-radius: 4px;
  min-width: 2px; transition: width 0.3s ease;
}
.chart-bar-fill.coral { background: var(--coral); }
.chart-bar-value {
  font-size: 10px; color: var(--muted); width: 32px;
  flex-shrink: 0;
}

/* Time Indicator in Topbar */
.time-indicator {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  padding: 4px 10px; border-radius: 12px;
  flex-shrink: 0;
}

/* Connect to Phone */
.connected-phones-list {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px;
}
.connected-phone-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--blue-bg); border-radius: var(--radius-sm);
  font-size: 13px; color: var(--dark);
}
.connected-phone-item .phone-name {
  display: flex; align-items: center; gap: 8px; font-weight: 600;
}
.connected-phone-item .phone-remove {
  background: none; border: none; color: var(--red); cursor: pointer;
  font-size: 16px; padding: 2px 6px; border-radius: 4px; transition: background var(--transition);
}
.connected-phone-item .phone-remove:hover { background: var(--red-bg); }

.qr-display {
  text-align: center; padding: 20px 0;
}
.qr-code-container {
  display: flex; justify-content: center; margin-bottom: 16px;
}
.qr-code-container canvas, .qr-code-container img {
  border-radius: 12px; background: white; padding: 12px;
  box-shadow: var(--shadow-lg);
}
.qr-confirm-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; color: var(--muted); margin-bottom: 6px;
}
.qr-confirm-code {
  font-size: 36px; font-weight: 900; letter-spacing: 8px;
  color: var(--blue); font-family: 'SF Mono', 'Fira Code', monospace;
}
.qr-instructions {
  font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5;
}
.pairing-divider {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
}
.pairing-divider::before, .pairing-divider::after {
  content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.1);
}
.pairing-divider span {
  font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px;
}
.short-code-url {
  font-size: 13px; color: var(--blue); font-weight: 600;
  background: rgba(91,147,212,0.1); border: 1px solid rgba(91,147,212,0.2);
  border-radius: 8px; padding: 6px 12px; text-align: center;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.qr-short-code {
  font-size: 32px; font-weight: 900; letter-spacing: 6px;
  color: #fff; font-family: 'SF Mono', 'Fira Code', monospace;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 8px 16px; text-align: center;
}
.connect-success {
  text-align: center; padding: 24px 0;
}
.connect-success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--green-bg); color: var(--green);
  font-size: 24px; font-weight: 700; margin-bottom: 8px;
}
.connect-success p {
  font-size: 14px; font-weight: 600; color: var(--dark);
}

/* Block Everything Overlay */
.blocked-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(15, 31, 56, 0.98);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.blocked-overlay.hidden { display: none !important; }
.blocked-content { text-align: center; color: var(--white); }
.blocked-icon { font-size: 64px; margin-bottom: 16px; }
.blocked-content h2 { font-size: 28px; margin-bottom: 8px; }
.blocked-content p { font-size: 16px; color: rgba(255,255,255,0.7); }
.blocked-sub { font-size: 13px !important; color: rgba(255,255,255,0.4) !important; margin-top: 4px; }

/* Time's Up Overlay */
.timesup-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15, 31, 56, 0.97);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.timesup-overlay.hidden { display: none !important; }
.timesup-content { text-align: center; color: var(--white); }
.timesup-icon { font-size: 64px; margin-bottom: 16px; }
.timesup-content h2 { font-size: 28px; margin-bottom: 8px; }
.timesup-content p { font-size: 16px; color: rgba(255,255,255,0.7); }
.timesup-sub { font-size: 13px !important; color: rgba(255,255,255,0.4) !important; margin-top: 4px; }
.timesup-pin-modal {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.timesup-pin-modal.hidden { display: none; }
.timesup-extend-row {
  display: flex; gap: 6px; margin-top: 10px;
}
.timesup-extend-btn {
  flex: 1; padding: 8px; font-size: 13px; font-weight: 600;
  border: 1.5px solid var(--blue); background: var(--blue-bg);
  color: var(--blue); border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit;
  transition: all var(--transition);
}
.timesup-extend-btn:hover {
  background: var(--blue); color: var(--white);
}

/* Watch History */
.watch-history-list {
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
}
.history-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: var(--blue-bg); }
.history-thumb {
  width: 80px; height: 45px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0; background: #e0e0e0;
}
.history-info { flex: 1; min-width: 0; }
.history-title {
  font-size: 12px; font-weight: 600; color: var(--dark);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3;
}
.history-meta {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}

/* PWA Install Banner */
.install-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; gap: 12px;
  background: linear-gradient(135deg, var(--blue), var(--coral));
  color: var(--white);
  font-size: 13px; font-weight: 600;
}
.install-banner.hidden { display: none !important; }
.install-text { flex: 1; }
.install-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.install-dismiss {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(255,255,255,0.2); color: var(--white);
  font-size: 16px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.install-dismiss:hover { background: rgba(255,255,255,0.3); }

/* Toast */
.save-toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: var(--white);
  padding: 10px 20px; border-radius: 24px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0;
  transition: all 0.3s ease; z-index: 300; pointer-events: none;
}
.save-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 700px) {
  .topbar { padding: 8px 12px; gap: 10px; }
  .topbar-logo { height: 58px; }
  #browse-view { padding: 14px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .short-card { min-width: 130px; max-width: 130px; }
  .video-card-body { padding: 10px; gap: 8px; }
  .video-card-title { font-size: 13px; }
  #player-view { padding: 12px; }
  .settings-panel { max-width: 100%; }
  .overlay-logo { width: 110px; }
  .overlay-title { font-size: 13px; }
  .overlay-buttons { flex-direction: column; gap: 8px; }
  .shorts-player-center { max-width: 100%; padding: 0 12px; }
  .shorts-nav { right: 8px; }
  .shorts-nav-btn { width: 40px; height: 40px; }
  .shorts-close-btn { top: 8px; left: 8px; width: 38px; height: 38px; }
  .shorts-brand-logo { top: 12px; right: 12px; height: 30px; }
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: repeat(2, 1fr); }
  .short-card { min-width: 120px; max-width: 120px; }
}

/* YouTube Attribution */
.yt-attribution {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #b8c4d8;
  padding: 24px 16px 32px;
  flex-wrap: wrap;
}
.yt-attribution-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #78829a;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}
.yt-attribution-link:hover {
  color: #b8c4d8;
}
.yt-attr-logo {
  flex-shrink: 0;
}
.yt-attr-links {
  font-size: 12px;
  color: #78829a;
}
.yt-attr-links a {
  color: #5b7ca5;
  text-decoration: none;
}
.yt-attr-links a:hover {
  text-decoration: underline;
}
