/* Story Reader Page Styles */

/* Modal open state - prevents body scroll */
body.modal-open {
  overflow: hidden !important;
}

/* Animation for success banner */
@keyframes slideIn {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* New Story Success Banner */
.new-story-banner {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #28a745;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1002;
  animation: slideIn 0.3s ease-out;
  max-width: 400px;
  text-align: center;
  transition: opacity 0.3s ease-out;
}

.new-story-banner-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.new-story-banner-close {
  background: none;
  border: none;
  color: white;
  font-size: 20px;
  cursor: pointer;
  margin-left: 15px;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.new-story-banner-close:hover {
  opacity: 0.8;
}

/* Header buttons animation states */
.header-buttons.hidden-scroll {
  transform: translateY(-100%);
}

.header-buttons.sidebar-open {
  display: none !important;
}

.header-buttons-hidden {
  transform: translateY(-100%);
}

.header-buttons-visible {
  transform: translateY(0);
}

/* Authentication Error Styles */
.auth-error-actions {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.btn-reauthenticate {
  background: #667eea;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  min-width: 120px;
}

.btn-reauthenticate:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.btn-reauthenticate:nth-child(2) {
  background: #6c757d;
}

.btn-reauthenticate:nth-child(2):hover {
  background: #5a6268;
}

/* Story History Sidebar Styles */
.story-sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  transition: left 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.story-sidebar.active {
  left: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
  /* Ensure overlay covers everything on mobile */
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #667eea;
  color: white;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.sidebar-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
}

.sidebar-content {
  padding: 20px;
  /* Ensure content is scrollable on mobile */
  max-height: calc(100vh - 220px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* Custom scrollbar for webkit browsers */
.sidebar-content::-webkit-scrollbar {
  width: 8px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.story-group {
  margin-bottom: 32px;
}

.story-group-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: #4a5568;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 16px 20px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  margin-bottom: 12px;
  text-decoration: none;
  color: #2d3748;
  background: white;
  transition: all 0.25s ease;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: visible;
}

.story-item:hover {
  background: #f8fafc;
  border-color: #667eea;
  transform: translateX(4px) translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.story-content-wrapper {
  flex: 1;
  min-width: 0; /* Allow text to truncate */
}

/* Delete button for subscribed users */
.story-delete-btn {
  background: #dc3545;
  border: none;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  opacity: 0.7;
  min-width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-delete-btn:hover {
  background: #c82333;
  opacity: 1;
  transform: scale(1.05);
}

.story-delete-btn:active {
  transform: scale(0.95);
}

.story-title-sidebar {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 8px;
  color: #2d3748;
  line-height: 1.3;
}

.story-meta {
  font-size: 0.75rem;
  color: #718096;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-style-badge {
  background: #e2e8f0;
  color: #4a5568;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: capitalize;
}

.story-style-badge.rhyme {
  background: #fef5e7;
  color: #c05621;
}

.header-buttons {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  z-index: 1001;
  flex-wrap: wrap;
  background: white;
  padding: 10px 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.header-btn {
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  min-height: 44px;
  width: auto; /* Allow button to grow with content */
  min-width: 120px;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  font-family: inherit;
  box-sizing: border-box;
}

/* Ensure button and anchor tags have same styles */
a.header-btn,
button.header-btn {
  padding: 10px 18px !important;
  line-height: 1 !important;
  text-align: center;
  vertical-align: middle;
}

/* Reset any anchor-specific styles */
a.header-btn {
  display: inline-flex;
  text-decoration: none;
}

.header-btn:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.sign-out-btn {
  background: #dc3545;
  margin-left: auto;
}

.sign-out-btn:hover {
  background: #c82333;
}

/* Profile Filter Styles */
.profile-filter-container {
  padding: 20px;
  background: rgba(102, 126, 234, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0 0 12px 12px;
}

.profile-filter-label {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
  font-family: 'Comic Neue', cursive;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.profile-filter-select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Comic Neue', cursive;
  background: white;
  color: #2d3748;
  transition: all 0.2s ease;
  cursor: pointer;
}

.filter-chips {
  padding: 0 20px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  background: #f0f0f0;
  border-radius: 16px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

.filter-chip button {
  background: none;
  border: none;
  margin-left: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
}

.profile-filter-select:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.profile-filter-select:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

/* Profile Management Overlay Styles */
.profile-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.profile-overlay.active {
  opacity: 1;
  visibility: visible;
}

.profile-sidebar {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  transition: right 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

.profile-sidebar.active {
  right: 0;
}

/* Sidebar actions using create-story styling */
.sidebar-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  /* Ensure actions are always visible at bottom on mobile */
  margin-top: auto;
  flex-shrink: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.sidebar-section {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-section:last-child {
  border-bottom: none;
  padding-bottom: 32px;
}

.sidebar-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 20px 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Use nav-btn styling for consistency with create-story */
.nav-btn.action-btn {
  display: flex;
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 12px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #4a5568;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  min-height: 56px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
}

.nav-btn.action-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  color: #2d3748;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.nav-btn.action-btn.upgrade {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.nav-btn.action-btn.upgrade:hover {
  background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.nav-btn.action-btn.secondary {
  background: rgba(255, 255, 255, 0.8);
  color: #6c757d;
  border: 2px solid rgba(108, 117, 125, 0.3);
}

.nav-btn.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #495057;
  border-color: rgba(108, 117, 125, 0.5);
}

.nav-btn.action-btn.btn-danger {
  background: rgba(220, 53, 69, 0.9);
  color: white;
  border: 2px solid rgba(220, 53, 69, 0.3);
}

.nav-btn.action-btn.btn-danger:hover {
  background: rgba(200, 35, 51, 0.95);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.nav-btn.action-btn.btn-disabled {
  background: rgba(226, 232, 240, 0.7);
  color: #a0aec0;
  cursor: not-allowed;
  opacity: 0.7;
  position: relative;
  border: 2px solid rgba(160, 174, 192, 0.3);
}

.nav-btn.action-btn.btn-disabled:hover {
  background: rgba(226, 232, 240, 0.7);
  color: #a0aec0;
  transform: none;
  box-shadow: none;
}

.nav-btn.action-btn.btn-disabled::after {
  content: attr(title);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1000;
}

.nav-btn.action-btn.btn-disabled:hover::after {
  opacity: 1;
  visibility: visible;
}

/* Ensure anchor tags inherit button styles properly */
a.nav-btn.action-btn {
  text-decoration: none;
  display: flex;
  box-sizing: border-box;
}

.sidebar-privacy-control {
  margin-bottom: 24px;
  padding: 20px;
  background: #f0f9ff;
  border-radius: 12px;
  border: 2px solid #0ea5e9;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-privacy-control .privacy-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.sidebar-privacy-control .privacy-label {
  font-size: 1rem;
  color: #1a202c;
  font-weight: 700;
  text-shadow: none;
}

.sidebar-privacy-control .privacy-description {
  text-align: center;
  font-size: 0.8rem;
  color: #4a5568;
  margin-top: 12px;
  line-height: 1.4;
}

/* Header actions styling */
.sidebar-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.sidebar-refresh {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-refresh:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(180deg);
}

.sidebar-refresh.spinning {
  animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
  .profile-sidebar {
    width: 320px;
    right: -320px;
  }
}

.profile-add-button-container {
  text-align: center;
  margin-top: 20px;
  padding: 20px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Mobile sidebar optimization - full viewport coverage */
@media (max-width: 768px) {
  .story-sidebar {
    width: 100vw;
    left: -100vw;
    right: auto;
    height: 100vh;
    position: fixed;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: left 0.3s ease;
  }
  
  .story-sidebar.active {
    left: 0;
  }
  
  .sidebar-header {
    padding: 20px;
    background: #667eea;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e2e8f0;
    min-height: 60px;
  }
  
  .sidebar-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
  }
  
  .sidebar-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 12px;
    line-height: 1;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    touch-action: manipulation;
  }
  
  .sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
  }
  
  .sidebar-refresh {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }
  
  .sidebar-refresh:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(180deg);
  }
  
  .sidebar-refresh.spinning {
    animation: spin 1s linear infinite;
  }
  
  /* Mobile sidebar - use create-story nav-btn styling */
  .nav-btn.action-btn {
    padding: 20px 24px;
    margin-bottom: 16px;
    font-size: 1.1rem;
    min-height: 64px;
    border-radius: 12px;
    font-weight: 600;
    gap: 16px;
  }
  
  .sidebar-privacy-control {
    margin-bottom: 24px;
    padding: 20px;
    background: #f0f9ff;
    border-radius: 12px;
    border: 2px solid #0ea5e9;
  }
  
  .sidebar-privacy-control .privacy-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
  }
  
  .sidebar-privacy-control .privacy-label {
    font-size: 1.1rem;
    color: #0c4a6e;
    font-weight: 700;
    text-shadow: none;
  }
  
  .sidebar-privacy-control .privacy-description {
    text-align: center;
    font-size: 0.9rem;
    color: #0c4a6e;
    margin-top: 12px;
    line-height: 1.4;
  }
}

.reader-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  padding-top: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.story-header {
  text-align: center;
  margin-bottom: 10px; /* Reduced by half */
  margin-top: 20px; /* Push down to prevent nav overlap when buttons wrap */
  flex-shrink: 0;
}

.story-title {
  font-size: 2.5rem;
  color: #667eea;
  margin-bottom: 10px;
  font-family: 'Georgia', serif;
}

.story-meta {
  color: #718096;
  font-size: 1rem;
}

.story-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding: 20px;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.story-section {
  display: none;
  animation: fadeIn 0.5s ease-in;
  flex: 0 1 auto; /* Changed from flex: 1 to allow natural height */
  overflow: visible; /* Changed from overflow-y: auto to visible */
}

.story-section.active {
  display: flex;
  flex-direction: column;
  gap: 20px; /* Space between image and text - reduced by half */
}

/* Desktop side-by-side layout */
@media (min-width: 1024px) {
  .story-section.active {
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
  }
  
  .section-image-container {
    flex: 0 0 50%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  
  .section-text-container {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  /* Alternate image placement - odd sections have image on right */
  .story-section:nth-child(odd).active {
    flex-direction: row-reverse;
  }
}

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

.section-image {
  width: 100%;
  height: 100%;
  max-width: 400px;
  aspect-ratio: 1 / 1; /* Square container for square images */
  object-fit: cover; /* Fill the square container */
  margin: 0 auto 0; /* Remove margin since gap handles spacing */
  display: block;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

/* Desktop image sizing */
@media (min-width: 1024px) {
  .section-image {
    max-width: 500px;
    margin: 0;
  }
}

.section-text {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #2d3748;
  font-family: 'Georgia', serif;
  text-align: justify;
  flex: 1;
}

/* Desktop text sizing */
@media (min-width: 1024px) {
  .section-text {
    font-size: 1.3rem;
    line-height: 1.7;
  }
  
  .section-text.verse {
    line-height: 1.7;
  }
}

.section-text.verse {
  text-align: center;
  white-space: pre-line;
  font-style: italic;
  line-height: 1.6;
}

/* Remove italics from "The End" on the last scene */
.story-section.last-scene .section-text.verse {
  font-style: normal;
}

.story-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.nav-button {
  padding: 16px 32px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.nav-button:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.nav-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.page-indicator {
  color: #718096;
  font-size: 1rem;
}

.story-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.story-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(102, 126, 234, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(102, 126, 234, 0.1);
}

.privacy-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #718096;
  transition: .4s;
  border-radius: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

input:checked + .toggle-slider {
  background-color: #ff6b35;
}

input:checked + .toggle-slider:before {
  transform: translateX(26px);
}

.privacy-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 0.9rem;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

.btn-disabled {
  background-color: #e2e8f0;
  color: #a0aec0;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-disabled:hover {
  background-color: #e2e8f0;
  color: #a0aec0;
  border-color: #e2e8f0;
  transform: none;
}

.hidden {
  display: none !important;
}

.public-story-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-button {
  padding: 12px 24px;
  background: white;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.action-button:hover {
  background: #667eea;
  color: white;
}

.action-button.primary {
  background: #667eea;
  color: white;
}

.action-button.primary:hover {
  background: #5a67d8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.25);
}

.action-button.large {
  padding: 16px 32px;
  font-size: 1.1rem;
  font-weight: 600;
  display: inline-flex;
  white-space: nowrap;
}

/* CTA Section Styles */
.cta-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  margin-top: 20px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.cta-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  font-family: 'Georgia', serif;
}

.cta-subtitle {
  font-size: 1.1rem;
  opacity: 0.95;
  margin-bottom: 24px;
  line-height: 1.5;
}

.cta-features {
  font-size: 1rem;
  margin-top: 24px;
  line-height: 1.8;
  opacity: 0.9;
  text-align: left;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.loading-placeholder {
  background: #f7fafc;
  border-radius: 8px;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
}

.image-placeholder {
  height: 300px;
  max-width: 400px;
  width: 100%;
  margin: 0 auto 20px;
}

/* Desktop placeholder sizing */
@media (min-width: 1024px) {
  .image-placeholder {
    height: 50vh;
    margin: 0;
  }
}

.error-message {
  background: #fed7d7;
  color: #c53030;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}

/* Tablet styles */
@media (max-width: 1023px) {
  .reader-container {
    padding: 15px 20px;
    padding-top: 100px; /* More space for header buttons */
  }
  
  /* Show header buttons for non-owners on tablets */
  .header-buttons.non-owner {
    display: flex;
  }
  
  /* Keep proper top padding for non-owner views */
  body.non-owner-view .reader-container {
    padding-top: 100px; /* Consistent with owner view */
  }
  
  .header-buttons {
    padding: 10px 15px;
  }
  
  .story-title {
    font-size: 2.2rem;
    margin-bottom: 15px;
  }

  .story-header {
    margin-top: 30px; /* Extra space for wrapped nav on tablet */
  }
  
  .story-content {
    padding: 20px;
  }
  
  .section-text {
    font-size: 1.15rem;
    line-height: 1.6;
    text-align: left; /* Better for reading on mobile */
  }
  
  .section-image {
    max-width: 400px;
    margin-bottom: 45px; /* More space on tablet */
  }
  
  .story-navigation {
    margin-top: 30px;
    padding-top: 15px;
  }
  
  .nav-button {
    padding: 18px 24px;
    font-size: 1.1rem;
    min-height: 56px; /* Better touch target */
    border-radius: 12px;
    font-weight: 600;
  }
  
  .story-actions {
    margin-top: 30px;
    gap: 12px;
  }
  
  .action-button {
    padding: 14px 20px;
    font-size: 1rem;
    min-height: 48px;
  }
}

/* Mobile phone styles */
@media (max-width: 768px) {
  .reader-container {
    padding: 10px 15px;
    padding-top: 100px; /* More breathing room after top nav */
    min-height: 100vh;
    height: auto;
  }
  
  /* Show header buttons for non-owners on mobile */
  .header-buttons.non-owner {
    display: flex;
  }
  
  /* Keep proper top padding for non-owner views */
  body.non-owner-view .reader-container {
    padding-top: 130px; /* More space for mobile header */
  }
  
  /* Hide story controls on mobile for non-owners to maximize content space */
  body.non-owner-view .story-controls {
    display: none;
  }
  
  /* Show story actions (CTA) for non-owners on mobile */
  body.non-owner-view .story-actions {
    display: block;
  }
  
  .header-buttons {
    gap: 8px;
    padding: 10px 15px;
  }
  
  .story-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1.2;
  }

  .story-header {
    margin-top: 40px; /* Extra space for wrapped nav on mobile */
  }
  
  .story-content {
    padding: 16px;
  }
  
  .section-text {
    font-size: 1.1rem;
    line-height: 1.5;
    text-align: left;
  }
  
  .section-image {
    max-width: 100%;
    margin-bottom: 40px; /* More space on mobile */
  }
  
  .story-navigation {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
    flex-direction: row;
  }
  
  .nav-button {
    flex: 1;
    min-width: 140px;
    max-width: 48%;
    justify-content: center;
    padding: 20px 16px;
    font-size: 1.1rem;
    min-height: 60px;
    border-radius: 12px;
    font-weight: 600;
  }
  
  .nav-button#next-btn {
    order: 1;
  }
  
  .nav-button#prev-btn {
    order: -1;
  }
  
  .page-indicator {
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    order: 2; /* Put page indicator below buttons */
    margin-top: 8px;
  }
  
  .story-actions {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  .action-button {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
  
  .story-controls {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .public-story-info {
    flex-direction: column;
    gap: 10px;
  }
  
  /* CTA Section mobile adjustments */
  .cta-section {
    padding: 25px 15px;
    overflow: visible;
  }
  
  .cta-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
  }
  
  .cta-subtitle {
    font-size: 1rem;
    margin-bottom: 20px;
  }
  
  .action-button.large {
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    padding: 14px 20px;
    font-size: 1rem;
  }
  
  .cta-features {
    font-size: 0.9rem;
    margin-top: 20px;
  }
}

/* Mobile landscape optimization */
@media (max-width: 1023px) and (orientation: landscape) and (max-height: 600px) {
  .reader-container {
    height: 100vh;
    padding-top: 70px; /* Less padding in landscape */
  }
  
  /* Consistent padding for non-owners in landscape */
  body.non-owner-view .reader-container {
    padding-top: 70px; /* Match owner view landscape padding */
  }
  
  .header-buttons {
    top: 8px;
    gap: 6px;
  }
  
  .header-btn {
    padding: 8px 14px;
    font-size: 1rem;
    min-height: 44px; /* Better touch targets in landscape */
    width: 110px; /* Fixed width for consistency */
  }
  
  .story-header {
    margin-bottom: 8px;
  }
  
  .story-title {
    font-size: 1.5rem;
    margin-bottom: 5px;
  }
  
  /* Sidebar adjustments for landscape */
  .story-sidebar {
    width: 100vw;
    left: -100vw;
  }
  
  .sidebar-header {
    min-height: 50px;
    padding: 15px 20px;
    line-height: 1.1;
  }
  
  .story-content {
    padding: 12px;
  }
  
  .section-image {
    margin-bottom: 35px; /* More space on landscape */
  }
  
  .section-text {
    font-size: 0.95rem;
    line-height: 1.4;
  }
  
  .story-navigation {
    margin-top: 15px;
    padding-top: 10px;
  }
  
  .nav-button {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 40px;
  }
  
  .story-actions {
    margin-top: 20px;
    gap: 8px;
  }
  
  .action-button {
    padding: 10px 16px;
    font-size: 0.9rem;
    min-height: 40px;
  }
}

/* Very small screens (iPhone SE, etc.) */
@media (max-width: 480px) {
  .reader-container {
    padding: 8px 12px;
    padding-top: 140px; /* More breathing room after top nav */
  }
  
  /* Ensure adequate top padding for very small screens */
  body.non-owner-view .reader-container {
    padding-top: 140px; /* Match the general padding for small screens */
  }
  
  .header-btn {
    padding: 8px 14px;
    font-size: 1rem;
    gap: 6px;
    min-height: 44px; /* Better touch target for small screens */
    width: 110px; /* Fixed width for consistency */
    border-radius: 8px;
  }
  
  .story-title {
    font-size: 1.6rem;
    line-height: 1.2;
  }
  
  .story-content {
    padding: 12px;
  }
  
  .section-text {
    font-size: 1rem;
    line-height: 1.4;
  }
  
  .section-image {
    margin-bottom: 35px; /* More space on small screens */
  }
  
  .nav-button {
    padding: 12px 16px;
    font-size: 0.9rem;
    min-width: 100px;
  }
  
  .page-indicator {
    font-size: 0.85rem;
    margin: 8px 0;
  }
  
  .action-button {
    padding: 12px 16px;
    font-size: 0.9rem;
    max-width: 280px;
  }
  
  /* Small screen adjustments - full width sidebar */
  .story-sidebar {
    width: 100vw;
    left: -100vw;
    right: auto;
  }
  
  .nav-btn.action-btn {
    padding: 16px 20px;
    font-size: 1rem;
    min-height: 56px; /* Better touch target */
    border-radius: 10px;
    font-weight: 500;
  }
  
  .sidebar-privacy-control .privacy-label {
    font-size: 0.85rem;
  }
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

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

/* Heart Loader Animation */
.heart-loader {
  display: inline-block;
  font-size: 1.2em;
  animation: heartBeat 1.2s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  25% {
    transform: scale(1.3);
    opacity: 0.8;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}

/* PDF Download Button - In Header on Right */
.pdf-download-btn {
  margin-left: auto !important;
  background: #667eea !important;
  color: white !important;
  border: none;
  border-radius: 8px;
  padding: 12px 24px !important;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  transition: all 0.2s ease;
  min-width: 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pdf-download-btn:hover:not(:disabled) {
  background: #5a67d8 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pdf-download-btn:active:not(:disabled) {
  transform: translateY(0);
}

/* PDF Download Button Styles */
.download-pdf-trigger {
  position: relative;
  min-width: 140px;
}

.download-pdf-trigger .btn-text,
.download-pdf-trigger .btn-loader {
  display: inline-block;
}

.download-pdf-trigger:disabled {
  opacity: 0.8;
  cursor: wait;
}

.btn-loader {
  display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .pdf-download-btn {
    padding: 10px 18px !important;
    font-size: 0.9rem;
    min-width: 140px;
  }
}

/* First Story Modal Styles */
.first-story-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.first-story-modal.show {
  display: flex;
}

.first-story-modal-content {
  background-color: #fff;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.first-story-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px 15px;
  border-bottom: 1px solid #eee;
}

.first-story-modal-header h2 {
  margin: 0;
  color: #333;
  font-size: 1.5rem;
}

.first-story-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.first-story-modal-close:hover {
  background-color: #f5f5f5;
  color: #333;
}

.first-story-modal-body {
  padding: 25px 30px 30px;
}

.first-story-modal-body p {
  margin: 0 0 15px;
  color: #2d3748;
  line-height: 1.6;
  font-size: 15px;
}

.first-story-modal-body p strong {
  color: #1a202c;
  font-weight: 600;
}

.first-story-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 25px;
}

/* Modal Privacy Control Styles (same as library overlay) */
.modal-privacy-control {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
  border: 2px solid rgba(102, 126, 234, 0.15);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.modal-privacy-control .privacy-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin-bottom: 10px;
}

.modal-privacy-control .privacy-label {
  font-weight: 600;
  color: #4a5568;
  font-size: 15px;
}

.modal-privacy-control .privacy-description {
  text-align: center;
  font-size: 13px;
  color: #4a5568;
  font-style: italic;
  line-height: 1.4;
}

.first-story-actions .btn {
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 52px;
  gap: 8px;
}

.first-story-actions .btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.first-story-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);
}

.first-story-actions .btn-secondary {
  background: #fff;
  color: #495057;
  border: 2px solid #dee2e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.first-story-actions .btn-secondary:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.first-story-actions .btn-upgrade {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #333;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(255, 193, 7, 0.3);
}

.first-story-actions .btn-upgrade:hover {
  background: linear-gradient(135deg, #ffb300 0%, #fb8c00 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 193, 7, 0.4);
}

.social-share {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
  margin-top: 20px;
}

.social-share p {
  margin: 0 0 15px;
  font-size: 15px;
  color: #4a5568;
  font-weight: 500;
}

.social-share .btn-social {
  margin: 0 6px;
  padding: 12px 24px;
  font-size: 14px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  min-height: 48px;
  min-width: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.social-share .btn-social.twitter {
  background: #1da1f2;
  color: white;
}

.social-share .btn-social.twitter:hover {
  background: #0d8bd9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29, 161, 242, 0.3);
}

.social-share .btn-social.facebook {
  background: #4267b2;
  color: white;
}

.social-share .btn-social.facebook:hover {
  background: #365899;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(66, 103, 178, 0.3);
}

/* Action buttons container */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.action-buttons .btn {
  width: 100%;
  padding: 14px 20px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Profile filter container styles - moved from inline for CSP compliance */
.profile-filter-container {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.profile-filter-label {
  font-family: inherit;
  font-weight: 500;
}

.profile-filter-select {
  font-family: inherit;
}

/* Loading substatus styles - moved from inline for CSP compliance */
#loading-substatus {
  font-size: 0.9em;
  color: #666;
  margin-top: 10px;
}

/* Private story notice - moved from inline for CSP compliance */
.private-story-notice {
  display: none;
}

@media (max-width: 768px) {
  .first-story-modal-content {
    margin: 20px;
    width: calc(100% - 40px);
    max-width: 500px;
  }

  .first-story-modal-header,
  .first-story-modal-body {
    padding-left: 20px;
    padding-right: 20px;
  }

  .action-buttons {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .social-share .btn-social {
    margin: 5px 0;
    width: 100%;
    max-width: 250px;
  }

  .first-story-modal-body p {
    font-size: 14px;
  }

  .first-story-modal-header h2 {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .first-story-modal-content {
    margin: 10px;
    width: calc(100% - 20px);
  }

  .first-story-modal-header,
  .first-story-modal-body {
    padding: 15px;
  }

  .first-story-actions .btn,
  .action-buttons .btn {
    font-size: 14px;
    padding: 12px 16px;
    min-height: 48px;
  }

  .social-share .btn-social {
    font-size: 13px;
    padding: 10px 20px;
    min-height: 44px;
  }
}

/* ============================================
   Theme Selector Styles
   ============================================ */

.sidebar-theme-control {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

/* Compact theme dropdown styles */
.theme-selector-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.theme-label-compact {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
}

.theme-dropdown {
  flex: 1;
  min-width: 0; /* Allow flexbox to shrink below content size */
  max-width: 100%; /* Prevent overflow */
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: white;
  color: #333;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden; /* Hide any text overflow */
  text-overflow: ellipsis; /* Show ... for long text */
  white-space: nowrap; /* Prevent text wrapping */
}

.theme-dropdown:hover {
  border-color: #999;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.theme-dropdown:focus {
  outline: none;
  border-color: #666;
  box-shadow: 0 0 0 2px rgba(102, 102, 102, 0.2);
}

.theme-dropdown option {
  background: white;
  color: #333;
}

/* Keep old theme selector styles for backward compatibility */
.theme-selector {
  width: 100%;
}

.theme-label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  font-size: 14px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.theme-option.active {
  border-color: #333;
  background: #fafafa;
}

.theme-preview {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--theme-primary), var(--theme-secondary));
}

.theme-name {
  font-size: 11px;
  color: #666;
  text-align: center;
}

/* Theme color definitions */
.theme-option.enchanted .theme-preview {
  --theme-primary: #6c63ff;
  --theme-secondary: #8b85ff;
}

.theme-option.ocean .theme-preview {
  --theme-primary: #00b4d8;
  --theme-secondary: #0077b6;
}

.theme-option.forest .theme-preview {
  --theme-primary: #52b788;
  --theme-secondary: #2d6a4f;
}

.theme-option.sunset .theme-preview {
  --theme-primary: #ff6b6b;
  --theme-secondary: #ffa94d;
}

.theme-option.cosmic .theme-preview {
  --theme-primary: #e056fd;
  --theme-secondary: #be2edd;
}

/* ============================================
   Theme Color Applications
   ============================================ */

/* Default theme (Enchanted) */
:root {
  --story-accent: #6c63ff;
  --story-accent-hover: #5a52e0;
  --story-accent-light: #e6e5ff;
  --story-accent-dark: #4a42b3;
}

/* Enchanted theme */
[data-story-theme="enchanted"] {
  --story-accent: #6c63ff;
  --story-accent-hover: #5a52e0;
  --story-accent-light: #e6e5ff;
  --story-accent-dark: #4a42b3;
}

/* Ocean theme */
[data-story-theme="ocean"] {
  --story-accent: #00b4d8;
  --story-accent-hover: #0096c7;
  --story-accent-light: #caf0f8;
  --story-accent-dark: #0077b6;
}

/* Forest theme */
[data-story-theme="forest"] {
  --story-accent: #52b788;
  --story-accent-hover: #40916c;
  --story-accent-light: #d8f3dc;
  --story-accent-dark: #2d6a4f;
}

/* Sunset theme */
[data-story-theme="sunset"] {
  --story-accent: #ff6b6b;
  --story-accent-hover: #ff5252;
  --story-accent-light: #ffe0e0;
  --story-accent-dark: #c92a2a;
}

/* Cosmic theme */
[data-story-theme="cosmic"] {
  --story-accent: #e056fd;
  --story-accent-hover: #be2edd;
  --story-accent-light: #f8e5ff;
  --story-accent-dark: #9c27b0;
}

/* Apply theme colors to elements */
[data-story-theme] .story-title {
  color: var(--story-accent);
}

[data-story-theme] .nav-button {
  background: var(--story-accent);
  border-color: var(--story-accent);
}

[data-story-theme] .nav-button:hover:not(:disabled) {
  background: var(--story-accent-hover);
  border-color: var(--story-accent-hover);
}

[data-story-theme] .nav-button:disabled {
  background: #ccc;
  border-color: #ccc;
}

[data-story-theme] .page-indicator {
  color: var(--story-accent-dark);
}

[data-story-theme] .action-button.primary {
  background: var(--story-accent);
  border-color: var(--story-accent);
}

[data-story-theme] .action-button.primary:hover {
  background: var(--story-accent-hover);
  border-color: var(--story-accent-hover);
}

[data-story-theme] .sidebar-toggle {
  color: var(--story-accent);
}

/* Keep section titles readable - don't change color with theme */
/* [data-story-theme] .sidebar-section-title {
  color: var(--story-accent-dark);
} */

[data-story-theme] .story-item:hover {
  background: var(--story-accent-light);
}

[data-story-theme] .credits-amount {
  color: var(--story-accent);
}

/* ============================================
   Order Book Button - Eye-catching Styles
   ============================================ */

/* Make the Order Your Book button more prominent and eye-catching */
.print-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
  position: relative;
  overflow: hidden;
}

.print-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.print-btn:hover {
  background: linear-gradient(135deg, #ff5252 0%, #ff7043 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5) !important;
}

.print-btn:hover::before {
  left: 100%;
}

/* Subtle pulse animation to draw attention */
@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
  }
}

.print-btn {
  animation: subtlePulse 3s ease-in-out infinite;
}

/* Ensure the button stands out in the modal */
#modal-print-storybook-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4) !important;
}

#modal-print-storybook-btn:hover {
  background: linear-gradient(135deg, #ff5252 0%, #ff7043 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5) !important;
}

/* Sidebar print button styling */
#print-storybook-btn {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3) !important;
}

#print-storybook-btn:hover {
  background: linear-gradient(135deg, #ff5252 0%, #ff7043 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4) !important;
}