/*
 * Lightweight rendering layer
 *
 * Keeps the visual character of LearnAhead while avoiding the most expensive
 * continuously composited effects on laptops and mobile devices.
 */

/* Frosted glass is especially costly while scrolling. Opaque, softly tinted
   surfaces preserve the hierarchy without repainting the page behind them. */
.marketing-nav,
.product-preview,
.proof-strip,
.topbar,
.account-button,
.eyebrow,
.hero-metrics,
.role-card,
.trust-note,
.bottom-dock,
.modal::backdrop,
.modal-card,
.profile-topbar,
.profile-page-heading > span,
.profile-hero,
.settings-card,
.demo-note,
.profile-dialog::backdrop {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.marketing-nav,
.product-preview,
.proof-strip,
.topbar,
.bottom-dock,
.profile-topbar,
.profile-hero,
.settings-card {
  background-color: rgba(255, 255, 255, 0.96) !important;
}

.modal-card {
  background-color: #fffefa !important;
}

/* Decorative motion no longer consumes CPU/GPU while the page is idle. */
.hero-orbit,
.product-preview,
body::before,
.ambient,
.brand-mark i,
.hero h1 em,
.live-metric strong::before {
  animation: none !important;
}

body::before {
  filter: none !important;
  transform: none !important;
}

/* Lists can become long. Their contents are now painted only shortly before
   they enter the viewport. */
.section,
.feature-section,
.safety-section,
.final-cta,
.activity-panel,
.favorites-panel,
.offers-panel,
.requests-panel,
.learning-spaces-panel,
.admin-panel {
  content-visibility: auto;
  contain-intrinsic-size: auto 620px;
}

/* Large result sets should appear immediately instead of starting dozens of
   simultaneous entrance animations. */
.service-card,
.conversation-card,
.message-row,
.notification-item,
.discover-view:not([hidden]) > * {
  animation: none !important;
}

@media (max-width: 800px) {
  .ambient,
  .hero-orbit {
    display: none !important;
  }

  .marketing-nav,
  .topbar,
  .profile-topbar {
    background-color: rgba(255, 255, 255, 0.985) !important;
  }
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .topbar,
  html:not([data-theme="light"]) .bottom-dock,
  html:not([data-theme="light"]) .profile-topbar,
  html:not([data-theme="light"]) .profile-hero,
  html:not([data-theme="light"]) .settings-card,
  html:not([data-theme="light"]) .modal-card {
    background-color: rgba(22, 27, 24, 0.97) !important;
  }
}

html[data-theme="dark"] .topbar,
html[data-theme="dark"] .bottom-dock,
html[data-theme="dark"] .profile-topbar,
html[data-theme="dark"] .profile-hero,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .modal-card {
  background-color: rgba(22, 27, 24, 0.97) !important;
}

/* Einheitliche, kontrastreiche Farben für alle dunklen Oberflächen. */
body.dark {
  --ink: #f7f9ff;
  --muted: #b9c5d8;
  --paper: #121622;
  --panel: #1f2433;
  --purple-dark: #c8c0ff;
  --purple-soft: #302b4d;
  --coral-soft: #402b2d;
  --green-soft: #223b35;
  --line: rgba(214, 225, 244, 0.16);
  color: var(--ink);
  color-scheme: dark;
}

body.dark :is(
  .marketing-nav,
  .topbar,
  .role-card,
  .bottom-dock,
  .modal-card,
  .profile-topbar,
  .profile-hero,
  .settings-card,
  .profile-dialog form
) {
  color: var(--ink);
  border-color: rgba(214, 225, 244, 0.12) !important;
  background-color: #1f2433 !important;
}

body.dark :is(
  .input-wrap,
  .input-wrap:focus-within,
  .select-field,
  .select-field:focus-within,
  .field,
  .field:focus-within,
  .protected-field,
  .request-grid input,
  .request-grid select,
  .request-grid textarea,
  .availability-times input,
  .results-filters input,
  .results-filters select,
  .onboarding-card select,
  .chat-state-actions select,
  .chat-state-actions button,
  .review-inline select,
  .review-inline input,
  .profile-quality-card textarea,
  .profile-quality-card input,
  .profile-dialog input,
  .profile-dialog select,
  .profile-dialog textarea,
  .learning-space input,
  .learning-space textarea,
  .learning-space select
) {
  color: var(--ink);
  border-color: rgba(214, 225, 244, 0.15);
  background: #292f40;
}

body.dark :is(input, select, textarea)::placeholder {
  color: #93a2b9;
}

body.dark :is(
  .results-filters,
  .service-empty,
  .member-empty,
  .notification-item.is-unread,
  .profile-admin-banner,
  .admin-user,
  .admin-user:hover,
  .admin-stats span,
  .admin-code-row,
  .appointment-item,
  .favorite-item,
  .management-item,
  .learning-space,
  .calendar-day,
  .admin-report,
  .admin-report.is-resolved
) {
  color: var(--ink);
  border-color: rgba(214, 225, 244, 0.12);
  background: #252b3b;
}

body.dark :is(
  .selection-summary span,
  .results-query small,
  .service-match-copy small,
  .detail-offer-copy small,
  .role-copy small,
  .trust-note,
  .security-hint,
  .card-heading small,
  .demo-note
) {
  color: var(--muted);
}

body.dark :is(
  .card-arrow,
  .selected-subject span,
  .detail-subject-symbol,
  .results-symbol,
  .service-match-symbol,
  .service-grade-chip,
  .round-link,
  .message-modal-icon,
  .members-modal-icon,
  .card-icon.admin
) {
  color: #cfe3ff;
  border-color: rgba(207, 227, 255, 0.16);
  background: #293247 !important;
}

body.dark :is(.role-meta i, .student-card .role-meta i:first-child) {
  color: #dce8ff;
  border-color: rgba(220, 232, 255, 0.13);
  background: #2b3244;
}

body.dark .tutor-card .role-meta i:first-child {
  color: #ffc4b2;
  background: #412d31;
}

body.dark :is(
  .login-button,
  .modal-primary,
  .service-action,
  .profile-rating-card > button,
  .detail-contact-button,
  .chat-compose button,
  .save-button,
  .review-inline button
) {
  color: #fff;
  background: linear-gradient(135deg, #7562e5, #5541bb);
}

body.dark .role-card:hover .card-arrow,
body.dark .dock-button span,
body.dark .toast {
  color: #fff;
  background: #111827 !important;
}

body.dark .dock-button span::after {
  border-top-color: #111827;
}
