/* ==========================================================================
   NotDistract V5 - Modern, Calm, Distraction-Free YouTube Experience
   ========================================================================== */

:root {
  --bg-base: #090a0f;
  --bg-surface: #121520;
  --bg-surface-elevated: #1a1e2e;
  --bg-surface-hover: #23293d;
  --border-subtle: #1e2436;
  --border-active: #ef4444;
  --border-highlight: #333d57;

  --accent: #ef4444;
  --accent-hover: #dc2626;
  --accent-glow: rgba(239, 68, 68, 0.2);
  --accent-subtle: rgba(239, 68, 68, 0.1);

  --success: #10b981;
  --success-subtle: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.12);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-muted: #475569;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient Background Glow */
.ambient-glow {
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Accessibility: Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Accessibility: Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.5rem;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  transition: opacity var(--transition-fast);
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 40%, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-pill {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.active-focus-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-subtle);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.active-focus-pill:hover {
  background: rgba(239, 68, 68, 0.2);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulseAnimation 2s infinite ease-in-out;
}

@keyframes pulseAnimation {
  0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
  70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.nav-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  border-color: var(--border-highlight);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   MAIN CONTENT & CONTAINER
   ========================================================================== */
.main-content {
  flex: 1;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* ==========================================================================
   VIEW 1: SEARCH-FIRST HOMEPAGE
   ========================================================================== */
.home-container {
  max-width: 760px;
  margin: 2.5rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.philosophy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.philosophy-badge span.arrow {
  color: var(--accent);
}

.home-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.home-title .highlight {
  color: var(--accent);
}

.home-tagline {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 2.25rem;
  max-width: 540px;
}

/* Search Box Container */
.search-form {
  width: 100%;
  margin-bottom: 2rem;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 0.4rem 0.5rem 0.4rem 1.25rem;
  transition: all var(--transition-normal);
}

.search-input-wrapper:focus-within {
  border-color: var(--border-active);
  box-shadow: 0 0 0 3px var(--accent-glow), var(--shadow-md);
  background: var(--bg-surface-elevated);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--text-primary);
  min-width: 0;
  padding: 0.6rem 0;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.search-clear-btn.visible {
  display: flex;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

.search-clear-btn svg {
  width: 16px;
  height: 16px;
}

.search-submit-btn {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.search-submit-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.search-submit-btn:active {
  transform: translateY(1px);
}

.search-hint {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 0.5rem;
  text-align: left;
  padding: 0 1rem;
}

/* Recent Searches */
.recent-searches-box {
  width: 100%;
  margin-bottom: 3rem;
  text-align: left;
}

.recent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.recent-title {
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.clear-recent-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.clear-recent-btn:hover {
  color: var(--accent);
}

.recent-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.recent-pill:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.recent-pill .remove-pill-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.recent-pill .remove-pill-btn:hover {
  color: var(--accent);
}

/* Focus Mode Explanation Card */
.philosophy-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.philosophy-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.philosophy-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

.philosophy-step {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.step-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.step-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.step-desc {
  font-size: 0.825rem;
  color: var(--text-tertiary);
  line-height: 1.45;
}

/* ==========================================================================
   VIEW 2: SEARCH RESULTS
   ========================================================================== */
.results-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.results-info-group {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}

.results-query-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.results-actions {
  display: flex;
  gap: 0.5rem;
}

.back-to-search-btn {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.back-to-search-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

/* Results Grid */
.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.video-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
  cursor: pointer;
}

.thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

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

.duration-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.play-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.video-card:hover .play-hover-overlay {
  opacity: 1;
}

.play-hover-icon {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.5);
  transform: scale(0.9);
  transition: transform var(--transition-fast);
}

.video-card:hover .play-hover-icon {
  transform: scale(1);
}

.video-card-body {
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.video-title {
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.video-title:hover {
  color: var(--accent);
}

.channel-name {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.video-meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.775rem;
  color: var(--text-tertiary);
  margin-bottom: 1.15rem;
}

.meta-dot {
  font-size: 0.5rem;
}

.focus-start-btn {
  margin-top: auto;
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

.focus-start-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.focus-start-btn svg {
  width: 16px;
  height: 16px;
}

/* Loading Skeleton */
.skeleton-card {
  pointer-events: none;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(90deg, #121520 25%, #1c2132 50%, #121520 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, #121520 25%, #1c2132 50%, #121520 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 0.5rem;
}

.skeleton-line.title { width: 90%; height: 18px; margin-bottom: 0.75rem; }
.skeleton-line.channel { width: 50%; }
.skeleton-line.meta { width: 35%; margin-bottom: 1.25rem; }
.skeleton-line.btn { width: 100%; height: 38px; border-radius: var(--radius-md); }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty & Error States */
.state-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 580px;
  margin: 3rem auto;
}

.state-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  color: var(--accent);
  background: var(--accent-subtle);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-box h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.state-box p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.state-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   VIEW 3: FOCUS MODE (The Signature Feature)
   ========================================================================== */
.focus-container {
  max-width: 1100px;
  margin: 0 auto;
}

.focus-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.focus-nav-back {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.focus-nav-back:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.focus-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.focus-status-indicator.active {
  background: var(--accent-subtle);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent);
}

.focus-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 900px) {
  .focus-layout {
    grid-template-columns: 1fr 340px;
    align-items: start;
  }
}

/* Video Player Area */
.player-column {
  display: flex;
  flex-direction: column;
}

.player-frame-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-subtle);
}

.player-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.focus-video-details {
  margin-top: 1.25rem;
  padding: 0.5rem 0;
}

.focus-video-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.focus-video-channel {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Focus Session Dashboard Column */
.focus-dashboard-column {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.focus-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.focus-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.focus-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.focus-card-header svg {
  color: var(--accent);
}

/* Presets */
.preset-label {
  font-size: 0.775rem;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.preset-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.5rem 0.2rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.preset-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.preset-btn.active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
}

.custom-duration-input-wrapper {
  display: none;
  margin-bottom: 1.25rem;
}

.custom-duration-input-wrapper.visible {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.custom-min-input {
  width: 80px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.65rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.custom-min-input:focus {
  border-color: var(--accent);
  outline: none;
}

/* Circular Timer Display */
.timer-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 1.5rem;
}

.timer-circle-container {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-circle-bg {
  fill: none;
  stroke: var(--bg-surface-elevated);
  stroke-width: 8;
}

.timer-circle-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.timer-text-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.timer-countdown {
  font-size: 2.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.timer-status-subtext {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-top: 0.35rem;
}

/* Timer Controls */
.timer-action-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-primary-action {
  flex: 1;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all var(--transition-fast);
}

.btn-primary-action:hover {
  background: var(--accent-hover);
}

.btn-secondary-action {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

/* Finish Session Button */
.finish-session-btn {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 0.5rem;
}

.finish-session-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* Intention Input */
.intention-box {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.intention-label {
  display: block;
  font-size: 0.775rem;
  color: var(--text-tertiary);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.intention-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  font-family: inherit;
  outline: none;
}

.intention-input:focus {
  border-color: var(--border-highlight);
}

/* Focus Mode Tips Card */
.focus-tips-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

.focus-tips-card strong {
  color: var(--text-secondary);
}

/* ==========================================================================
   MODALS & DRAWERS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease forwards;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  position: relative;
  animation: slideUp 0.25s ease forwards;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.modal-icon-badge.warning {
  background: var(--warning-subtle);
  color: var(--warning);
}

.modal-icon-badge.success {
  background: var(--success-subtle);
  color: var(--success);
}

.modal-icon-badge.accent {
  background: var(--accent-subtle);
  color: var(--accent);
}

.modal-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-video-preview {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.modal-video-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.modal-video-name {
  color: var(--text-primary);
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-button-group {
  display: flex;
  gap: 0.75rem;
}

.modal-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.modal-btn.primary {
  background: var(--accent);
  color: #ffffff;
  border: none;
}

.modal-btn.primary:hover {
  background: var(--accent-hover);
}

.modal-btn.secondary {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.modal-btn.secondary:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* Session History Drawer */
.history-modal-card {
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 1.75rem;
}

.history-stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1.25rem 0;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 600;
}

.history-list-scroll {
  overflow-y: auto;
  max-height: 400px;
  padding-right: 0.5rem;
  margin-bottom: 1.25rem;
}

.history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.history-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.history-status-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-status-icon.completed {
  background: var(--success-subtle);
  color: var(--success);
}

.history-status-icon.partial {
  background: var(--warning-subtle);
  color: var(--warning);
}

.history-details {
  min-width: 0;
}

.history-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item-sub {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.history-item-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.history-duration-tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.history-refocus-btn {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-refocus-btn:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.history-empty-message {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* Settings Modal */
.settings-group {
  margin-bottom: 1.25rem;
}

.settings-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.settings-helper {
  font-size: 0.775rem;
  color: var(--text-tertiary);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.settings-input {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.settings-input:focus {
  border-color: var(--accent);
}

.settings-select {
  width: 100%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--bg-surface-hover);
  border: 1px solid var(--border-subtle);
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
  border-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-base);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-nav-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
@media (max-width: 768px) {
  .home-title {
    font-size: 2.15rem;
  }

  .home-tagline {
    font-size: 1rem;
    margin-bottom: 1.75rem;
  }

  .search-input-wrapper {
    padding: 0.35rem 0.4rem 0.35rem 1rem;
  }

  .search-submit-btn {
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }

  .modal-button-group {
    flex-direction: column;
  }

  .header-nav .brand-pill {
    display: none;
  }

  .site-header {
    padding: 0.6rem 1rem;
  }
}
