/* CSS Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* Design system color tokens */
  --color-primary: #0066cc;
  --color-primary-light: #e6f0ff;
  --color-primary-dark: #0055b3;
  
  --color-secondary: #6c757d;
  --color-secondary-light: #f8f9fa;
  --color-secondary-dark: #5a6268;
  
  --color-success: #28a745;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-info: #17a2b8;
  
  --color-text: #333333;
  --color-text-light: #6c757d;
  --color-text-dark: #212529;
  
  --color-background: #f9f9f9;
  --color-white: #ffffff;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  
  /* Border */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.5rem;
  --font-size-xxl: 2rem;
  
  /* Animation */
  --transition-fast: 0.15s ease;
  --transition-medium: 0.3s ease;
  --transition-slow: 0.5s ease;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  font-weight: 600;
  color: var(--color-text-dark);
  line-height: 1.2;
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }

p {
  margin-top: 0;
  margin-bottom: var(--spacing-md);
}

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

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

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
    monospace;
}
.ui-button {
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.ui-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.ui-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Primary button */
.ui-button--primary {
  background-color: #0066cc;
  color: white;
}

.ui-button--primary:hover:not(:disabled) {
  background-color: #0055b3;
}

/* Secondary button */
.ui-button--secondary {
  background-color: #6c757d;
  color: white;
}

.ui-button--secondary:hover:not(:disabled) {
  background-color: #5a6268;
}

/* Outlined button */
.ui-button--outlined {
  background-color: transparent;
  border: 1px solid #0066cc;
  color: #0066cc;
}

.ui-button--outlined:hover:not(:disabled) {
  background-color: rgba(0, 102, 204, 0.1);
}

/* Text button */
.ui-button--text {
  background-color: transparent;
  color: #0066cc;
  padding: 8px 16px;
}

.ui-button--text:hover:not(:disabled) {
  background-color: rgba(0, 102, 204, 0.1);
}

/* Full width */
.ui-button--full-width {
  width: 100%;
}.ui-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 16px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.ui-card__title {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.ui-card__content {
  display: flex;
  flex-direction: column;
}

/* Interactive card styles */
.ui-card--interactive {
  cursor: pointer;
}

.ui-card--interactive:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}.ui-loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ui-loading-indicator__spinner {
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: #0066cc;
  animation: spinner-rotation 1s infinite linear;
}

.ui-loading-indicator__label {
  margin-top: 12px;
  font-size: 0.875rem;
  color: #666;
}

/* Sizes */
.ui-loading-indicator--small .ui-loading-indicator__spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

.ui-loading-indicator--medium .ui-loading-indicator__spinner {
  width: 32px;
  height: 32px;
  border-width: 3px;
}

.ui-loading-indicator--large .ui-loading-indicator__spinner {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

@keyframes spinner-rotation {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}.read-aloud-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #6b46c1;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.read-aloud-button:hover {
  background-color: #7c5bd0;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.read-aloud-button:active {
  background-color: #553599;
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.read-aloud-button:disabled {
  background-color: #a397c4;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

.read-aloud-button--playing {
  background-color: #e53e3e;
}

.read-aloud-button--playing:hover {
  background-color: #f56565;
}

.read-aloud-button--playing:active {
  background-color: #c53030;
}

.read-aloud-button__icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Speaker icon for non-playing state */
.read-aloud-button:not(.read-aloud-button--playing) .read-aloud-button__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.114 5.636a9 9 0 0 1 0 12.728M16.463 8.288a5.25 5.25 0 0 1 0 7.424M6.75 8.25l4.72-4.72a.75.75 0 0 1 1.28.53v15.88a.75.75 0 0 1-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.009 9.009 0 0 1 2.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75Z' /%3E%3C/svg%3E");
}

/* Stop icon for playing state */
.read-aloud-button--playing .read-aloud-button__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z' /%3E%3C/svg%3E");
}

/* Icon-only variant */
.read-aloud-button--icon-only {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
}

.read-aloud-button--icon-only .read-aloud-button__icon {
  width: 20px;
  height: 20px;
  margin: 0;
}


/* Child-friendly pulsing animation when playing */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(229, 62, 62, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 62, 62, 0);
  }
}

.read-aloud-button--playing {
  animation: pulse 2s infinite;
}

/* Container for buttons */
.read-aloud-button-container {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Resume button styling */
.read-aloud-button--resume {
  background-color: #38a169; /* Green color to differentiate */
}

.read-aloud-button--resume:hover {
  background-color: #48bb78;
}

.read-aloud-button--resume:active {
  background-color: #2f855a;
}

/* Resume icon */
.read-aloud-button--resume .read-aloud-button__icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z' /%3E%3C/svg%3E");
}.story-card {
  width: 280px;
  height: 320px;
  margin: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.story-card__content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.story-card__image-container {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 12px;
}

.story-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.story-card:hover .story-card__image {
  transform: scale(1.05);
}

.story-card__title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-card__progress {
  margin-top: auto;
  width: 100%;
}

.story-card__progress-bar {
  width: 100%;
  height: 6px;
  background-color: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.story-card__progress-fill {
  height: 100%;
  background-color: #0066cc;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.story-card__progress-text {
  font-size: 0.875rem;
  color: #666;
}.new-story-card {
  width: 280px;
  height: 320px;
  margin: 16px;
  background-color: rgba(0, 102, 204, 0.05);
  border: 2px dashed rgba(0, 102, 204, 0.2);
  transition: background-color 0.3s, border-color 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.new-story-card:hover {
  background-color: rgba(0, 102, 204, 0.1);
  border-color: rgba(0, 102, 204, 0.4);
}

.new-story-card__content {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.new-story-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: rgba(0, 102, 204, 0.1);
  color: #0066cc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  line-height: 0; /* This helps center the "+" vertically */
  margin-bottom: 16px;
  transition: background-color 0.3s, transform 0.3s;
}

.new-story-card:hover .new-story-card__icon {
  background-color: rgba(0, 102, 204, 0.2);
  transform: scale(1.1);
}

.new-story-card__title {
  font-size: 1.25rem;
  font-weight: 500;
  color: #0066cc;
  margin: 0;
}.story-card-list-container {
  position: relative;
  width: 100%;
}

.story-card-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 16px;
  min-height: 600px; /* Ensure consistent height between pages */
}

.story-card-list--loading,
.story-card-list--error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 32px;
}

.story-card-list__error {
  color: #e53935;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 4px;
  background-color: rgba(229, 57, 53, 0.1);
  text-align: center;
  max-width: 400px;
}

/* Pagination styles */
.story-card-list__pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0 32px;
  padding: 8px;
}

.story-card-list__page-indicator {
  margin: 0 16px;
  font-size: 14px;
  color: #555;
}

/* Navigation arrows */
.story-card-list__nav-arrow {
  background-color: #f5f5f5;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 20px;
  color: #333;
  transition: all 0.2s ease;
}

.story-card-list__nav-arrow:hover {
  background-color: #e0e0e0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.story-card-list__nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  box-shadow: none;
}.home-view {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 16px;
}

.home-view--loading {
  display: flex;
  justify-content: center;
  align-items: center;
}

.home-view__header {
  text-align: center;
  padding: 30px 0 16px; /* Reduced by ~35% from 48px 0 24px */
}

.home-view__title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  color: #333;
}

.home-view__subtitle {
  font-size: 1.25rem;
  color: #666;
  margin: 6px 0 0; /* Reduced from 8px */
}

.home-view__content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.home-view__section-title {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 16px 0 6px; /* Reduced from 24px 0 8px */
  padding-left: 16px;
  color: #444;
}

/* First-run experience styles */
.home-view--first-run {
  background-color: #f0f7ff;
}

.home-view__first-run-content {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.home-view__welcome-card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  padding: 2.5rem;
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.home-view__welcome-card h2 {
  color: #333;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.home-view__welcome-card p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

.home-view__welcome-steps {
  margin: 2.5rem 0;
  text-align: left;
}

.home-view__welcome-step {
  display: flex;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.home-view__step-number {
  background-color: #4169e1;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 1rem;
  flex-shrink: 0;
}

.home-view__step-content {
  flex: 1;
}

.home-view__step-content h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.home-view__step-content p {
  font-size: 0.95rem;
  margin-bottom: 0;
  color: #666;
}

.home-view__get-started-button {
  margin-top: 1rem;
  font-size: 1.1rem;
  padding: 0.8rem 2rem;
}

@media (max-width: 768px) {
  .home-view__header {
    padding: 32px 0 16px;
  }
  
  .home-view__title {
    font-size: 2rem;
  }
  
  .home-view__subtitle {
    font-size: 1rem;
  }
  
  .home-view__section-title {
    font-size: 1.25rem;
  }
  
  .home-view__welcome-card {
    padding: 1.5rem;
  }
  
  .home-view__welcome-step {
    margin-bottom: 1.2rem;
  }
  
  .home-view__step-number {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }
  
  .home-view__step-content h3 {
    font-size: 1.1rem;
  }
  
  .home-view__step-content p {
    font-size: 0.85rem;
  }
}.welcome-back-banner {
  background-color: #f0f7ff;
  border: 1px solid #cce5ff;
  border-radius: 8px;
  margin: 16px 0;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.welcome-back-banner-content {
  text-align: center;
}

.welcome-back-banner h3 {
  color: #0056b3;
  margin-top: 0;
  margin-bottom: 8px;
}

.welcome-back-banner p {
  margin: 8px 0;
}

.welcome-back-button {
  background-color: #0056b3;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.welcome-back-button:hover {
  background-color: #004494;
}.character-list {
  max-height: 300px;
  overflow-y: auto;
  padding: 4px;
}

.character-list--loading,
.character-list--empty {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  color: var(--color-text-light);
  text-align: center;
  padding: 20px;
}

.character-list__item {
  display: flex;
  align-items: center;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: var(--border-radius-sm);
  background-color: var(--color-secondary-light);
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.character-list__item:last-child {
  margin-bottom: 0;
}

.character-list__item:hover {
  background-color: rgba(0, 102, 204, 0.05);
}

.character-list__item--selected {
  background-color: var(--color-primary-light);
}

.character-list__item--selected:hover {
  background-color: var(--color-primary-light);
}

.character-list__checkbox {
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-list__checkbox-icon {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  transition: background-color 0.2s;
}

.character-list__checkbox-icon--checked {
  background-color: var(--color-primary);
}

.character-list__content {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.character-list__name-container {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.character-list__name {
  font-weight: 500;
}

.character-list__creature {
  font-weight: normal;
  color: var(--color-text-light);
}

.character-list__edit-button {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: var(--font-size-sm);
  padding: 4px 8px;
  border-radius: var(--border-radius-sm);
  transition: background-color 0.2s;
}

.character-list__edit-button:hover {
  background-color: rgba(0, 102, 204, 0.1);
}.character-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.character-form__warning {
  background-color: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--color-warning);
  color: #856404;
  padding: 12px;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
  margin-bottom: 8px;
}

.character-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.character-form__label {
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
}

.character-form__input,
.character-form__textarea {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.character-form__input:focus,
.character-form__textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.character-form__input--error,
.character-form__textarea--error {
  border-color: var(--color-danger);
}

.character-form__input--error:focus,
.character-form__textarea--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.character-form__input--readonly {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

.character-form__textarea {
  resize: vertical;
  min-height: 100px;
}

.character-form__error {
  color: var(--color-danger);
  font-size: var(--font-size-xs);
  margin-top: 4px;
}

.character-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}.character-manager {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.character-manager__error {
  color: var(--color-danger);
  background-color: rgba(220, 53, 69, 0.1);
  padding: 12px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
}

.character-manager__content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: 450px; /* Ensure consistent minimum height */
}

.character-manager__list-section,
.character-manager__form-section {
  display: flex;
  flex-direction: column;
}

.character-manager__list-section .ui-card,
.character-manager__form-section .ui-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.character-manager__list-title,
.character-manager__form-title,
.character-manager__selection-title {
  font-size: var(--font-size-lg);
  margin: 0 0 16px;
  color: var(--color-text-dark);
}

.character-manager__list-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.character-manager__no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: var(--color-text-light);
  text-align: center;
}

.character-manager__active-profile {
  margin: -12px 0 16px 0;
  padding: 8px 12px;
  border-radius: var(--border-radius-sm);
  background-color: var(--color-primary-light);
  font-size: 0.9rem;
  color: var(--color-text-dark);
}

.character-manager__no-selection p {
  margin-bottom: 16px;
}

.character-manager__selection {
  background-color: var(--color-white);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.character-manager__selected-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.character-manager__selected-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 16px;
  background-color: var(--color-primary-light);
  border-radius: var(--border-radius-sm);
}

.character-manager__selected-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: calc(100% - 80px); /* Allow space for the remove button */
  overflow: hidden;
}

.character-manager__selected-header {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
}

.character-manager__selected-name {
  font-weight: 500;
}

.character-manager__selected-creature {
  font-weight: normal;
  color: var(--color-text-dark);
}

.character-manager__selected-description {
  font-size: 0.85rem;
  color: var(--color-text-dark);
  opacity: 0.8;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  padding-left: 0; /* Aligned with the start of text above */
}

.character-manager__selection-empty {
  color: var(--color-text-light);
  font-style: italic;
  text-align: center;
}

@media (max-width: 768px) {
  .character-manager__content {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  
  .character-manager__list-section .ui-card,
  .character-manager__form-section .ui-card {
    min-height: 350px;
    margin-bottom: 16px;
  }
  
  .character-manager__selected-item {
    flex-direction: column;
  }
  
  .character-manager__selected-info {
    width: 100%;
    margin-bottom: 12px;
  }
  
  .character-manager__remove-button {
    align-self: flex-end;
  }
}.story-settings-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-settings-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-settings-form__label {
  font-weight: 500;
  font-size: var(--font-size-sm);
  color: var(--color-text-dark);
}

.story-settings-form__input {
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.story-settings-form__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

.story-settings-form__hint {
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  margin-top: 4px;
}.character-select-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

.character-select-view__header {
  margin-bottom: 32px;
}

.character-select-view__header-content {
  display: flex;
  align-items: center;
  position: relative;
}

.back-home-button {
  position: absolute;
  left: 0;
  top: 0;
}

.character-select-view__title-container {
  flex: 1;
  text-align: center;
}

.character-select-view__title {
  font-size: var(--font-size-xxl);
  margin-bottom: 8px;
  color: var(--color-text-dark);
}

.character-select-view__subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-light);
  margin: 0;
}

.character-select-view__error {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--color-danger);
  padding: 12px 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 24px;
  text-align: center;
}

.character-select-view__content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.character-select-view__section {
  background-color: var(--color-white);
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.character-select-view__section-title {
  font-size: var(--font-size-xl);
  margin: 0 0 8px;
  color: var(--color-text-dark);
}

.character-select-view__section-description {
  font-size: var(--font-size-base);
  color: var(--color-text-light);
  margin: 0 0 20px;
}

.character-select-view__actions {
  margin-top: 16px;
}

@media (max-width: 768px) {
  .character-select-view {
    padding: 16px 12px;
  }
  
  .character-select-view__section {
    padding: 16px;
  }
}.share-toggle-container {
  display: flex;
  align-items: center;
  gap: 0.25rem; /* Reduced from 0.5rem to 0.25rem */
}

.share-toggle-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  color: #333;
}

.share-toggle-button:hover {
  background-color: #e8e8e8;
}

.share-toggle-active {
  background-color: #e6f7ff;
  border-color: #91d5ff;
  color: #0070f3;
}

.share-toggle-active:hover {
  background-color: #d6f0ff;
}

.share-toggle-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.copy-link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-link-button:hover {
  background-color: #e8e8e8;
}

.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;
}

/* Share Dialog Styles */
.share-dialog {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.share-dialog-content {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: relative;
}

.share-dialog-message {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1rem;
  color: #333;
}

.share-dialog-close-x {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 5px 10px;
  border-radius: 50%;
}

.share-dialog-close-x:hover {
  background-color: #f5f5f5;
  color: #333;
}

.share-url-container {
  display: flex;
  margin: 1rem 0 0;
  align-items: center;
  background-color: #f8f9fa;
  border-radius: 4px;
  overflow: hidden;
}

.share-url-text {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: #555;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-copy-button {
  padding: 0.75rem 1.5rem;
  background-color: #0070f3;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  height: 100%;
  min-height: 46px;
  transition: background-color 0.2s;
}

.share-copy-button:hover {
  background-color: #0060df;
}.story-completion-prompt {
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.story-completion-content {
  text-align: center;
}

.story-completion-prompt h2 {
  color: #2c3e50;
  margin-top: 0;
}

.story-completion-prompt p {
  margin: 16px 0;
  font-size: 1.1em;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 16px;
}

.create-account-button {
  background-color: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.create-account-button:hover {
  background-color: #2980b9;
}

.maybe-later-button {
  background-color: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.maybe-later-button:hover {
  background-color: #eee;
}.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header__left-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header__logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header__logo-image {
  height: 40px;
  width: auto;
}

.header__child-name {
  margin-left: 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
  color: #4a5568;
}

.header__stories-chip {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: #e9d8fd;
  color: #6b46c1;
  border-radius: 4px; /* Square corners instead of rounded */
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s;
}

.header__stories-chip:hover {
  background-color: #d6bcfa;
}

/* Audio toggle button */
.header__audio-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: #f0f0f0;
  margin-left: 8px;
}

.header__audio-toggle:hover,
.header__audio-toggle.playing {
  opacity: 1;
  background-color: #e8e8e8;
}

.header__nav {
  display: flex;
  align-items: center;
}

.header__auth {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header__user-menu {
  position: relative;
  display: inline-block;
}

.header__user-button {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.header__user-button:hover {
  background-color: #f7fafc;
}

.header__user-name {
  margin-right: 0.5rem;
  font-weight: 500;
}

.header__user-avatar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  background-color: #6b46c1;
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 0.875rem;
}

.header__dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  z-index: 10;
}

.header__dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: #4a5568;
  transition: background-color 0.2s;
}

.header__dropdown-item:hover {
  background-color: #f7fafc;
}

.header__dropdown-divider {
  height: 1px;
  background-color: #e2e8f0;
  margin: 0.25rem 0;
}

/* Sign Out link styling */
.header__signout-link {
  color: #4299e1; /* Blue text color */
  font-weight: 500;
  text-decoration: none;
}

.header__signout-link:hover {
  text-decoration: none;
  background-color: #f0f9ff; /* Light blue on hover */
}.story-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Header styles */
.story-view__header {
  position: relative;
  margin-bottom: 24px;
  padding: 16px;
  border-bottom: 1px solid #eee;
  background-color: #f9f9f9;
  border-radius: 8px 8px 0 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.story-view__header-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.story-view__title {
  font-size: 28px;
  margin: 0;
  color: #2c3e50;
}

.story-view__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 14px;
  color: #7f8c8d;
}

.story-view__theme,
.story-view__ending {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.story-view__meta {
  display: flex;
  flex-direction: column;
  gap: 4px; /* space between theme and ending */
}

.story-view__theme,
.story-view__ending {
  margin: 0;
}

/* Header controls */
.story-view__header-controls {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
}

/* Audio control moved to Header component */

/* Make ReadAloudButton be positioned below Share toggle in a column */
.story-view__controls-column {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.story-view__read-aloud-header {
  margin-top: 4px;
}

/* Make ReadAloudButton fit with header design */
.story-view__header .read-aloud-button {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
}

/* Error message */
.story-view__error {
  margin: 16px 0;
  padding: 12px 16px;
  background-color: #fff8e1;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  color: #5d4037;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-view__error p {
  margin: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Content area */
.story-view__content {
  margin-bottom: 24px;
  min-height: 300px;
}

.story-view__page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: all 0.3s ease;
}

@keyframes highlight-new-page {
  0% { box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.7); }
  50% { box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.3); }
  100% { box-shadow: none; }
}

.story-view__page--new {
  animation: highlight-new-page 1.5s ease-out;
}

.story-view__page--fallback {
  border: 2px solid #f0ad4e;
  padding: 20px;
  position: relative;
  border-radius: 8px;
  background-color: #fefaf3;
}

/* Emergency rendering style - more prominent to indicate backup display */
.story-view__page--emergency {
  border: 3px solid #d9534f;
  padding: 20px;
  position: relative;
  border-radius: 8px;
  background-color: #f9f2f2;
  box-shadow: 0 4px 12px rgba(217, 83, 79, 0.2);
  animation: pulse-emergency 2s infinite;
}

@keyframes pulse-emergency {
  0% { box-shadow: 0 4px 12px rgba(217, 83, 79, 0.2); }
  50% { box-shadow: 0 4px 20px rgba(217, 83, 79, 0.4); }
  100% { box-shadow: 0 4px 12px rgba(217, 83, 79, 0.2); }
}

.story-view__fallback-button {
  background-color: #5cb85c;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  display: block;
  margin: 15px auto 5px;
  transition: background-color 0.2s;
}

.story-view__fallback-button:hover {
  background-color: #4cae4c;
}

.story-view__image-status {
  text-align: center;
  margin: 10px 0;
  color: #555;
  font-size: 14px;
  background-color: #f8f8f8;
  padding: 5px;
  border-radius: 4px;
}

.story-view__page-number {
  font-size: 14px;
  color: #7f8c8d;
  text-align: center;
  font-family: 'Georgia', serif;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.story-view__page-number::before,
.story-view__page-number::after {
  content: "";
  height: 1px;
  background-color: #ddd;
  width: 40px;
  display: block;
}

.story-view__text-container {
  background-color: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
}

.story-view__text {
  font-size: 18px;
  line-height: 1.6;
  margin: 0 0 16px 0;
  color: #34495e;
}

.story-view__read-aloud-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  position: relative;
}

/* Support for the new button layout */
.story-view__read-aloud-container .read-aloud-button-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.story-view__read-aloud-button {
  margin: 0 auto;
}

.story-view__image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.story-view__image-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.story-view__image {
  width: 100%;
  height: auto;
  display: block;
}

.story-view__image-error {
  text-align: center;
  color: #e74c3c;
  padding: 20px;
  background-color: #fdf0ed;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.story-view__empty-state {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background-color: #f9f9f9;
  border-radius: 8px;
  text-align: center;
  color: #7f8c8d;
  padding: 20px;
}

.story-view__loading-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background-color: #f9f9f9;
  border-radius: 8px;
  text-align: center;
  color: #7f8c8d;
  padding: 30px;
  width: 100%;
}

.story-view__progress-indicator {
  margin-top: 20px;
  width: 80%;
  max-width: 300px;
}

.story-view__progress-bar {
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 5px;
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}

.story-view__progress-fill {
  position: absolute;
  height: 100%;
  background-color: #3498db;
  border-radius: 5px;
  width: 20%;
  animation: progress-animation 1.5s infinite;
}

@keyframes progress-animation {
  0% { left: -20%; }
  100% { left: 100%; }
}

/* Navigation controls */
.story-view__navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 12px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.story-view__page-indicator {
  font-size: 14px;
  color: #7f8c8d;
}

/* Navigation container */
.story-view__navigation-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  gap: 24px;
}

/* Navigation arrows */
.story-view__nav-arrow {
  background-color: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 4px;  /* Square arrows with slightly rounded corners */
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 24px;
  color: #333;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
}

.story-view__nav-arrow:hover {
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

.story-view__nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}

/* Action controls */
.story-view__controls {
  margin-top: 24px;
}

/* Styling for button row layout */
.story-view__buttons-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.story-view__buttons-row button {
  flex: 1;
}

/* Legacy styling for completed controls, kept for backwards compatibility */
.story-view__completed-controls {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.story-view__completed-controls button {
  flex: 1;
}

/* Loading state */
.story-view--loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* Error state */
.story-view--error {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .story-view {
    padding: 16px;
    margin: 0 12px;
  }
  
  .story-view__title {
    font-size: 24px;
  }
  
  .story-view__meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .story-view__text {
    font-size: 16px;
  }
  
  /* Adjustments for the header on mobile */
  .story-view__header {
    grid-template-columns: 1fr;
    padding-bottom: 20px;
  }
  
  .story-view__header-controls {
    justify-content: flex-start;
    margin-top: 16px;
  }
}.login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

.login-form__title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #333;
}

.login-form__field {
  margin-bottom: 1rem;
}

.login-form__label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.login-form__input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.login-form__input:focus {
  outline: none;
  border-color: #6b46c1;
  box-shadow: 0 0 0 1px #6b46c1;
}

.login-form__footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-form__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.login-form__register-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: #6b46c1;
  text-decoration: none;
}

.login-form__register-link:hover {
  text-decoration: underline;
}

.login-form__error {
  color: #e53e3e;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.login-form__message {
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 1rem;
}

.login-form__message--success {
  background-color: #c6f6d5;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.login-form__message--error {
  background-color: #fed7d7;
  color: #c53030;
  border: 1px solid #feb2b2;
}.register-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

.register-form__title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #333;
}

.register-form__field {
  margin-bottom: 1rem;
}

.register-form__label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.register-form__input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.register-form__input:focus {
  outline: none;
  border-color: #6b46c1;
  box-shadow: 0 0 0 1px #6b46c1;
}

.register-form__footer {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.register-form__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.register-form__login-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  color: #6b46c1;
  text-decoration: none;
}

.register-form__login-link:hover {
  text-decoration: underline;
}

.register-form__error {
  color: #e53e3e;
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.register-form__field-error {
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.register-form__message {
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 1rem;
}

.register-form__message--success {
  background-color: #c6f6d5;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.register-form__message--error {
  background-color: #fed7d7;
  color: #c53030;
  border: 1px solid #feb2b2;
}.child-profile-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
}

.child-profile-form__title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #333;
}

.child-profile-form__field {
  margin-bottom: 1rem;
}

.child-profile-form__label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.child-profile-form__input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.child-profile-form__input:focus {
  outline: none;
  border-color: #6b46c1;
  box-shadow: 0 0 0 1px #6b46c1;
}

.child-profile-form__footer {
  margin-top: 1.5rem;
}

.child-profile-form__message {
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 1rem;
}

.child-profile-form__message--success {
  background-color: #c6f6d5;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.child-profile-form__message--error {
  background-color: #fed7d7;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.child-profile-form__description {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.child-profile-form__actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.child-profile-form__field-error {
  color: #e53e3e;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}.profile-view {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.profile-view__header {
  margin-bottom: 2rem;
  text-align: center;
}

.profile-view__title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #4a5568;
}

.profile-view__subtitle {
  color: #718096;
}

.profile-view__section {
  margin-bottom: 2rem;
}

.profile-view__section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  color: #4a5568;
}

.profile-view__section-content {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.profile-view__card {
  margin-bottom: 1rem;
}

.profile-view__child-profile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.profile-view__child-profile-info {
  display: flex;
  flex-direction: column;
}

.profile-view__child-profile-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.profile-view__child-profile-age {
  color: #718096;
  font-size: 0.9rem;
}

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

.profile-view__switch-button {
  background-color: #f7fafc;
  color: #4a5568;
  border-color: #cbd5e0;
}

.profile-view__user-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-view__user-info-item {
  display: flex;
  justify-content: space-between;
}

.profile-view__user-info-label {
  font-weight: 600;
  color: #4a5568;
}

.profile-view__user-info-value {
  color: #2d3748;
}

.profile-view__actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
}

.profile-view__add-button {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}

.profile-view__logout-button {
  margin-top: 2rem;
  width: 100%;
}

.profile-view__message {
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.profile-view__message--success {
  background-color: #c6f6d5;
  color: #276749;
  border: 1px solid #9ae6b4;
}

.profile-view__message--error {
  background-color: #fed7d7;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.profile-view__modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.profile-view__modal-content {
  background-color: white;
  border-radius: 8px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}.auth-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 100px); /* Adjust for header/footer */
  padding: 2rem 1rem;
  background-color: #f7fafc;
}

.auth-view__logo {
  margin-bottom: 2rem;
  text-align: center;
}

.auth-view__logo img {
  width: 150px;
  height: auto;
}

.auth-view__container {
  width: 100%;
  max-width: 400px;
}

.auth-view__verify-email {
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem;
}

.auth-view__verify-email-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #4a5568;
}

.auth-view__verify-email-message {
  margin-bottom: 1.5rem;
  color: #718096;
  line-height: 1.5;
}

.auth-view__verify-email-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: #6b46c1;
}

.auth-view__back-button {
  margin-top: 1.5rem;
}.migration-prompt {
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.migration-prompt h2 {
  color: #2c3e50;
  margin-top: 0;
  text-align: center;
}

.migration-prompt p {
  margin: 16px 0;
  font-size: 1.1em;
  text-align: center;
}

.migration-prompt ul {
  margin: 16px 0;
  padding-left: 24px;
}

.migration-prompt li {
  margin: 8px 0;
}

.button-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.confirm-button {
  background-color: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.confirm-button:hover {
  background-color: #219653;
}

.confirm-button:disabled {
  background-color: #a0a0a0;
  cursor: not-allowed;
}

.skip-button {
  background-color: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
}

.skip-button:hover {
  background-color: #eee;
}

.skip-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.migration-success {
  text-align: center;
}

.error-message {
  color: #e74c3c;
  text-align: center;
  margin-top: 10px;
  font-weight: 500;
}.create-profile-view {
  max-width: 600px;
  width: 100%;
}

.create-profile-view__header {
  margin-bottom: 2rem;
  text-align: center;
}

.create-profile-view__title {
  font-size: 1.75rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.create-profile-view__subtitle {
  color: #666;
  font-size: 1rem;
}.email-verification {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px); /* Adjust for header height */
  padding: 20px;
}

.email-verification__card {
  max-width: 500px;
  text-align: center;
  padding: 40px 30px;
}

.email-verification__success-icon {
  font-size: 64px;
  color: #4caf50;
  margin-bottom: 20px;
}

.email-verification__error-icon {
  font-size: 64px;
  color: #f44336;
  margin-bottom: 20px;
}

.email-verification__loading {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  border-top-color: #0066ff;
  animation: spin 1s linear infinite;
}

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

.email-verification__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.email-verification h2 {
  margin-bottom: 16px;
  color: #333;
}

.email-verification p {
  margin-bottom: 24px;
  color: #666;
  line-height: 1.5;
}.read-aloud-control-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #6b46c1;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  animation: slide-up 0.3s ease-out;
}

.read-aloud-control-bar .story-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  padding-right: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.read-aloud-control-bar .story-info:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding-left: 8px;
}

.read-aloud-control-bar .story-title {
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.read-aloud-control-bar .page-indicator {
  font-size: 12px;
  opacity: 0.9;
}

.read-aloud-control-bar .controls {
  display: flex;
  gap: 12px;
}

.play-pause-button, .stop-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background-color: white;
  color: #6b46c1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  font-size: 24px; /* Make emoji icons larger */
}

.play-pause-button:hover, .stop-button:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.play-pause-button:active, .stop-button:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* We're not using the background images anymore since we're using inline SVG */
.play-pause-button__icon, .stop-button__icon {
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Add spacing at the bottom of the page to accommodate the control bar */
.read-aloud-control-bar-spacer {
  height: 60px;
  width: 100%;
}

/* Animation */
@keyframes slide-up {
  from { transform: translateY(60px); }
  to { transform: translateY(0); }
}.app {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  min-height: 100vh;
  color: #333;
  background-color: #f9f9f9;
  display: flex;
  flex-direction: column;
}

.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
}

/* Centered container for profile form */
.centered-profile-form {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 4rem;
}

/* Auth-related styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 2rem 1rem;
}

.auth-info-banner {
  background-color: #e6fffa;
  border-left: 4px solid #38b2ac;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.auth-success-message {
  background-color: #c6f6d5;
  color: #276749;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.auth-error-message {
  background-color: #fed7d7;
  color: #c53030;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

h1, h2, h3 {
  color: #222;
  font-weight: 600;
}

/* We'll leave these in place for now as a fallback, 
   but they will be replaced by the UI components */
button {
  background-color: #0066cc;
  color: white;
  border: none;
  padding: 10px 20px;
  margin: 10px;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 4px;
}

button:hover {
  background-color: #0055b3;
}

button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.error-message {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fcebea;
  border: 1px solid #eb5757;
  color: #eb5757;
  padding: 12px 24px;
  border-radius: 4px;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.character-select ul {
  list-style: none;
  padding: 0;
}

.character-select li {
  cursor: pointer;
  padding: 10px;
  margin: 5px 0;
  background-color: #eee;
  border-radius: 5px;
}

.character-select li.selected {
  background-color: #4ecdc4;
  color: white;
}

.character-select form {
  margin-top: 20px;
}

.character-select input,
.character-select textarea {
  display: block;
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 1em;
  border-radius: 5px;
  border: 1px solid #ccc;
  font-family: 'Bubblegum Sans', cursive;
}

.story-creation .page,
.story-playback .page {
  margin-bottom: 20px;
}

.story-creation img,
.story-playback img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.story-playback .controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}
.character-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  cursor: pointer;
}

.character-item.selected {
  background-color: #f0f0f0;
}

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

.character-name {
  font-weight: bold;
}

.character-creature {
  margin-left: 5px;
  color: #888;
}

.checkbox {
  width: 20px;
  height: 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox.checked {
  background-color: #4caf50;
  border-color: #4caf50;
  color: #fff;
}

.page {
  margin-bottom: 20px;
  padding: 20px;
  background-color: #f5f5f5;
  border-radius: 5px;
}

.image-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  background-color: #e0e0e0;
  border-radius: 5px;
}

.image-error {
  color: red;
  font-weight: bold;
}

@media (max-width: 600px) {
  .page {
    padding: 10px;
  }
}