/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&family=Nunito:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
  /* Colors */
  --primary-color: #1a56db;
  /* Darker blue for better contrast - WCAG compliant */
  --secondary-color: #4d8c16;
  /* Darker green for better contrast */
  --background-color: #F0F2F5;
  /* Slightly darker gray background */
  --text-color: #212529;
  /* Darker text for better contrast */
  --text-muted: #555555;
  /* Darker muted text for better contrast */
  --error-color: #d32f2f;
  /* Darker red for better contrast */
  --success-color: #2e7d32;
  /* Darker green for better contrast */
  --warning-color: #ed6c02;
  /* Darker orange for warning states */
  --card-background: #FFFFFF;
  --input-background: #FFFFFF;
  --input-border: #D0D0D0;
  --disabled-bg: #6B7280;
  /* A mid-tone grey that meets contrast requirements */
  --disabled-text: #374151;
  /* A darker grey for text that meets contrast requirements */

  /* Typography */
  --font-family-heading: 'Lexend', sans-serif;
  --font-family-body: 'Nunito', sans-serif;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-2xl: 2rem;
  --font-size-3xl: 2.5rem;
  --font-weight-normal: 400;
  --font-weight-bold: 600;
  --line-height: 1.6;

  /* Spacing */
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Layout */
  --header-height: 60px;
  --footer-height: 60px;
  --container-width: 800px;
  --container-max-width: 90%;
  --border-radius: 10px;
  --border-radius-full: 50%;

  /* Effects */
  --box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  --box-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;

  /* iOS PWA Status Bar Fixes */
  --safe-area-inset-top: env(safe-area-inset-top, 0px);
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
}

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

body {
  font-family: var(--font-family-body);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: var(--line-height);
  font-size: var(--font-size-base);
  padding: 0;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--header-height) + var(--safe-area-inset-top));
  padding-bottom: calc(var(--footer-height) + var(--safe-area-inset-bottom));
  padding-left: var(--safe-area-inset-left);
  padding-right: var(--safe-area-inset-right);
}

#app {
  padding: var(--space-md);
  max-width: var(--container-max-width);
  width: var(--container-width);
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Makes the app content appear in the center of the viewport */
#app-login,
#app-signup {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  max-width: var(--container-max-width);
  width: var(--container-width);
  margin: 0 auto;
  margin-top: 0;
  min-height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
}

h1 {
  color: var(--primary-color);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-md);
  text-align: center;
  padding-top: var(--space-md);
}

h2 {
  color: var(--primary-color);
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-md);
}

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

a:hover {
  text-decoration: underline;
}

.button {
  display: inline-block;
  padding: 0.7rem var(--space-md);
  border-radius: var(--border-radius);
  background-color: var(--primary-color);
  color: white;
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-speed), transform var(--transition-speed);
  box-shadow: var(--box-shadow);
  width: 100%;
  margin-bottom: var(--space-md);
  font-size: 0.95rem;
  height: 2.7rem;
}

.button:hover {
  opacity: 0.9;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-lg);
}

.button:active {
  transform: translateY(1px);
}

.button.secondary {
  background-color: var(--secondary-color);
}

.button.outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.nav-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-md);
}

label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-base);
}

input {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  transition: border var(--transition-speed), box-shadow var(--transition-speed);
  background-color: var(--input-background);
  font-family: var(--font-family-body);
  box-sizing: border-box;
  -webkit-appearance: none;
  /* Fix for iOS Safari */
  appearance: none;
  height: 2.7rem;
}

/* Specific fix for date inputs on mobile */
input[type="date"] {
  min-height: 2.7rem;
  /* Ensure consistent height with other inputs */
}

input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

.error-message {
  color: var(--error-color);
  font-size: var(--font-size-base);
  margin: var(--space-sm) 0;
  padding: var(--space-md);
  border-radius: var(--border-radius);
  background-color: rgba(229, 115, 115, 0.1);
}

.success-message {
  color: var(--success-color);
  font-size: var(--font-size-base);
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--border-radius);
  background-color: rgba(129, 199, 132, 0.1);
}

.card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: 100%;
}

.category-card {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  border-radius: var(--border-radius);
  background-color: var(--card-background);
  box-shadow: var(--box-shadow);
  margin-bottom: var(--space-md);
  cursor: pointer;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-lg);
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-full);
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-md);
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.category-info {
  flex-grow: 1;
}

.category-title {
  font-weight: var(--font-weight-bold);
  margin-bottom: 0.4rem;
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  color: var(--primary-color);
}

.category-description {
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

/* Accessibility improvements */
:focus {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* High contrast mode support */
@media (forced-colors: active) {
  .button {
    border: 2px solid;
  }

  .card,
  .category-card {
    border: 1px solid;
  }
}

/* HTMX loading indicators */
.htmx-indicator {
  opacity: 0;
  transition: opacity 200ms ease-in;
}

.htmx-request .htmx-indicator {
  opacity: 1;
  display: inline-block !important;
}

.htmx-request.htmx-indicator {
  opacity: 1;
  display: inline-block !important;
}

/* Login/Signup tab navigation */
.auth-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: 0 var(--space-md);
  position: relative;
}

.auth-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  transition: all 0.2s;
  text-decoration: none;
  border: 2px solid transparent;
  min-width: 120px;
}

.auth-tab:hover {
  background-color: rgba(26, 86, 219, 0.1);
  color: var(--primary-color);
  text-decoration: none;
}

.auth-tab.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Remove the underline indicator since we're using pill style */
.auth-tab.active::after {
  display: none;
}

/* Signup form specific styles */
.signup-form .form-group {
  margin-bottom: var(--space-md);
}

.signup-form label {
  margin-bottom: var(--space-sm);
}

/* Welcome page styles */
.card-content {
  text-align: center;
}

.card-content h2 {
  color: var(--primary-color);
  margin-bottom: var(--space-md);
}

.card-content p {
  margin-bottom: var(--space-sm);
  line-height: var(--line-height);
}

.details {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  margin-top: var(--space-md);
}

.loading-indicator {
  text-align: center;
  color: var(--text-muted);
  padding: var(--space-md);
}

/* Search Styles */
.search-section {
  margin: 0 auto;
  padding: 0 1rem;
  max-width: 600px;
}

.search-container {
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: white;
  border: 2px solid var(--primary-color);
  border-radius: 0.5rem;
  font-size: 1rem;
  color: var(--text-color);
  transition: border-color 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.search-results {
  min-height: 100px;
}

.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-result-item {
  margin-bottom: 1rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: transform 0.2s, box-shadow 0.2s;
}

.search-result-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-result-link {
  display: block;
  padding: 1rem;
  color: var(--text-color);
  text-decoration: none;
  background-color: white;
}

.search-result-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--primary-color);
}

.search-result-category {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

.search-result-category-label {
  font-weight: 600;
}

.search-result-description {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.search-empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
}

mark {
  background-color: rgba(59, 130, 246, 0.2);
  color: inherit;
  padding: 0.1em 0.2em;
  border-radius: 0.25em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Mobile app-like layout */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--header-height) + var(--safe-area-inset-top));
  padding-top: var(--safe-area-inset-top);
  padding-left: var(--safe-area-inset-left);
  padding-right: var(--safe-area-inset-right);
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-title {
  text-align: center;
}

.app-header h1 {
  color: white;
  font-size: var(--font-size-lg);
  margin: 0;
  padding: 0;
}

.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--footer-height) + var(--safe-area-inset-bottom));
  padding-bottom: var(--safe-area-inset-bottom);
  padding-left: var(--safe-area-inset-left);
  padding-right: var(--safe-area-inset-right);
  background-color: white;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.footer-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
}

.footer-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-size-base);
  padding: var(--space-sm);
  transition: color 0.2s;
  cursor: pointer;
}

.footer-nav-item.active {
  color: var(--primary-color);
}

.footer-nav-item:hover {
  color: var(--primary-color);
  text-decoration: none;
}

.main-content {
  flex: 1;
  padding: var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-intro {
  padding: var(--space-md);
  padding-top: 0;
}

.page-intro p {
  color: var(--text-muted);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

/* Splash screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--background-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.6s ease-out;
}

.splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-container {
  text-align: center;
  padding: var(--space-xl);
  max-width: 90%;
}

.splash-avatar {
  width: 160px;
  height: 160px;
  border-radius: var(--border-radius-full);
  background-color: var(--primary-color);
  margin: 0 auto var(--space-lg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.splash-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.speech-bubble {
  position: relative;
  background: white;
  border-radius: var(--space-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
  box-shadow: var(--box-shadow);
  max-width: 85%;
  margin: 0 auto var(--space-xl);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.speech-bubble p {
  font-size: var(--font-size-lg);
  line-height: var(--line-height);
}

.speech-bubble:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 0;
  border: 18px solid transparent;
  border-top-color: white;
  border-bottom: 0;
  margin-left: -18px;
  margin-bottom: -18px;
}

.app-name {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-lg);
  font-family: var(--font-family-heading);
}

.splash-button {
  max-width: 200px;
  margin: 0 auto;
  margin-top: var(--space-md);
}

/* Dashboard styles */
.container {
  padding: var(--space-lg);
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

header h1 {
  margin-bottom: var(--space-sm);
}

header p {
  color: var(--text-muted);
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.scenarios-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.category-tile {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.category-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow-lg);
}

.category-link {
  color: var(--text-color);
  text-decoration: none;
  display: block;
  height: 100%;
}

.category-link:hover {
  text-decoration: none;
}

.category-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background-color: #f0f0f0;
}

.category-content {
  padding: var(--space-sm);
  flex: 1;
}

.category-name {
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
  color: var(--primary-color);
}

.category-count {
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

.dashboard-footer {
  text-align: center;
  margin: var(--space-lg) 0;
  padding: var(--space-md);
}

.dashboard-footer .button {
  max-width: 150px;
  display: inline-block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .scenarios-list {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .scenarios-list a {
    line-height: 1;
  }
}

@media (max-width: 480px) {
  .categories-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .category-name {
    font-size: var(--font-size-base);
  }

  .category-count {
    font-size: var(--font-size-base);
  }

  .category-content {
    padding: 0.7rem;
  }

  .category-image {
    aspect-ratio: 16/9;
  }

  .scenarios-list {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
}

.nav-buttons {
  display: flex;
  justify-content: center;
  margin: var(--space-lg) 0;
}

.nav-buttons .button {
  margin: 0 var(--space-sm);
  min-width: 150px;
}

/* Profile styles */
.profile-container {
  max-width: 450px;
  margin: 0 auto;
}

.profile-avatar {
  width: 90px;
  height: 90px;
  border-radius: var(--border-radius-full);
  background-color: var(--primary-color);
  margin: 0 auto var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-heading);
  font-size: 2.5rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.profile-info {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.profile-info-item {
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.profile-info-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.profile-info-label {
  font-weight: var(--font-weight-bold);
  color: var(--text-muted);
  font-size: var(--font-size-base);
}

.profile-info-value {
  font-size: var(--font-size-base);
  color: var(--text-color);
  text-align: right;
}

.profile-actions {
  text-align: center;
}

.profile-actions .button {
  max-width: 200px;
}

/* Scenarios page styles */

.category-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-lg);
  color: var(--primary-color);
  border-bottom: 2px solid rgba(74, 144, 226, 0.2);
  padding-bottom: var(--space-sm);
}

.scenarios-list a {
  line-height: 1;
}

.scenario-card-link {
  text-decoration: none;
  color: var(--text-color);
  display: block;
}

.scenario-card-link:hover {
  text-decoration: none;
}

.scenario-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.scenario-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--box-shadow-lg);
}

.scenario-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.scenario-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scenario-content {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}

@media (max-width: 480px) {
  .scenario-content {
    padding: var(--space-md);
  }
}

.scenario-title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
}

.scenario-description {
  color: var(--text-color);
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
  flex-grow: 1;
  max-height: 4.8em;
  /* Allows for 3 lines of text with 1.6 line height */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.scenario-speaker {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  background-color: rgba(74, 144, 226, 0.05);
  padding: var(--space-sm) 0.7rem;
  border-radius: 6px;
  display: inline-block;
}

.speaker-label {
  font-weight: var(--font-weight-bold);
  color: var(--primary-color);
}

.scenario-action {
  margin-top: auto;
}

.scenario-action-label {
  display: inline-block;
  padding: var(--space-sm);
  background-color: #2E7D32;
  /* Darker green for better contrast */
  color: white;
  width: 100%;
  border-radius: var(--border-radius);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-base);
  text-align: center;
}

.scenario-card:hover .scenario-action-label {
  background-color: #1B5E20;
  /* Even darker on hover for maintaining contrast */
}

/* Feedback Modal styles */
.feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: var(--space-md);
}

.feedback-modal.show-modal {
  display: flex;
}

.option-feedback {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  align-items: center;
}

.feedback-image-container {
  width: 100%;
  margin-bottom: var(--space-md);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  overflow: hidden;
}

.feedback-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.feedback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--border-radius-full);
  color: white;
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-heading);
}

.feedback-icon.good {
  background-color: var(--success-color);
}

.feedback-icon.average {
  background-color: var(--warning-color);
}

.feedback-icon.poor {
  background-color: var(--disabled-bg);
}

.feedback-text {
  flex: 1;
  padding: 0 var(--space-lg);
  text-align: center;
}

.feedback-actions {
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-lg) var(--space-lg);
  width: 100%;
  max-width: 300px;
}

.feedback-rating {
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-sm);
  font-family: var(--font-family-heading);
}

.rating-good {
  color: var(--success-color);
}

.rating-average {
  color: #F57C00;
  /* Dark Orange */
}

.rating-poor {
  color: var(--disabled-text);
}

.feedback-message {
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

.show-feedback {
  display: block;
}

/* Scenario selected option styles */
.scenario-option.selected {
  background-color: rgba(74, 144, 226, 0.1);
  border-color: var(--primary-color);
}

.scenario-option.selected.poor {
  background-color: rgba(107, 114, 128, 0.1);
  /* Light grey background */
  border-color: var(--disabled-bg);
  color: var(--disabled-text);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .scenario-detail-container {
    gap: var(--space-md);
  }

  .scenario-dialogue-container,
  .scenario-options-container {
    padding: var(--space-md);
  }

  .scenario-dialogue {
    font-size: var(--font-size-base);
  }

  .scenario-option {
    padding: var(--space-sm);
  }
}

/* Add to Home Screen banner */
.install-banner {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + 70px);
  left: 0;
  right: 0;
  background-color: var(--primary-color);
  color: white;
  z-index: 1000;
  padding: 0 16px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  transform: translateY(100%);
}

.install-banner.show {
  transform: translateY(0);
}

.install-banner-content {
  display: flex;
  align-items: center;
  padding: 12px 0;
  max-width: 600px;
  margin: 0 auto;
}

.install-banner-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.install-banner-text strong {
  font-size: 14px;
  margin-bottom: 2px;
  font-family: var(--font-family-heading);
}

.install-banner-text span {
  font-size: 12px;
  opacity: 0.9;
}

.install-button {
  background-color: white;
  color: var(--primary-color);
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  font-weight: var(--font-weight-bold);
  font-size: 14px;
  margin: 0 8px;
  white-space: nowrap;
  font-family: var(--font-family-heading);
}

.dismiss-button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  padding: 4px 8px;
  opacity: 0.8;
}

/* Scenario Detail Page Styles */
.scenario-detail {
  max-width: 800px;
  margin: 0 auto;
}

.scenario-detail-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.scenario-image-container {
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  line-height: 0;
  position: relative;
}

.scenario-detail-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.audio-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  padding: 0;
  z-index: 5;
}

.audio-play-button:hover {
  background-color: rgba(59, 130, 246, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

.audio-play-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.audio-play-button svg {
  transition: all 0.2s ease;
}

/* Styling for button when audio is playing */
.audio-play-button[aria-label="Pause audio"] {
  background-color: rgba(59, 130, 246, 0.7);
}

.scenario-dialogue-container {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.scenario-speaker-bubble {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.speaker-avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--border-radius-full);
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.speaker-initial {
  color: white;
  font-weight: var(--font-weight-bold);
  font-size: 1.4rem;
  font-family: var(--font-family-heading);
}

.speaker-message {
  background-color: rgba(74, 144, 226, 0.1);
  border-radius: 1rem;
  padding: var(--space-md);
  position: relative;
  flex-grow: 1;
}

/* Speech bubble pointer */
.speaker-message:before {
  content: '';
  position: absolute;
  left: -0.75rem;
  top: 1rem;
  width: 0;
  height: 0;
  border-top: 0.75rem solid transparent;
  border-right: 0.75rem solid rgba(74, 144, 226, 0.1);
  border-bottom: 0.75rem solid transparent;
}

.speaker-name {
  font-weight: var(--font-weight-bold);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-base);
  color: var(--primary-color);
  margin-bottom: var(--space-sm);
}

.dialogue-text {
  font-size: var(--font-size-lg);
  line-height: var(--line-height);
  font-style: italic;
}

.scenario-options-container {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  padding: var(--space-lg);
  box-shadow: var(--box-shadow);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.options-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-md);
  color: var(--primary-color);
  text-align: center;
}

.scenario-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.scenario-option {
  display: flex;
  padding: var(--space-md);
  border-radius: var(--border-radius);
  border: 1px solid rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
  background-color: #f9f9f9;
}

.scenario-option:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow);
  background-color: #f0f0f0;
}

.scenario-option.attempted-bad {
  position: relative;
  background-color: rgba(107, 114, 128, 0.07);
  border-color: rgba(107, 114, 128, 0.3);
}

.scenario-option.attempted-bad::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(45deg,
      rgba(107, 114, 128, 0.05),
      rgba(107, 114, 128, 0.05) 10px,
      rgba(107, 114, 128, 0.02) 10px,
      rgba(107, 114, 128, 0.02) 20px);
  pointer-events: none;
}

.option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: var(--border-radius-full);
  background-color: var(--primary-color);
  color: white;
  font-weight: var(--font-weight-bold);
  margin-right: var(--space-md);
  font-family: var(--font-family-heading);
}

.option-text {
  flex: 1;
  padding: var(--space-sm) 0;
}

.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
  color: var(--text-muted);
  font-style: italic;
}

/* Video styles */
.scenario-detail-video {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--border-radius);
}

.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  padding: 0;
  z-index: 5;
}

.video-play-button:hover {
  background-color: rgba(59, 130, 246, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.video-play-button svg {
  transition: all 0.2s ease;
}

/* Styling for button when video is playing */
.video-play-button[aria-label="Pause video"] {
  background-color: rgba(59, 130, 246, 0.7);
}

.fallback-message {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 10;
  animation: fadeIn 0.3s ease-out;
}