:root {
  --color-primary: #000000;
  --color-primary-hover: #333333;
  --color-primary-light: #f5f5f5;
  --color-primary-border: #d0d0d0;
  --color-text: #000000;
  --color-text-secondary: #666666;
  --color-text-tertiary: #999999;
  --color-background: #ffffff;
  --color-background-alt: #fafafa;
  --color-border: #e0e0e0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 4px 10px rgba(0, 0, 0, 0.18);
  --shadow-hover-card: 0 6px 16px rgba(0, 0, 0, 0.2);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  min-height: 100vh;
  padding: 40px 0px;
  color: #000000;
  line-height: 1.6;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 16px;
  color: #666666;
  margin-bottom: 40px;
  font-weight: 400;
}

.section {
  margin-bottom: 32px;
  padding-bottom: 32px;
}

.section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

button {
  background: var(--color-primary);
  color: #ffffff;
  border: 1px solid var(--color-primary);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

button:disabled {
  background: #f5f5f5;
  color: #999999;
  border-color: #e0e0e0;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: 'Loading...';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
}

button.loading.generating::after {
  content: 'Generating...';
}

button.loading.saving::after {
  content: 'Saving...';
}

button.loading.adding::after {
  content: 'Adding...';
}

button.loading.updating::after {
  content: 'Updating...';
}

button.loading.deleting::after {
  content: 'Deleting...';
}

button.loading.signing-in::after {
  content: 'Signing in...';
}

button:disabled.loading::after {
  color: #999999;
}

.status {
  padding: 12px 16px;
  margin-top: 16px;
  font-size: 14px;
  border-left: 3px solid var(--color-primary);
  background: #f5f5f5;
}

.status.success {
  border-left-color: var(--color-primary);
  background: var(--color-primary-light);
}

.status.error {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.status.info {
  border-left-color: var(--color-text-secondary);
  background: var(--color-primary-light);
}

.button-link {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  color: inherit;
}

.button-link:hover {
  opacity: 0.75;
}

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

.status-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #bbb;
  border-top-color: #444;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
  vertical-align: text-bottom;
  flex-shrink: 0;
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d0d0;
  font-size: 14px;
  margin-bottom: 12px;
  font-family: inherit;
  background: #ffffff;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group {
  margin-bottom: 16px;
}

/* Time and Timezone row layout */
.time-timezone-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.time-field {
  flex: 1;
}

.timezone-field {
  flex: 3;
}

@media (max-width: 480px) {
  .time-timezone-row {
    gap: 0;
  }

  .time-field {
    flex: 0 0 140px;
    max-width: 140px;
  }

  .timezone-field {
    flex: 1 1 100%;
  }
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.summary-card {
  padding: 24px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #e0e0e0;
}

.summary-card:last-child {
  border-bottom: none;
}

.summary-meta {
  margin-bottom: 16px;
}

.summary-meta-topic {
  font-size: 24px;
  font-weight: 600;
  color: #666666;
  letter-spacing: -0.4px;
}

.summary-meta-details {
  font-size: 13px;
  color: #666666;
  margin-top: 4px;
}

.summary-date-meta {
  font-size: 14px;
  color: #666666;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
  font-weight: 500;
}

.summary-content {
  line-height: 1.7;
}

.news-item {
  padding: 20px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item-title {
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.news-item-summary {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 8px;
  color: #333333;
}

.news-item-link {
  color: var(--color-primary);
  text-decoration: underline;
  font-size: 13px;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.news-item-link:hover {
  text-decoration-thickness: 2px;
  color: var(--color-primary-hover);
}

.news-item-date {
  font-size: 12px;
  color: #999999;
  margin-bottom: 8px;
}

.overview {
  font-size: 15px;
  line-height: 1.7;
  padding: 16px 0;
  margin-bottom: 24px;
  border-left: 3px solid var(--color-primary);
  padding-left: 16px;
  font-weight: 500;
}

.source-link {
  color: var(--color-primary);
  text-decoration: underline;
  font-size: 13px;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.source-link:hover {
  text-decoration-thickness: 2px;
  color: var(--color-primary-hover);
}

pre {
  background: #f5f5f5;
  padding: 16px;
  overflow-x: auto;
  font-size: 12px;
  border: 1px solid #e0e0e0;
  line-height: 1.5;
}

/* Topic Selection Cards */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .topics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

.topic-card {
  position: relative;
  background: #ffffff;
  border: none;
  padding: 14px;
  transition: all 0.2s ease;
  min-height: 60px;
  cursor: pointer;
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}

.topic-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.topic-card:hover .topic-card-icon-btn {
  opacity: 1;
  color: #000000;
}

.topic-card:hover .topic-card-icon-btn.delete {
  color: rgba(220, 53, 69, 0.9);
}

.topic-card.selected {
  background: var(--color-primary-light);
  box-shadow: var(--shadow-md);
}

.topic-card.selected:hover {
  box-shadow: var(--shadow-hover-card);
  transform: translateY(-2px);
}

.topic-card input[type="checkbox"] {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

.topic-card-name {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 2px;
  padding-right: 70px;
  line-height: 1.4;
  color: #000000;
}

.topic-card-actions {
  position: absolute;
  top: 14px;
  right: 40px;
  display: flex;
  gap: 4px;
}

.topic-card-icon-btn {
  background: transparent;
  border: none;
  color: #666666;
  padding: 2px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  border-radius: 2px;
}

.topic-card-icon-btn:hover {
  color: #000000;
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

.topic-card-icon-btn.delete:hover {
  color: rgba(220, 53, 69, 0.9);
  background: rgba(220, 53, 69, 0.08);
}

/* Mobile adjustments for topic cards */
@media (max-width: 768px) {
  .topic-card {
    padding: 12px;
    min-height: 58px;
  }

  .topic-card-name {
    font-size: 13px;
    padding-right: 68px;
    margin-bottom: 2px;
  }

  .topic-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    top: 12px;
    right: 12px;
  }

  .topic-card-actions {
    top: 12px;
    right: 37px;
    gap: 4px;
  }

  .topic-card-icon-btn {
    width: 24px;
    height: 24px;
    font-size: 16px;
    padding: 2px;
  }
}

.topics-empty {
  text-align: left;
  padding: 40px 20px;
  color: #999999;
  font-size: 14px;
}

.select-all-btn {
  font-size: 13px;
  padding: 8px 16px;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  color: #000000;
}

.select-all-btn:hover {
  background: #f5f5f5;
  border-color: #000000;
}

.select-all-btn[style*="background: #dc3545"] {
  background: var(--color-primary) !important;
  color: #ffffff;
  border-color: var(--color-primary);
}

.select-all-btn[style*="background: #dc3545"]:hover {
  background: var(--color-primary-hover) !important;
  border-color: var(--color-primary-hover);
}

/* Step indicator */
.step-indicator {
  font-size: 13px;
  color: #999999;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* Hide sections when not authenticated */
.section.hidden {
  display: none;
}

/* Add topic form */
.add-topic-form {
  display: none;
  padding: 20px;
  border: 1px solid #d0d0d0;
  margin-bottom: 20px;
  background: #fafafa;
}

.add-topic-form.show {
  display: block;
}

/* Predefined topics browser */
.predefined-topics-browser {
  display: none;
  padding: 20px;
  border: 1px solid #d0d0d0;
  margin-bottom: 20px;
  background: #fafafa;
  max-height: 500px;
  overflow-y: auto;
}

.predefined-topics-browser.show {
  display: block;
}

.predefined-category {
  margin-bottom: 24px;
}

.predefined-category:last-child {
  margin-bottom: 0;
}

.predefined-category-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 12px;
  color: #333333;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.predefined-topics-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.predefined-topic-btn {
  background: #ffffff;
  color: #000000;
  border: 1px solid #d0d0d0;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.predefined-topic-btn:hover {
  background: #f5f5f5;
  border-color: var(--color-primary);
}

.predefined-topic-btn:disabled {
  background: #f5f5f5;
  color: #999999;
  border-color: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.6;
}

.predefined-topic-btn:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
  background: #f5f5f5;
  border-color: #e0e0e0;
}

/* Action bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Danger button style */
.btn-danger {
  background: #ffffff;
  color: rgba(220, 53, 69, 0.9);
  border: 1px solid rgba(220, 53, 69, 0.4);
  font-size: 13px;
  padding: 8px 16px;
}

.btn-danger:hover {
  background: rgba(220, 53, 69, 0.05);
  border-color: rgba(220, 53, 69, 0.6);
  color: rgba(220, 53, 69, 1);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header-title {
  flex: 1;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: #666666;
}

/* Hero section */
.hero {
  text-align: center;
  padding: 40px 20px;
  margin-bottom: 60px;
}

.hero-logo {
  font-size: 120px;
  font-weight: 700;
  color: #c0c0c0;
  margin-bottom: 24px;
  letter-spacing: -3px;
  line-height: 1;
}

.hero h1 {
  font-size: 48px;
  font-weight: 400;
  margin-bottom: 16px;
  letter-spacing: -1px;
  color: #222222;
}

.intro-text {
  font-size: 16px;
  line-height: 1.8;
  color: #333333;
  margin-bottom: 32px;
  padding: 20px;
  background: #fafafa;
  border-left: 3px solid #e0e0e0;
}

.hero-subtitle {
  font-size: 20px;
  color: #666666;
  margin-bottom: 40px;
  font-weight: 400;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px 48px;
  margin: 48px auto;
  max-width: 600px;
  text-align: center;
}

@media (max-width: 600px) {
  .hero-features {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

.hero-feature {
  font-size: 15px;
  color: #333333;
  line-height: 1.5;
}

.hero-feature::before {
  content: '✓ ';
  font-weight: 600;
  margin-right: 8px;
  color: var(--color-primary);
}

.cta-button {
  background: var(--color-primary);
  color: #ffffff;
  border: 1px solid var(--color-primary);
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  text-decoration: none;
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Demo summary */
.demo-summary {
  margin-top: 60px;
  padding-top: 60px;
  border-top: 1px solid #f0f0f0;
}

.scroll-indicator {
  text-align: center;
  margin-top: 60px;
  font-size: 24px;
  color: #d0d0d0;
  animation: bounce 2s ease-out 1;
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-10px);
  }

  60% {
    transform: translateY(-5px);
  }
}

.demo-label {
  font-size: 24px;
  color: #999999;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 32px;
  text-align: center;
}

/* Auth status box */
.auth-status-box {
  padding: 16px;
  border: 1px solid #d0d0d0;
  margin-bottom: 32px;
  background: #fafafa;
}

.auth-status-box strong {
  font-weight: 600;
}

/* Loading indicator */
.loading-indicator {
  display: inline-block;
  font-size: 13px;
  color: #666666;
}

/* Calendar Grid View - Compact */
.calendar-container {
  margin-bottom: 24px;
  position: relative;
}

.date-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.date-selector button {
  padding: 6px 12px;
  font-size: 13px;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  color: #000000;
  cursor: pointer;
  transition: all 0.15s ease;
}

.date-selector button:hover {
  background: #f5f5f5;
  border-color: var(--color-primary);
}

.date-selector button:disabled {
  background: #f5f5f5;
  color: #cccccc;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

.date-display {
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  flex: 1;
  text-align: center;
  cursor: pointer;
  padding: 6px 12px;
  transition: color 0.15s ease;
}

.date-display:hover {
  color: #666666;
}

.date-display.is-today {
  color: #999999;
  cursor: default;
}

.date-display.is-today:hover {
  color: #999999;
}

.calendar-toggle-btn {
  padding: 6px 12px;
  font-size: 13px;
  background: transparent;
  border: 1px solid #d0d0d0;
  color: #666666;
  cursor: pointer;
  transition: all 0.15s ease;
}

.calendar-toggle-btn:hover {
  background: #f5f5f5;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.calendar-view {
  display: none;
  width: 300px;
  margin-top: 8px;
  padding: 18px;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.calendar-view.show {
  display: block;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.calendar-header button {
  padding: 6px 10px;
  font-size: 12px;
  background: transparent;
  border: none;
  color: #000000;
  cursor: pointer;
}

.calendar-header button:hover {
  color: #666666;
}

.calendar-header button:disabled {
  color: #cccccc;
  cursor: not-allowed;
}

.calendar-month-label {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  cursor: pointer;
  padding: 6px 10px;
  transition: color 0.15s ease;
}

.calendar-month-label:hover {
  color: #666666;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #f5f5f5;
  padding: 2px;
}

.calendar-weekday {
  text-align: center;
  font-size: 11px;
  color: #999999;
  font-weight: 500;
  padding: 6px 0;
  text-transform: uppercase;
  background: #ffffff;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: none;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  opacity: 0.3;
}

.calendar-day:hover {
  background: #fafafa;
  opacity: 1;
}

.calendar-day.disabled {
  color: #cccccc;
  cursor: not-allowed;
  opacity: 0.2;
}

.calendar-day.disabled:hover {
  background: #ffffff;
  opacity: 0.2;
}

.calendar-day.has-summaries {
  opacity: 1;
  font-weight: 500;
  background: var(--color-primary-light);
  color: var(--color-primary-hover);
}

.calendar-day.today {
  background: #f5f5f5;
  font-weight: 600;
  opacity: 1;
}

.calendar-day.today::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--color-primary);
}

.calendar-day.selected {
  background: var(--color-primary);
  color: #ffffff;
  font-weight: 600;
  opacity: 1;
}

.calendar-day.selected.today::before {
  border-color: #ffffff;
}

/* Full page loading screen */
.page-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.page-loading-content {
  text-align: center;
}

.page-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.page-loading-text {
  font-size: 14px;
  color: #666666;
}

/* Chip/Tag UI */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 40px;
  padding: 0;
}

/* White background for chips in topic form */
.add-topic-form .chip {
  background: #ffffff;
}

.chip-container:empty::before {
  content: 'No items selected';
  color: #999999;
  font-size: 13px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--color-primary-light);
  border: none;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  border-radius: 2px;
  min-width: unset;
}

.chip:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.chip-remove {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #666666;
  padding: 2px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 2px;
  opacity: 0.6;
}

.chip:hover .chip-remove {
  opacity: 1;
  transform: translateY(-50%);
}

.chip-remove:hover {
  color: rgba(220, 53, 69, 0.9);
  background: rgba(220, 53, 69, 0.08);
  transform: translateY(-50%);
}

/* Mobile adjustments for chips */
@media (max-width: 768px) {
  .chip-container {
    gap: 6px;
  }

  .chip {
    padding: 7px 28px 7px 10px;
    font-size: 12px;
  }

  .chip-remove {
    width: 16px;
    height: 16px;
    font-size: 13px;
    right: 6px;
  }
}

.add-item-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.add-item-row select {
  flex: 1;
  margin-bottom: 0;
}

.add-item-row button {
  margin: 0;
  white-space: nowrap;
  padding: 10px 20px;
}

/* Footer */
.footer {
  margin-top: 80px;
  padding-top: 40px;
  border-top: 1px solid #e0e0e0;
  text-align: center;
  font-size: 13px;
  color: #666666;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: #666666;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.footer-copyright {
  color: #999999;
  font-size: 12px;
}
