/* =========================================
    RESET & BASE
    ========================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  background-color: #ffffff;
  color: #111111;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 16px;
  /* Base size */
  line-height: 1.5;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Accessibility Focus Styles */
button:focus,
a:focus {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.font-ui {
  font-family: Helvetica, Arial, sans-serif;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* =========================================
    NAVBAR
    ========================================= */
.navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid #f0f0f0;
  padding: 0 10px;
  /* Reduced padding for small screens */
  z-index: 100;
}

.navbar__brand {
  float: left;
  line-height: 60px;
  font-weight: bold;
  font-size: 20px;
  color: #111111;
  text-decoration: none;
  letter-spacing: -0.5px;
  padding: 0 10px;
}

.navbar__actions {
  float: right;
  height: 60px;
  padding-top: 8px;
}

.navbar__btn {
  display: inline-block;
  vertical-align: middle;
  width: 44px;
  /* Minimum touch target */
  height: 44px;
  line-height: 44px;
  text-align: center;
  color: #555555;
  border-radius: 8px;
  margin-left: 4px;
  position: relative;
}

.navbar__btn:active,
.navbar__btn:hover {
  background-color: #f5f5f5;
  color: #000000;
}

.navbar__btn svg {
  vertical-align: middle;
  display: inline-block;
}

/* =========================================
    THEME DROPDOWN
    ========================================= */
.theme-dropdown {
  display: none;
  position: absolute;
  top: 60px;
  right: 10px;
  width: 150px;
  background-color: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1001;
  padding: 4px 0;
}

.theme-dropdown.is-open {
  display: block;
}

.theme-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  color: #333333;
  text-align: left;
  position: relative;
}

.theme-option:hover {
  background-color: #f9f9f9;
}

.theme-option.is-selected {
  font-weight: bold;
  color: #000000;
  background-color: #f0f0f0;
}

.check-icon {
  display: none;
  position: absolute;
  right: 12px;
  top: 12px;
}

.theme-option.is-selected .check-icon {
  display: block;
}

/* =========================================
    MAIN LAYOUT
    ========================================= */
.page-wrapper {
  display: table;
  width: 100%;
  height: 100%;
  padding-top: 60px;
}

.page-cell {
  display: table-cell;
  vertical-align: middle;
  padding: 20px;
}

.main-container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

/* =========================================
    QUOTE SECTION
    ========================================= */
.quote-section {
  margin-bottom: 40px;
  padding-left: 24px;
  position: relative;
}

.quote-border {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 5px;
  background-color: #000000;
  border-radius: 2px;
}

.quote-text {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 20px;
  font-style: italic;
  color: #111111;
  transition: opacity 0.3s;
}

.quote-author {
  font-size: 18px;
  color: #555555;
  margin-top: 20px;
  text-align: right;
}

.quote-author:empty {
  display: none;
}

.quote-author::before {
  content: "";
  display: inline-block;
  width: 30px;
  height: 1px;
  background-color: #000000;
  vertical-align: middle;
  margin-right: 10px;
  opacity: 0.3;
}

/* =========================================
    EXPAND BUTTON
    ========================================= */
.expand-divider {
  position: relative;
  padding: 30px 0;
  text-align: center;
}

.divider-line {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  border-top: 1px dashed #dddddd;
  z-index: 0;
}

.expand-btn {
  position: relative;
  z-index: 1;
  background-color: #ffffff;
  padding: 0 16px;
  color: #999999;
  height: 36px;
  line-height: 36px;
  border: 1px solid transparent;
}

.expand-btn:hover {
  color: #555555;
}

.expand-btn__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  vertical-align: middle;
  font-weight: bold;
}

.expand-btn svg {
  vertical-align: middle;
  margin-left: 6px;
  margin-top: -2px;
}

/* =========================================
    CONTENT BLOCKS
    ========================================= */
.expandable-content {
  display: none;
  padding-top: 10px;
  animation: fadeIn 0.4s ease;
}

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

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

.expandable-content.is-expanded {
  display: block;
}

.section-header {
  margin-bottom: 16px;
  color: #495057;
  display: flex;
  align-items: center;
  padding-bottom: 0;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  margin-left: 10px;
}

.analysis-text {
  font-size: 20px;
  line-height: 1.6;
  color: #212529;
}

.action-item {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.6;
  color: #212529;
}

.actions-list {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 0;
  list-style-type: disc;
}

.actions-list li::marker {
  color: #adb5bd;
  /* Subtler bullet color */
}

.action-icon {
  /* Deprecated but kept to prevent breakage if cached js loads */
  display: none;
}

/* =========================================
    NOTIFICATIONS / LOADING
    ========================================= */
.status-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 2000;
  font-family: Helvetica, Arial, sans-serif;
}

.status-message.visible {
  opacity: 1;
}

/* =========================================
    RESPONSIVE TYPOGRAPHY
    ========================================= */
@media screen and (min-width: 600px) {
  .quote-text {
    font-size: 32px;
  }

  .quote-author {
    font-size: 20px;
  }

  .navbar {
    height: 70px;
    padding: 0 20px;
  }

  .navbar__brand {
    line-height: 70px;
    font-size: 24px;
  }

  .navbar__actions {
    height: 70px;
    padding-top: 13px;
  }

  .page-wrapper {
    padding-top: 70px;
  }
}

/* =========================================
    DARK MODE OVERRIDES
    ========================================= */
body.dark-mode {
  background-color: #121212 !important;
  color: #f0f0f0 !important;
}

body.dark-mode .navbar {
  background-color: #121212 !important;
  border-bottom-color: #333333 !important;
}

body.dark-mode .navbar__brand {
  color: #f0f0f0 !important;
}

body.dark-mode .navbar__btn {
  color: #aaaaaa !important;
}

body.dark-mode .navbar__btn:hover {
  background-color: #333333 !important;
  color: #ffffff !important;
}

body.dark-mode button:focus,
body.dark-mode a:focus {
  outline-color: #ffffff;
}

body.dark-mode .theme-dropdown {
  background-color: #1e1e1e !important;
  border-color: #333333 !important;
}

body.dark-mode .theme-option {
  background-color: #1e1e1e !important;
  color: #cccccc !important;
}

body.dark-mode .theme-option:hover {
  background-color: #333333 !important;
}

body.dark-mode .theme-option.is-selected {
  background-color: #333333 !important;
  color: #ffffff !important;
}

body.dark-mode .quote-text {
  color: #ffffff !important;
}

body.dark-mode .quote-author {
  color: #999999 !important;
}

body.dark-mode .quote-author::before {
  background-color: #ffffff !important;
}

body.dark-mode .quote-border {
  background-color: #ffffff !important;
}

body.dark-mode .divider-line {
  border-top-color: #444444 !important;
}

body.dark-mode .expand-btn {
  background-color: #121212 !important;
  color: #888888 !important;
}

body.dark-mode .expand-btn:hover {
  color: #cccccc !important;
}

body.dark-mode .section-block {
  background-color: transparent !important;
  border-color: transparent !important;
}

body.dark-mode .section-header {
  color: #adb5bd !important;
  border-bottom: none !important;
}

body.dark-mode .analysis-text,
body.dark-mode .action-item {
  color: #e0e0e0 !important;
}

body.dark-mode .action-icon {
  stroke: #ffffff !important;
}

/* High Contrast for E-readers (Optional override class) */
body.e-ink-mode .quote-text {
  color: #000000 !important;
  font-weight: 900 !important;
}

body.e-ink-mode .navbar {
  border-bottom: 2px solid #000 !important;
}