/**
 * CEPHAS READING TRACKER STYLES
 * Matches PaperMod theme aesthetic
 */

/* ============================================
   READING HISTORY DROPDOWN
   ============================================ */
.reading-history-container {
  position: fixed;
  top: 60px;
  right: 20px;
  z-index: 1000;
  font-family: inherit;
}

.reading-history-widget {
  background: var(--theme, #1d1e20);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 280px;
  max-width: 400px;
}

.reading-history-toggle {
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--primary, #ff6b6b);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}

.reading-history-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.toggle-icon {
  font-size: 10px;
  transition: transform 0.2s;
}

.reading-history-panel {
  border-top: 1px solid var(--border, #333);
  max-height: 400px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.reading-history-header {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--secondary, #888);
}

.sync-badge {
  color: #4ade80;
  font-size: 11px;
}

.sync-link {
  color: var(--primary, #ff6b6b);
  text-decoration: none;
  font-size: 11px;
}

.sync-link:hover {
  text-decoration: underline;
}

.reading-history-list {
  overflow-y: auto;
  max-height: 300px;
  padding: 8px 0;
}

.history-item {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.history-title {
  display: block;
  font-size: 14px;
  color: var(--content, #eee);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: block;
  font-size: 11px;
  color: var(--secondary, #888);
}

.empty-state {
  padding: 20px 16px;
  text-align: center;
  color: var(--secondary, #888);
  font-size: 13px;
}

.clear-history-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border, #333);
  color: var(--secondary, #888);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-history-btn:hover {
  background: rgba(255, 0, 0, 0.1);
  color: #ff6b6b;
}

/* ============================================
   RELATED READING SECTION
   ============================================ */
.related-reading-section {
  margin-top: 60px;
  padding-top: 40px;
}

.related-divider {
  border: none;
  border-top: 1px solid var(--border, #333);
  margin-bottom: 30px;
}

.related-heading {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--primary, #ff6b6b);
}

.related-subtitle {
  color: var(--secondary, #888);
  margin-bottom: 24px;
  font-size: 14px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--code-bg, #1a1a1a);
  border: 1px solid var(--border, #333);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.related-card:hover {
  border-color: var(--primary, #ff6b6b);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.related-category {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary, #ff6b6b);
  margin-bottom: 8px;
}

.related-title {
  font-size: 15px;
  color: var(--content, #eee);
  line-height: 1.4;
  margin-bottom: 8px;
}

.related-tags {
  font-size: 11px;
  color: var(--secondary, #888);
  margin-top: auto;
}

.related-note {
  font-size: 12px;
  color: var(--secondary, #888);
  text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .reading-history-container {
    top: auto;
    bottom: 20px;
    right: 20px;
    left: 20px;
  }

  .reading-history-widget {
    max-width: none;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   LIGHT MODE OVERRIDES
   ============================================ */
@media (prefers-color-scheme: light) {
  .reading-history-widget {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }

  .history-title {
    color: #1a1a1a;
  }

  .related-card {
    background: #f5f5f5;
    border-color: #ddd;
  }

  .related-title {
    color: #1a1a1a;
  }
}

