/* Enhanced Features CSS */

/* Theme Toggle */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: var(--accent-bg, #1a1a1a);
  border: 2px solid var(--border-color, #333);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  margin-left: 1rem;
}

.theme-toggle:hover {
  transform: scale(1.05);
}

.theme-toggle-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-icon {
  font-size: 14px;
  transition: opacity 0.3s ease;
}

.theme-toggle[data-theme="dark"] .sun {
  opacity: 0.3;
}

.theme-toggle[data-theme="dark"] .moon {
  opacity: 1;
}

.theme-toggle[data-theme="light"] .sun {
  opacity: 1;
}

.theme-toggle[data-theme="light"] .moon {
  opacity: 0.3;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: var(--accent-color, #00ff88);
  border-radius: 50%;
  transition: transform 0.3s ease;
  transform: translateX(0);
}

.theme-toggle[data-theme="light"]::before {
  transform: translateX(28px);
}

/* Search Container */
.search-container {
  background: var(--secondary-bg, #111111);
  border: 1px solid var(--border-color, #333);
  border-radius: 20px;
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.search-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 1rem 3rem 1rem 1rem;
  color: var(--text-primary, #ffffff);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color, #00ff88);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.1);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--accent-color, #00ff88);
  color: var(--bg-primary, #000);
  border: none;
  border-radius: 8px;
  padding: 0.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-btn:hover {
  background: var(--accent-color, #00ff88);
  transform: translateY(-50%) scale(1.05);
}

.search-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-select {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  color: var(--text-primary, #ffffff);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent-color, #00ff88);
}

.search-results {
  margin-top: 1rem;
}

.search-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color, #333);
}

.clear-search {
  background: var(--accent-bg, #1a1a1a);
  color: var(--text-primary, #ffffff);
  border: 1px solid var(--border-color, #333);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.clear-search:hover {
  background: var(--border-color, #333);
}

.search-results-grid {
  display: grid;
  gap: 1rem;
}

.search-result-card {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.search-result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.search-result-title a {
  color: var(--text-primary, #ffffff);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
}

.search-result-title a:hover {
  color: var(--accent-color, #00ff88);
}

.search-result-meta {
  display: flex;
  gap: 1rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--text-secondary, #a0a0a0);
}

.search-result-snippet {
  color: var(--text-secondary, #a0a0a0);
  line-height: 1.6;
  margin: 1rem 0;
}

.search-result-snippet mark {
  background: var(--accent-color, #00ff88);
  color: var(--bg-primary, #000);
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
}

.search-result-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.search-result-actions .read-more {
  color: var(--accent-color, #00ff88);
  text-decoration: none;
  font-weight: 500;
}

.search-result-actions .read-more:hover {
  text-decoration: underline;
}

.search-history {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #333);
}

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.search-history-header h4 {
  font-size: 0.9rem;
  color: var(--text-secondary, #a0a0a0);
}

.search-history-header button {
  background: none;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  font-size: 0.8rem;
}

.search-history-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.search-history-item {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.search-history-item:hover {
  background: var(--border-color, #333);
  color: var(--text-primary, #ffffff);
}

.search-loading, .search-error, .search-no-results {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #a0a0a0);
}

.search-no-results {
  padding: 3rem;
}

/* Reading Progress */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reading-progress-bar.visible {
  opacity: 1;
}

.reading-progress-bar.active .progress-info {
  opacity: 1;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color, #00ff88) 0%, #667eea 100%);
  transition: width 0.3s ease;
}

.progress-info {
  position: absolute;
  top: 4px;
  right: 1rem;
  background: var(--secondary-bg, #111111);
  border: 1px solid var(--border-color, #333);
  border-radius: 0 0 8px 8px;
  padding: 0.5rem 1rem;
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary, #a0a0a0);
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Bookmarks */
.bookmark-btn {
  transition: all 0.3s ease;
}

.bookmark-btn.bookmarked {
  color: var(--accent-color, #00ff88);
}

.bookmarks-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: var(--secondary-bg, #111111);
  border: 1px solid var(--border-color, #333);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.close-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-btn:hover {
  color: var(--text-primary, #ffffff);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

.bookmark-card {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.bookmark-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.bookmark-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.bookmark-title a {
  color: var(--text-primary, #ffffff);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 600;
}

.bookmark-title a:hover {
  color: var(--accent-color, #00ff88);
}

.remove-bookmark {
  background: none;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  transition: color 0.3s ease;
}

.remove-bookmark:hover {
  color: #ff4444;
}

.bookmark-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary, #a0a0a0);
}

.bookmark-snippet {
  color: var(--text-secondary, #a0a0a0);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.bookmark-actions {
  display: flex;
  justify-content: flex-end;
}

.read-bookmark {
  color: var(--accent-color, #00ff88);
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-color, #00ff88);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.read-bookmark:hover {
  background: var(--accent-color, #00ff88);
  color: var(--bg-primary, #000);
}

.empty-bookmarks {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary, #a0a0a0);
}

/* Random Chat Button */
.random-chat-button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 25px;
  padding: 8px 16px;
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.random-chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-button-wrapper {
  display: flex;
  align-items: center;
  margin-left: 20px;
}

.chat-button-inner {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-icon {
  font-size: 16px;
  animation: bounce 2s infinite;
}

.chat-text {
  font-size: 14px;
  font-weight: 500;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-2px);
  }
}

/* Floating button fallback */
.floating-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.floating-chat-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.floating-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  border-radius: 50px;
  padding: 15px 20px;
}

.chat-button-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-icon {
  font-size: 1.2rem;
}

.chat-text {
  font-size: 0.9rem;
}

/* Random Chat Modal */
.random-chat-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(10px);
}

.chat-modal-content {
  background: var(--card-bg);
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.chat-header {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 2s infinite;
}

.status-indicator.connecting {
  background: #f59e0b;
}

.status-indicator.connected {
  background: #10b981;
}

.status-indicator.offline {
  background: #6b7280;
  animation: none;
}

.status-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.chat-controls {
  display: flex;
  gap: 10px;
}

.new-chat-btn,
.close-chat-btn,
.report-btn,
.history-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
}

.new-chat-btn:hover,
.report-btn:hover,
.history-btn:hover {
  background: var(--accent-bg);
  color: var(--text-primary);
}

.close-chat-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.report-btn:hover {
  background: #f59e0b;
  color: white;
  border-color: #f59e0b;
}

.history-btn:hover {
  background: #8b5cf6;
  color: white;
  border-color: #8b5cf6;
}

/* Chat History Modal */
.chat-history-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(10px);
}

.history-modal-content {
  background: var(--card-bg);
  border-radius: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.history-header {
  padding: 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.history-header button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 5px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.history-header button:hover {
  background: var(--accent-bg);
  color: var(--text-primary);
}

.history-stats {
  padding: 15px 20px;
  display: flex;
  gap: 20px;
  background: var(--accent-bg);
  border-bottom: 1px solid var(--border-color);
}

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

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.history-content h4 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.no-history {
  text-align: center;
  color: var(--text-secondary);
  font-style: italic;
  padding: 40px 20px;
}

.history-item {
  background: var(--accent-bg);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.history-messages {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--border-color);
  padding: 2px 8px;
  border-radius: 10px;
}

.history-preview {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-message {
  font-size: 0.85rem;
  padding: 4px 8px;
  border-radius: 8px;
  max-width: 80%;
}

.preview-message.sent {
  background: rgba(102, 126, 234, 0.2);
  color: var(--text-primary);
  align-self: flex-end;
}

.preview-message.received {
  background: var(--border-color);
  color: var(--text-secondary);
  align-self: flex-start;
}

.history-actions {
  padding: 15px 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.history-actions button {
  background: #ef4444;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.history-actions button:hover {
  background: #dc2626;
}

/* Chat Preferences */
.preferences-section {
  background: var(--accent-bg);
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  text-align: left;
}

.preferences-section h4 {
  margin: 0 0 12px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

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

.preference-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.topic-tag {
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 6px 12px;
  transition: all 0.2s ease;
  user-select: none;
}

.topic-tag:hover {
  background: var(--card-bg);
  transform: translateY(-1px);
}

.topic-tag.selected {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
}

#chatStyle {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 8px 12px;
  width: 100%;
  outline: none;
  transition: all 0.2s ease;
}

#chatStyle:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* AI Chat Offer */
.ai-offer {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.ai-offer-content {
  background: var(--accent-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  max-width: 300px;
}

.ai-offer-content p {
  color: var(--text-primary);
  margin: 0 0 16px 0;
  font-size: 0.9rem;
}

.ai-offer-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.accept-ai-btn,
.decline-ai-btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.accept-ai-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.accept-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.decline-ai-btn {
  background: var(--border-color);
  color: var(--text-secondary);
}

.decline-ai-btn:hover {
  background: var(--card-bg);
  color: var(--text-primary);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.welcome-message {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}

.welcome-content {
  max-width: 300px;
}

.welcome-content h3 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.welcome-content p {
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.chat-rules {
  background: var(--accent-bg);
  border-radius: 12px;
  padding: 16px;
  font-size: 0.85rem;
  text-align: left;
}

.start-chat-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  font-weight: 600;
  padding: 12px 24px;
  margin-top: 16px;
  transition: all 0.3s ease;
}

.start-chat-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.chat-message {
  display: flex;
  margin: 8px 0;
}

.chat-message.sent {
  justify-content: flex-end;
}

.chat-message.received {
  justify-content: flex-start;
}

.message-content {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  position: relative;
}

.chat-message.sent .message-content {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message.received .message-content {
  background: var(--accent-bg);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.message-text {
  word-wrap: break-word;
  line-height: 1.4;
}

.message-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 4px;
}

.system-message {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.system-content {
  background: var(--border-color);
  border-radius: 16px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Typing Indicator */
.typing-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--accent-bg);
  border-radius: 16px;
  margin: 8px 0;
}

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.typing-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Chat Input */
.chat-input-container {
  padding: 20px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

#chatInput {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 25px;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding: 12px 16px;
  outline: none;
  transition: all 0.2s ease;
}

#chatInput:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chatInput:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#sendButton {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

#sendButton:hover:not(:disabled) {
  transform: scale(1.1);
}

#sendButton:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-10px); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .chat-modal-content {
    width: 95%;
    height: 90vh;
    margin: 5vh auto;
  }
  
  .chat-header {
    padding: 15px;
  }
  
  .chat-controls {
    flex-direction: column;
    gap: 8px;
  }
  
  .new-chat-btn,
  .close-chat-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
  
  .floating-chat-button {
    bottom: 15px;
    right: 15px;
    padding: 12px 16px;
  }
  
  .chat-text {
    display: none;
  }
}
.stats-widget {
  background: var(--secondary-bg, #111111);
  border: 1px solid var(--border-color, #333);
  border-radius: 20px;
  margin: 2rem 0;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.stats-widget.collapsed {
  position: fixed;
  top: 20px;
  right: 20px;
  margin: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 4px 20px var(--shadow-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.stats-widget.collapsed .stats-content {
  display: none;
}

.stats-widget.collapsed .stats-header {
  padding: 0;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.stats-widget.collapsed .stats-title {
  display: none;
}

.stats-widget.collapsed .stats-toggle {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.stats-widget.collapsed .collapsed-icon {
  display: block;
  font-size: 1.2rem;
}

.stats-widget.collapsed .expanded-icon {
  display: none;
}

.stats-widget:not(.collapsed) .collapsed-icon {
  display: none;
}

.stats-widget:not(.collapsed) .expanded-icon {
  display: block;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color, #333);
  cursor: pointer;
}

.stats-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.stats-toggle {
  background: none;
  border: none;
  color: var(--text-secondary, #a0a0a0);
  cursor: pointer;
  transition: all 0.3s ease;
}

.stats-toggle svg {
  transition: transform 0.3s ease;
}

.stats-content {
  padding: 2rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color, #00ff88);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary, #a0a0a0);
}

.stats-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.chart-container {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 1.5rem;
}

.chart-container h4 {
  color: var(--text-primary, #ffffff);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.chart-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-bar-label a {
  color: var(--text-primary, #ffffff);
  text-decoration: none;
  font-size: 0.9rem;
}

.stat-bar-label a:hover {
  color: var(--accent-color, #00ff88);
}

.stat-bar-container {
  position: relative;
  background: var(--border-color, #333);
  border-radius: 4px;
  height: 20px;
  display: flex;
  align-items: center;
}

.stat-bar-fill {
  background: linear-gradient(90deg, var(--accent-color, #00ff88) 0%, #667eea 100%);
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.stat-bar-value {
  position: absolute;
  right: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-primary, #ffffff);
  font-weight: 600;
}

.activity-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.activity-bar-container {
  width: 30px;
  height: 60px;
  background: var(--border-color, #333);
  border-radius: 4px;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.activity-bar-fill {
  width: 100%;
  background: linear-gradient(0deg, var(--accent-color, #00ff88) 0%, #667eea 100%);
  border-radius: 4px;
  transition: height 0.3s ease;
}

.activity-bar-label {
  text-align: center;
  font-size: 0.8rem;
}

.day-name {
  color: var(--text-secondary, #a0a0a0);
  display: block;
}

.day-count {
  color: var(--text-primary, #ffffff);
  font-weight: 600;
}

/* Print Modal */
.print-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.print-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.print-option {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--text-primary, #ffffff);
}

.print-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--accent-color, #00ff88);
}

.print-option span {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.print-option small {
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.9rem;
}

/* Related Posts */
.related-posts-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color, #333);
}

.related-posts-header {
  margin-bottom: 2rem;
}

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

.related-post-card {
  background: var(--accent-bg, #1a1a1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  gap: 1rem;
}

.related-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.related-post-emoji {
  font-size: 2rem;
  flex-shrink: 0;
}

.related-post-content {
  flex: 1;
}

.related-post-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary, #a0a0a0);
}

.related-post-category {
  background: var(--border-color, #333);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

.related-post-title {
  margin-bottom: 0.5rem;
}

.related-post-title a {
  color: var(--text-primary, #ffffff);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.related-post-title a:hover {
  color: var(--accent-color, #00ff88);
}

.related-post-snippet {
  color: var(--text-secondary, #a0a0a0);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1rem;
}

.related-post-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.related-post-stats .likes {
  color: var(--text-secondary, #a0a0a0);
}

.related-post-stats .read-more {
  color: var(--accent-color, #00ff88);
  text-decoration: none;
  font-weight: 500;
}

.related-post-stats .read-more:hover {
  text-decoration: underline;
}

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--secondary-bg, #111111);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  color: var(--text-primary, #ffffff);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  min-width: 200px;
}

.toast.show {
  transform: translateX(0);
}

.toast-success {
  border-left: 4px solid #10b981;
}

.toast-error {
  border-left: 4px solid #ef4444;
}

.toast-info {
  border-left: 4px solid #3b82f6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-filters {
    flex-direction: column;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .stats-charts {
    grid-template-columns: 1fr;
  }
  
  .activity-bar-container {
    height: 40px;
    width: 20px;
  }
  
  .bookmarks-modal {
    padding: 1rem;
  }
  
  .modal-content {
    max-height: 90vh;
  }
  
  .modal-header,
  .modal-body {
    padding: 1rem;
  }
  
  .theme-toggle {
    width: 50px;
    height: 25px;
  }
  
  .theme-toggle::before {
    width: 18px;
    height: 18px;
  }
  
  .theme-toggle[data-theme="light"]::before {
    transform: translateX(23px);
  }
  
  .print-options {
    grid-template-columns: 1fr;
  }
  
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
  
  .related-post-card {
    flex-direction: column;
    text-align: center;
  }
  
  .related-post-emoji {
    align-self: center;
  }
}
