/* ============================================================
   Air Search — Styles
   Cloud Dancer white/black theme · Plus Jakarta Sans
   ============================================================ */

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

:root {
  /* Cloud Dancer — Warm white palette */
  --bg-primary: #F0EDE5;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #FAF8F5;
  --bg-hover: #E8E4DC;
  --bg-card: #FFFFFF;

  /* Dark greys (never pure black) */
  --text-primary: #2D2D2D;
  --text-secondary: #6B6B6B;
  --text-muted: #9E9E9E;

  /* Links */
  --link-color: #1A0DAB;
  --link-visited: #681DA8;
  --link-hover: #1A0DAB;
  --url-color: #188038;

  /* Accent */
  --accent: #2D2D2D;
  --accent-soft: #3D3D3D;
  --accent-glow: rgba(45, 45, 45, 0.08);
  --accent-gradient: linear-gradient(135deg, #2D2D2D 0%, #555555 100%);

  /* Borders */
  --border-color: #E0DCD4;
  --border-focus: #2D2D2D;

  /* Answer box */
  --answer-bg: #FFFFFF;
  --answer-border: #E0DCD4;

  /* Sizing */
  --max-width: 720px;
  --search-bar-height: 52px;
  --radius: 12px;
  --radius-sm: 8px;

  /* Font */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

a:visited {
  color: var(--link-visited);
}

/* ── App Layout ────────────────────────────────────────────── */
#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}



#logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
}

#logo:hover {
  text-decoration: none;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.logo-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Main Content ──────────────────────────────────────────── */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
}

/* ── Search Container ──────────────────────────────────────── */
#search-container {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all var(--transition-slow);
}

#search-container.home {
  margin-top: 25vh;
}

#search-container.compact {
  margin-top: 0;
  padding: 16px 0;
}

/* ── Header (Google-style Results View) ──────────────────────── */
#header {
  width: 100%;
  display: none;
}

body.results-mode {
  padding-top: 130px; /* Space for the fixed header */
}

body.results-mode #header {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
}

.header-top {
  display: flex;
  align-items: center;
  padding: 20px 24px 16px 24px;
  min-height: 76px;
}

/* Position search container overlapping the header in results mode */
body.results-mode #search-container.compact {
  margin-top: 0;
  padding: 0;
  position: fixed;
  top: 16px;
  left: 170px;
  width: calc(100% - 200px);
  max-width: var(--max-width);
  z-index: 101;
}

/* ── Sub Navigation ────────────────────────────────────────── */
#subnav {
  display: none;
}

body.results-mode #subnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 0 170px;
  overflow-x: auto;
  white-space: nowrap;
}

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

.subnav-item {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  padding-bottom: 12px;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  transition: color var(--transition);
}

.subnav-item:hover {
  color: var(--text-primary);
}

.subnav-item.active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.subnav-icon {
  margin-right: 4px;
}

/* ── Hero Logo (Home only) ─────────────────────────────────── */
#hero-logo {
  text-align: center;
  margin-bottom: 32px;
  transition: all var(--transition-slow);
}

#hero-logo.hero-hidden {
  display: none;
}

.hero-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.1;
  color: var(--text-primary);
}

.hero-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-top: 8px;
  font-weight: 400;
}

/* ── Search Bar ────────────────────────────────────────────── */
#search-form {
  width: 100%;
  position: relative;
}

#search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--search-bar-height);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0 6px 0 18px;
  transition: all var(--transition);
  gap: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

#search-bar:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08), 0 0 0 2px var(--accent-glow);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

#search-input {
  flex: 1;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  padding: 0 8px;
  caret-color: var(--accent);
}

#search-input::placeholder {
  color: var(--text-muted);
}

#clear-btn,
#search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

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

#clear-btn svg,
#search-btn svg {
  width: 18px;
  height: 18px;
}

#clear-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

#search-btn {
  background: var(--accent);
  color: var(--bg-secondary);
}

#search-btn:hover {
  background: var(--accent-soft);
  transform: scale(1.05);
}

/* ── Suggestions Dropdown ──────────────────────────────────── */
#suggestions-dropdown {
  position: absolute;
  top: calc(var(--search-bar-height) + 4px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.suggestion-item {
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.suggestion-item:hover,
.suggestion-item.active {
  background: var(--bg-hover);
}

.suggestion-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ── Results Container ─────────────────────────────────────── */
#results-container {
  width: 100%;
  max-width: var(--max-width);
  padding: 8px 0 48px;
}

/* ── Results Meta ──────────────────────────────────────────── */
#results-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 0 16px;
}

#results-meta span {
  color: var(--text-secondary);
}

/* ── Instant Answer ────────────────────────────────────────── */
#instant-answer {
  background: var(--answer-bg);
  border: 1px solid var(--answer-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.answer-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.answer-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.answer-source {
  margin-top: 10px;
  font-size: 0.82rem;
}

.answer-source a {
  color: var(--url-color);
}

.answer-image {
  width: 100%;
  max-width: 200px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

/* ── Result Item ───────────────────────────────────────────── */
.result-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(224, 220, 212, 0.6);
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

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

.result-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.result-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.result-display-url {
  font-size: 0.82rem;
  color: var(--url-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-title {
  margin-bottom: 4px;
}

.result-title a {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--link-color);
  text-decoration: none;
  line-height: 1.4;
  display: inline-block;
}

.result-title a:visited {
  color: var(--link-visited);
}

.result-title a:hover {
  text-decoration: underline;
  color: var(--link-hover);
}

.result-snippet {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-meta {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Stagger animation delay per result */
.result-item:nth-child(1) { animation-delay: 0.03s; }
.result-item:nth-child(2) { animation-delay: 0.06s; }
.result-item:nth-child(3) { animation-delay: 0.09s; }
.result-item:nth-child(4) { animation-delay: 0.12s; }
.result-item:nth-child(5) { animation-delay: 0.15s; }
.result-item:nth-child(6) { animation-delay: 0.18s; }
.result-item:nth-child(7) { animation-delay: 0.21s; }
.result-item:nth-child(8) { animation-delay: 0.24s; }
.result-item:nth-child(9) { animation-delay: 0.27s; }
.result-item:nth-child(10) { animation-delay: 0.30s; }

/* ── Skeleton Loading State ─────────────────────────────────── */
#loading {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.skeleton-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(224, 220, 212, 0.6);
}

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

.skeleton-url-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.skeleton-favicon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-hover);
  position: relative;
  overflow: hidden;
}

.skeleton-url {
  width: 140px;
  height: 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  position: relative;
  overflow: hidden;
}

.skeleton-title {
  width: 75%;
  height: 18px;
  border-radius: 6px;
  background: var(--bg-hover);
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}

.skeleton-snippet {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  position: relative;
  overflow: hidden;
}

.skeleton-line:nth-child(1) { width: 100%; }
.skeleton-line:nth-child(2) { width: 92%; }
.skeleton-line:nth-child(3) { width: 60%; }

/* Shimmer sweep animation */
.skeleton-favicon::after,
.skeleton-url::after,
.skeleton-title::after,
.skeleton-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Stagger shimmer across skeleton items */
.skeleton-item:nth-child(1) .skeleton-title::after,
.skeleton-item:nth-child(1) .skeleton-line::after { animation-delay: 0s; }
.skeleton-item:nth-child(2) .skeleton-title::after,
.skeleton-item:nth-child(2) .skeleton-line::after { animation-delay: 0.15s; }
.skeleton-item:nth-child(3) .skeleton-title::after,
.skeleton-item:nth-child(3) .skeleton-line::after { animation-delay: 0.3s; }
.skeleton-item:nth-child(4) .skeleton-title::after,
.skeleton-item:nth-child(4) .skeleton-line::after { animation-delay: 0.45s; }
.skeleton-item:nth-child(5) .skeleton-title::after,
.skeleton-item:nth-child(5) .skeleton-line::after { animation-delay: 0.6s; }

/* Skeleton answer box */
.skeleton-answer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.skeleton-answer-title {
  width: 45%;
  height: 18px;
  border-radius: 6px;
  background: var(--bg-hover);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.skeleton-answer-title::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-answer-line {
  height: 12px;
  border-radius: 6px;
  background: var(--bg-hover);
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
}

.skeleton-answer-line:nth-child(2) { width: 100%; }
.skeleton-answer-line:nth-child(3) { width: 95%; }
.skeleton-answer-line:nth-child(4) { width: 80%; }

.skeleton-answer-line::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  animation: shimmer 1.5s ease-in-out infinite;
}

.loading-text {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}

/* ── Error State ───────────────────────────────────────────── */
#error-state {
  text-align: center;
  padding: 48px 0;
}

.error-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.error-text {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.error-retry {
  padding: 10px 24px;
  background: var(--accent);
  color: var(--bg-secondary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.error-retry:hover {
  background: var(--accent-soft);
  transform: scale(1.03);
}

/* ── No Results ────────────────────────────────────────────── */
#no-results {
  text-align: center;
  padding: 48px 0;
}

.no-results-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.no-results-text {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text-primary);
}

.no-results-hint {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* ── Footer ────────────────────────────────────────────────── */
#footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  gap: 8px;
}

.footer-dot {
  opacity: 0.5;
}

/* ── Utility ───────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ── Responsive — Large Desktop (1200px+) ──────────────────── */
@media (min-width: 1200px) {
  :root {
    --max-width: 800px;
  }

  .hero-title {
    font-size: 3.4rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  #search-bar {
    height: 56px;
  }

  #search-btn,
  #clear-btn {
    width: 44px;
    height: 44px;
  }

  .result-title a {
    font-size: 1.2rem;
  }

  .result-snippet {
    font-size: 0.92rem;
  }
}

/* ── Responsive — Tablet (768px – 1024px) ──────────────────── */
@media (max-width: 1024px) {
  :root {
    --max-width: 680px;
  }

  #main {
    padding: 0 20px;
  }

  #search-container.home {
    margin-top: 22vh;
  }

  .hero-title {
    font-size: 2.6rem;
  }

  .hero-icon {
    font-size: 3.5rem;
  }
}

/* ── Responsive — Small Tablet / Large Phone (768px) ───────── */
@media (max-width: 768px) {
  #main {
    padding: 0 16px;
  }

  #header {
    padding: 12px 16px;
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .hero-title {
    font-size: 2.2rem;
    letter-spacing: -1.5px;
  }

  .hero-icon {
    font-size: 3rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  #search-container.home {
    margin-top: 18vh;
  }

  #search-container.compact {
    padding: 12px 0;
  }

  .result-title a {
    font-size: 1.05rem;
  }

  .result-snippet {
    -webkit-line-clamp: 2;
  }

  #results-container {
    padding: 4px 0 40px;
  }

  #instant-answer {
    padding: 16px 18px;
  }

  .answer-heading {
    font-size: 1rem;
  }

  .skeleton-answer {
    padding: 16px 18px;
  }

  body.results-mode {
    padding-top: 150px;
  }

  .header-top {
    padding: 12px 16px 8px 16px;
    min-height: 40px;
  }

  #logo .logo-text {
    font-size: 1.1rem;
  }

  #logo .logo-icon svg {
    width: 20px;
    height: 20px;
  }

  body.results-mode #search-container.compact {
    top: 52px;
    left: 16px;
    width: calc(100% - 32px);
  }

  body.results-mode #subnav {
    padding: 68px 16px 0 16px;
  }
}

/* ── Responsive — Mobile (480px and below) ─────────────────── */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  #main {
    padding: 0 12px;
  }

  #header {
    padding: 10px 12px;
  }

  .logo-icon {
    font-size: 1.3rem;
  }

  .logo-text {
    font-size: 1rem;
  }

  .hero-title {
    font-size: 1.8rem;
    letter-spacing: -1px;
  }

  .hero-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
  }

  .hero-subtitle {
    font-size: 0.85rem;
  }

  #hero-logo {
    margin-bottom: 24px;
  }

  #search-container.home {
    margin-top: 14vh;
  }

  #search-bar {
    height: 48px;
    padding: 0 4px 0 14px;
  }

  #search-input {
    font-size: 0.95rem;
  }

  /* Touch-friendly tap targets (48px minimum) */
  #search-btn,
  #clear-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  #results-container {
    padding: 4px 0 32px;
  }

  .result-item {
    padding: 14px 0;
  }

  .result-title a {
    font-size: 1rem;
    line-height: 1.35;
  }

  .result-display-url {
    font-size: 0.78rem;
  }

  .result-snippet {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }

  .result-meta {
    font-size: 0.72rem;
  }

  .result-favicon {
    width: 16px;
    height: 16px;
  }

  #instant-answer {
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
  }

  .answer-heading {
    font-size: 0.95rem;
  }

  .answer-text {
    font-size: 0.88rem;
  }

  .skeleton-answer {
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: var(--radius-sm);
  }

  /* Suggestions full width on mobile */
  #suggestions-dropdown {
    border-radius: var(--radius-sm);
  }

  .suggestion-item {
    padding: 12px 14px;
    min-height: 44px;
  }

  #footer {
    padding: 12px 16px;
    font-size: 0.72rem;
  }

  #results-meta {
    font-size: 0.75rem;
  }
}

/* ── Responsive — Very Small Phones (360px) ────────────────── */
@media (max-width: 360px) {
  html {
    font-size: 13px;
  }

  #main {
    padding: 0 10px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  #search-container.home {
    margin-top: 12vh;
  }

  #search-bar {
    height: 44px;
    padding: 0 4px 0 12px;
  }
}

/* ── Touch Devices — disable hover effects ─────────────────── */
@media (hover: none) and (pointer: coarse) {
  #search-btn:hover {
    transform: none;
    filter: none;
  }

  #clear-btn:hover {
    background: transparent;
  }

  .error-retry:hover {
    transform: none;
  }

  /* Increase tap targets */
  .suggestion-item {
    padding: 14px 16px;
    min-height: 48px;
  }

  .result-item {
    padding: 16px 0;
  }

  /* Active state for touch feedback */
  #search-btn:active {
    transform: scale(0.95);
    opacity: 0.8;
  }

  .suggestion-item:active {
    background: var(--bg-hover);
  }

  .result-title a:active {
    opacity: 0.7;
  }
}

/* ── Safe Area (notched phones like iPhone) ─────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  #main {
    padding-left: calc(12px + env(safe-area-inset-left));
    padding-right: calc(12px + env(safe-area-inset-right));
  }
}

/* ── Landscape Mobile ──────────────────────────────────────── */
@media (max-height: 500px) and (orientation: landscape) {
  #search-container.home {
    margin-top: 8vh;
  }

  #hero-logo {
    margin-bottom: 16px;
  }

  .hero-icon {
    font-size: 2rem;
    margin-bottom: 4px;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    display: none;
  }
}

/* ── Image & Video Grids ───────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px 0;
}

.image-result-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition);
}

.image-result-item:hover {
  transform: translateY(-2px);
}

.image-result-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  margin-bottom: 8px;
}

.image-result-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.image-result-domain {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 16px 0;
}

.video-result-item {
  display: flex;
  flex-direction: column;
}

.video-thumbnail-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg-hover);
}

.video-thumbnail-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.video-thumbnail-container:hover img {
  transform: scale(1.05);
}

.video-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.video-play-icon svg {
  width: 24px;
  height: 24px;
  margin-left: 4px;
}

.video-info {
  display: flex;
  flex-direction: column;
}

/* ── Reduced Motion (accessibility) ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
