/* Speed Reader Specific Styles */

:root {
  /* Theme Agnostic (Indigo Brand Colors) */
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --accent-color: #ef4444; /* Focus Letter Red */
  --accent-soft: rgba(239, 68, 68, 0.15);
  --border-radius-lg: 20px;
  --border-radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
  --font-serif: 'Playfair Display', Georgia, Cambria, serif;

  /* Theme Defaults (Light) */
  --bg-color: #f9fafb;
  --card-bg: #ffffff;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --viewport-bg: #f3f4f6;
  --viewport-border: #e5e7eb;
  --hairline-color: #d1d5db;
  --control-bg: #f3f4f6;
  --control-hover: #e5e7eb;
  --input-bg: #ffffff;
  --input-border: #d1d5db;
}

/* Sepia Theme */
body.sepia-theme {
  --bg-color: #f4ecd8;
  --card-bg: #fdf6e3;
  --text-color: #5c4636;
  --text-muted: #8a705e;
  --viewport-bg: #eadabe;
  --viewport-border: #d2c19d;
  --hairline-color: #bfae8f;
  --control-bg: #ebdcb9;
  --control-hover: #ddcda6;
  --input-bg: #fdf6e3;
  --input-border: #c8b796;
}

/* Dark Theme */
body.dark-theme {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --text-color: #f8fafc;
  --text-muted: #94a3b8;
  --viewport-bg: #020617;
  --viewport-border: #334155;
  --hairline-color: #475569;
  --control-bg: #334155;
  --control-hover: #475569;
  --input-bg: #0f172a;
  --input-border: #334155;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
}

/* Global Overrides */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.speed-reader-container {
  max-width: 800px !important;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  flex: 1;
  transition: padding 0.3s ease;
}

.app-header {
  text-align: center;
  margin-bottom: 2.5rem;
  transition: opacity 0.3s ease, margin 0.3s ease;
}

.app-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}

body.dark-theme .app-header h1 {
  color: #818cf8;
}

.app-header .subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Main Card Wrapper */
.app-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--viewport-border);
  padding: 2.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}
.text-primary {
  color: var(--primary-color);
}

/* INPUT VIEW STATE STYLING */
.input-panel-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.label-with-icon {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.label-with-icon h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.preset-dropdown-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preset-dropdown-container label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.preset-dropdown-container select {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s;
}

.preset-dropdown-container select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Textarea wrapper with clean button */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

.textarea-wrapper textarea {
  width: 100%;
  height: 280px;
  padding: 1.25rem;
  padding-bottom: 3.2rem; /* space for actions */
  border-radius: var(--border-radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: all 0.2s ease;
}

.textarea-wrapper textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.textarea-actions {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 0.5rem;
}

.btn-text-action {
  background-color: var(--control-bg);
  border: 1px solid var(--viewport-border);
  color: var(--text-muted);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-text-action:hover {
  background-color: var(--control-hover);
  color: var(--text-color);
}

.input-stats-bar {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -0.25rem;
  padding: 0 0.25rem;
}

.input-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Stepper WPM control */
.wpm-setting-box {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.wpm-setting-box label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.wpm-stepper {
  display: flex;
  align-items: center;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stepper-btn {
  background: var(--control-bg);
  border: none;
  color: var(--text-color);
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.stepper-btn:hover {
  background: var(--control-hover);
}

.wpm-stepper input {
  width: 80px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-color);
  font-weight: 700;
  text-align: center;
  font-size: 1.05rem;
  outline: none;
  -moz-appearance: textfield;
}

.wpm-stepper input::-webkit-outer-spin-button,
.wpm-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-unit {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--control-bg);
  color: var(--text-color);
  border: 1px solid var(--viewport-border);
}

.btn-secondary:hover {
  background-color: var(--control-hover);
}

.btn-compact {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

.btn-large {
  padding: 0.9rem 2.2rem;
  font-size: 1.05rem;
}

.btn-shadow {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn-shadow-indigo {
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.35);
}

.btn-icon-large {
  background-color: var(--control-bg);
  color: var(--text-color);
  border: 1px solid var(--viewport-border);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-large:hover {
  background-color: var(--control-hover);
  transform: scale(1.08);
}

.btn-icon-large:active {
  transform: scale(0.95);
}

.btn-round {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  padding: 0;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* READER VIEW TOOLBAR */
.reader-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  transition: opacity 0.3s ease;
}

.toolbar-center-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theme-toggles {
  display: flex;
  gap: 0.25rem;
  background-color: var(--control-bg);
  padding: 0.25rem;
  border-radius: 24px;
  border: 1px solid var(--viewport-border);
}

.theme-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  color: var(--text-color);
}

.theme-btn.active {
  background-color: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* RSVP DISPLAY VIEWPORT */
.rsvp-viewport {
  height: 250px;
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-lg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
}

body.dark-theme .rsvp-viewport {
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
}

.rsvp-viewport-back {
  position: absolute;
  bottom: 12px;
  left: 15px;
  z-index: 20;
  background-color: var(--card-bg);
  border: 1px solid var(--viewport-border);
  color: var(--text-color);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  opacity: 0.5; /* slightly dim by default so it's unobtrusive */
}

.rsvp-viewport-back:hover {
  background-color: var(--control-hover);
  transform: translateY(-1px);
  opacity: 1; /* highlight on hover */
}

.rsvp-viewport-back:active {
  transform: translateY(0);
}

/* Gaze-alignment anchor lines */
.rsvp-anchor-line {
  position: absolute;
  left: 50%;
  width: 3px;
  height: 18px;
  background-color: var(--accent-color); /* Highlight color (red) */
  transform: translateX(-50%);
  border-radius: 2px;
  opacity: 0.75;
}

.rsvp-anchor-line.top {
  top: 15px;
}

.rsvp-anchor-line.bottom {
  bottom: 15px;
}

/* Subtle background reference grid */
.rsvp-viewport::after {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 1px;
  border-top: 1px dashed var(--hairline-color);
  opacity: 0.12;
  pointer-events: none;
}

/* Centered RSVP word styling */
.rsvp-word-display {
  width: 100%;
  padding: 0 2.5rem;
  transition: font-size 0.2s ease;
}

/* Monospace alignment for RSVP */
.rsvp-word {
  display: flex;
  width: 100%;
  align-items: center;
  user-select: none;
}

.part {
  display: inline-block;
  white-space: pre;
}

.prefix {
  flex: 1;
  text-align: right;
}

.focus {
  color: var(--accent-color);
  flex: 0 0 auto;
  text-align: center;
  font-weight: 700;
}

.suffix {
  flex: 1;
  text-align: left;
}

/* Font Style Classes */
.font-sans {
  font-family: var(--font-sans);
}

.font-mono {
  font-family: var(--font-mono);
}

.font-serif {
  font-family: var(--font-serif);
}

/* Font Sizes */
.rsvp-word-display.small { font-size: 2.4rem; }
.rsvp-word-display.medium { font-size: 3.4rem; }
.rsvp-word-display.large { font-size: 4.4rem; }
.rsvp-word-display.xlarge { font-size: 5.4rem; }

@media (max-width: 600px) {
  .rsvp-word-display.small { font-size: 1.9rem; }
  .rsvp-word-display.medium { font-size: 2.6rem; }
  .rsvp-word-display.large { font-size: 3.4rem; }
  .rsvp-word-display.xlarge { font-size: 4.0rem; }
}

/* PROGRESS BAR / SCRUBBER */
.progress-bar-container {
  margin-bottom: 2rem;
  transition: opacity 0.3s ease;
}

.progress-slider-wrapper {
  position: relative;
  height: 8px;
  background-color: var(--viewport-bg);
  border-radius: 4px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--viewport-border);
  overflow: hidden;
}

.progress-slider-wrapper input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.progress-fill-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 4px;
  width: 0%;
  pointer-events: none;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* PLAYBACK BUTTONS ROW (Immediately below progress scrubber) */
.playback-controls-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2.5rem;
  transition: opacity 0.3s ease;
}

/* CONFIGURATION PANEL DRAWER */
.settings-drawer {
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  padding: 1.5rem 2rem;
  border-radius: var(--border-radius-lg);
  margin-bottom: 2.5rem;
  transition: opacity 0.3s ease, transform 0.3s;
}

.settings-drawer .panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reader-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .reader-settings-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

.setting-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.setting-control label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.slider-control-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider-control-group input[type="range"] {
  flex: 1;
  height: 6px;
  background: var(--card-bg);
  border: 1px solid var(--viewport-border);
  border-radius: 3px;
  outline: none;
  accent-color: var(--primary-color);
}

.value-display {
  font-size: 0.9rem;
  font-weight: 700;
  min-width: 75px;
  text-align: right;
}

.setting-control select {
  padding: 0.65rem 1rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}

.setting-control select:focus {
  border-color: var(--primary-color);
}

/* Extra toggle toggling options */
.extra-settings {
  border-top: 1px solid var(--viewport-border);
  padding-top: 1.25rem;
  display: flex;
  justify-content: flex-start;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

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

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background-color: var(--viewport-border);
  border-radius: 12px;
  margin-right: 0.75rem;
  transition: 0.3s;
}

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

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary-color);
}

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

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
}

/* KEYBOARD LEGEND */
.shortcuts-legend {
  border: 1px dashed var(--viewport-border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  margin-top: 2rem;
  transition: opacity 0.3s ease;
}

.shortcuts-legend h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-weight: 700;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
}

.shortcut {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

kbd {
  background-color: var(--control-bg);
  border: 1px solid var(--viewport-border);
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0,0,0,0.06);
  color: var(--text-color);
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 7px;
  white-space: nowrap;
}

/* STUBBED MODAL FOR BOOK A CALL */
.modal-stub {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--viewport-border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--viewport-border);
}

.modal-header h2 {
  font-size: 1.25rem;
  color: var(--text-color);
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-muted);
}

.close-btn:hover {
  color: var(--text-color);
}

/* FOOTER */
.app-footer {
  text-align: center;
  padding: 2.5rem 0;
  border-top: 1px solid var(--viewport-border);
  color: var(--text-muted);
  font-size: 0.9rem;
  background-color: var(--card-bg);
  transition: all 0.3s ease;
}

/* ACTIVE NAV LINK */
.active-nav-link {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 2px;
}

/* ========================================== */
/* FOCUS MODE DYNAMIC ACTIVE LAYOUT */
/* ========================================== */

body.focus-mode-active {
  --bg-color: #000000;
  --card-bg: #000000;
  --text-color: #ffffff;
  --viewport-bg: #000000;
  --viewport-border: #1e293b;
  --hairline-color: #334155;
  --control-bg: #1e293b;
  --control-hover: #334155;
  --primary-color: #818cf8; /* indigo active highlight */
}

/* In Sepia Focus Mode */
body.sepia-theme.focus-mode-active {
  --bg-color: #f4ecd8;
  --card-bg: #fdf6e3;
  --text-color: #5c4636;
  --viewport-bg: #fdf6e3;
  --viewport-border: #ebdcb9;
  --hairline-color: #bfae8f;
  --control-bg: #ebdcb9;
  --control-hover: #ddcda6;
}

/* In Light Focus Mode */
body.light-theme.focus-mode-active {
  --bg-color: #ffffff;
  --card-bg: #ffffff;
  --text-color: #1f2937;
  --viewport-bg: #ffffff;
  --viewport-border: #e5e7eb;
  --hairline-color: #d1d5db;
  --control-bg: #f3f4f6;
  --control-hover: #e5e7eb;
}

/* Hide clutter when focus mode is active */
body.focus-mode-active .navbar,
body.focus-mode-active .app-header,
body.focus-mode-active .app-footer,
body.focus-mode-active #settings-drawer,
body.focus-mode-active #shortcuts-legend,
body.focus-mode-active .theme-toggles,
body.focus-mode-active .toolbar-center-controls span,
body.focus-mode-active .tips-guide-section {
  display: none !important;
}

body.focus-mode-active .speed-reader-container {
  padding: 1rem 1.5rem;
}

body.focus-mode-active .app-card {
  box-shadow: none;
  border-color: transparent;
  padding: 1rem 0;
  background: transparent;
}

body.focus-mode-active .rsvp-viewport {
  height: 320px; /* Make canvas slightly larger in focus mode */
  border-color: var(--viewport-border);
}

body.focus-mode-active .progress-stats,
body.focus-mode-active .progress-slider-wrapper {
  opacity: 0.3; /* dim progress details */
}

body.focus-mode-active .progress-slider-wrapper:hover,
body.focus-mode-active .progress-slider-wrapper:focus-within {
  opacity: 1; /* reveal progress on focus or hover */
}

body.focus-mode-active .playback-controls-row {
  opacity: 0.15;
  transition: opacity 0.2s ease;
}

body.focus-mode-active .playback-controls-row:hover,
body.focus-mode-active .playback-controls-row:focus-within {
  opacity: 1;
}

body.focus-mode-active .reader-toolbar {
  margin-bottom: 1rem;
}

/* ========================================== */
/* TIPS & GUIDE SECTION STYLING */
/* ========================================== */

.tips-guide-section {
  margin-top: 4rem;
  border-top: 1px solid var(--viewport-border);
  padding-top: 3rem;
  transition: border-color 0.3s ease;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 700px) {
  .tips-grid {
    grid-template-columns: 1fr;
  }
}

.tip-card {
  background-color: var(--card-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.tip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.tip-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--viewport-bg);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
  transition: all 0.3s ease;
}

.tip-card:hover .tip-icon {
  background-color: var(--primary-color);
  color: white;
}

.tip-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
}

.tip-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  flex-grow: 1;
}

/* Custom card style for training launcher */
.interactive-tip-card {
  border: 2px dashed var(--primary-color);
  background-color: rgba(79, 70, 229, 0.02);
}

body.dark-theme .interactive-tip-card {
  background-color: rgba(79, 70, 229, 0.05);
}

.interactive-tip-card:hover {
  border-style: solid;
}

.interactive-tip-card button {
  margin-top: 0.5rem;
  align-self: flex-start;
}

/* ========================================== */
/* APP SWITCHER TABS STYLING */
/* ========================================== */

.app-switcher-tabs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.app-switcher-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--viewport-border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  width: 100%;
}

.app-switcher-tabs-row .app-switcher-tabs {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  width: auto;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--border-radius-md);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn:hover {
  color: var(--text-color);
  background-color: var(--viewport-bg);
}

.tab-btn.active {
  background-color: var(--primary-color);
  color: white !important;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .tab-btn.active {
  background-color: var(--primary-color);
  color: white !important;
}

/* ========================================== */
/* READABILITY SUGGESTION UI STYLING */
/* ========================================== */

.apply-suggestion-link {
  color: var(--primary-color);
  font-weight: 700;
  text-decoration: underline;
  margin-left: 0.4rem;
  cursor: pointer;
  transition: color 0.2s;
}

.apply-suggestion-link:hover {
  color: var(--primary-dark);
}

.badge-active {
  background-color: var(--accent-soft);
  color: var(--accent-color);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  border: 1px solid var(--accent-color);
}

/* ========================================== */
/* GUIDED SKIMMER VIEW STYLING */
/* ========================================== */

.skimmer-viewport {
  max-height: 480px;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-lg);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
}

body.dark-theme .skimmer-viewport {
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.6);
}

.skimmer-body {
  line-height: 1.75;
  color: var(--text-color);
  font-size: 1.1rem;
  text-align: left;
}

.skim-paragraph {
  margin-bottom: 1.25rem;
}

.skim-heading {
  font-size: 1.35rem;
  font-weight: 800;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
  font-family: var(--font-sans);
  text-align: left;
}

.skim-topic-highlight {
  background-color: rgba(79, 70, 229, 0.08); /* light indigo tint */
  border-bottom: 2px solid rgba(79, 70, 229, 0.3);
  font-weight: 700;
  color: var(--text-color);
  padding: 0 2px;
}

body.dark-theme .skim-topic-highlight {
  background-color: rgba(129, 140, 248, 0.15);
  border-bottom-color: rgba(129, 140, 248, 0.4);
}

body.sepia-theme .skim-topic-highlight {
  background-color: rgba(217, 119, 6, 0.08);
  border-bottom-color: rgba(217, 119, 6, 0.3);
}

/* Purpose prompting box */
.purpose-prompt-container {
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-md);
  padding: 1.2rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.purpose-prompt-container label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.purpose-input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--card-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-md);
  color: var(--text-color);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.purpose-input-wrapper input:focus {
  border-color: var(--primary-color);
}

.purpose-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.purpose-chip {
  background-color: var(--card-bg);
  border: 1px solid var(--viewport-border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.purpose-chip:hover {
  border-color: var(--primary-color);
  color: var(--text-color);
}

.purpose-chip.active {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white !important;
}

/* Reading mode switcher styling on input view */
.reading-mode-box {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.reading-mode-box label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.mode-toggle-group {
  display: flex;
  background-color: var(--control-bg);
  padding: 0.25rem;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--viewport-border);
}

.mode-toggle-btn {
  background: none;
  border: none;
  padding: 0.6rem 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mode-toggle-btn.active {
  background-color: var(--card-bg);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

/* Hide purpose-prompt-container in focus mode */
body.focus-mode-active .purpose-prompt-container {
  display: none !important;
}

/* ========================================== */
/* COMPREHENSION QUIZ & RESULT PANELS */
/* ========================================== */

.quiz-panel-wrapper {
  padding: 1.5rem;
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-lg);
  margin-top: 1rem;
  text-align: left;
  animation: slideUp 0.3s ease-out;
}

.quiz-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quiz-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.quiz-options-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .quiz-options-list {
    grid-template-columns: 1fr 1fr;
  }
}

.quiz-option-btn {
  background-color: var(--card-bg);
  border: 1px solid var(--viewport-border);
  color: var(--text-color);
  padding: 0.8rem 1rem;
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
  outline: none;
}

.quiz-option-btn:hover {
  border-color: var(--primary-color);
  background-color: var(--control-hover);
}

.quiz-option-btn.correct-choice {
  background-color: #22c55e !important;
  border-color: #22c55e !important;
  color: white !important;
}

.quiz-option-btn.incorrect-choice {
  background-color: #ef4444 !important;
  border-color: #ef4444 !important;
  color: white !important;
}

/* Star rating self-assessment styling */
.star-rating-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.star-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: #fbbf24;
  cursor: pointer;
  outline: none;
  transition: transform 0.15s;
  padding: 0;
}

.star-btn:hover {
  transform: scale(1.15);
}

.star-labels {
  display: flex;
  justify-content: space-between;
  max-width: 250px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Quiz Results & Save Progress Prompts */
.quiz-results-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1rem 0;
}

.quiz-success-badge {
  font-size: 3rem;
  color: #22c55e;
  margin-bottom: 0.75rem;
}

.results-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.results-summary {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Dismissible Progress Prompt */
.email-prompt-card {
  background-color: var(--card-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  max-width: 440px;
  width: 100%;
  margin: 0 auto 1.5rem auto;
  box-shadow: var(--shadow-md);
  text-align: left;
  border-left: 4px solid var(--primary-color);
}

.email-prompt-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.35rem;
}

.email-prompt-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 1rem;
}

.prompt-input-row {
  display: flex;
  gap: 0.5rem;
}

.prompt-input-row input {
  flex-grow: 1;
  padding: 0.55rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--viewport-border);
  background-color: var(--viewport-bg);
  color: var(--text-color);
  font-size: 0.85rem;
  outline: none;
}

.prompt-input-row input:focus {
  border-color: var(--primary-color);
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.75rem;
}

.btn-text-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.btn-text-dismiss:hover {
  color: var(--text-color);
}

/* ========================================== */
/* YOUR PROGRESS DASHBOARD STYLING */
/* ========================================== */

/* Locked Progress View Preview & Form */
.progress-locked-card {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 500px;
  margin: 0 auto;
}

.lock-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--viewport-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin: 0 auto 1.25rem auto;
  border: 1px solid var(--viewport-border);
}

.progress-locked-card h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.5rem;
}

.progress-locked-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.email-gate-form {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto 1.5rem auto;
}

.email-gate-form input {
  flex-grow: 1;
  padding: 0.65rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--viewport-border);
  background-color: var(--viewport-bg);
  color: var(--text-color);
  font-size: 0.9rem;
  outline: none;
}

.email-gate-form input:focus {
  border-color: var(--primary-color);
}

/* Blur representation of dashboard */
.progress-preview-blur {
  opacity: 0.35;
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  border-top: 1px dashed var(--viewport-border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

.preview-stats-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1.25rem;
}

.preview-stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.preview-stat-item span {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.preview-stat-item strong {
  font-size: 1.25rem;
  color: var(--text-color);
  font-weight: 800;
}

.preview-table {
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  border-radius: 6px;
  padding: 0.5rem;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border-bottom: 1px solid var(--viewport-border);
  font-size: 0.8rem;
}

/* Unlocked Progress View */
.progress-unlocked-dashboard {
  text-align: left;
  animation: fadeIn 0.4s ease;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--viewport-border);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 0.25rem;
}

.email-badge {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.email-badge strong {
  color: var(--primary-color);
}

/* Stats Summary Cards Row */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-summary-card {
  background-color: var(--viewport-bg);
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.01);
}

.stat-summary-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  text-align: center;
}

.stat-summary-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-color);
}

/* History table scroll container */
.history-table-container {
  margin-bottom: 1.5rem;
}

.history-table-container h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table-scroll-wrapper {
  overflow-x: auto;
  border: 1px solid var(--viewport-border);
  border-radius: var(--border-radius-md);
  background-color: var(--card-bg);
}

.progress-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.progress-history-table th, 
.progress-history-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--viewport-border);
  white-space: nowrap;
}

.progress-history-table th {
  background-color: var(--viewport-bg);
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.progress-history-table tr:last-child td {
  border-bottom: none;
}

.progress-history-table tbody tr:hover {
  background-color: var(--viewport-bg);
}

/* Actions at the bottom of Dashboard */
.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--viewport-border);
  padding-top: 1rem;
}

@keyframes slideUp {
  0% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}


