/* Daily Paper Styles */

#arxiv-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.arxiv-header {
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e9ecef;
}

.arxiv-header h2 {
  font-size: 2em;
  color: #1a1a2e;
  margin-bottom: 8px;
}

.arxiv-subtitle {
  color: #666;
  font-size: 1em;
  margin: 0;
}

/* Source Tabs */
.source-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 15px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e0e0e0;
}

.source-tab {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.2s;
  color: #666;
}

.source-tab:first-child {
  border-right: 1px solid #e0e0e0;
}

.source-tab:hover {
  background: #e8e8e8;
}

.source-tab.active {
  background: linear-gradient(135deg, #4a90d9, #357abd);
  color: white;
}

/* Source Panels */
.source-panel {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 15px;
}

.live-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
}

.archive-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.archive-header {
  font-size: 0.9em;
  color: #666;
}

.date-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.date-controls select {
  flex: 1;
  min-width: 200px;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 0.95em;
  background: white;
}

.nav-btn {
  padding: 10px 16px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #555;
  transition: all 0.2s;
}

.nav-btn:hover:not(:disabled) {
  background: #f0f0f0;
  border-color: #4a90d9;
}

.nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.today-btn {
  padding: 10px 20px;
  border: none;
  background: #10b981;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.today-btn:hover {
  background: #059669;
}

/* Controls */
.arxiv-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  padding: 15px 20px;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  margin-bottom: 15px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-group.search-group {
  flex: 1;
  min-width: 200px;
}

.control-group label {
  font-weight: 600;
  color: #333;
  font-size: 0.85em;
}

.control-group select,
.control-group input {
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.control-group select:focus,
.control-group input:focus {
  outline: none;
  border-color: #4a90d9;
}

.fetch-button {
  background: linear-gradient(135deg, #4a90d9, #357abd);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
}

.fetch-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #357abd, #2a5f8f);
  transform: translateY(-1px);
}

.fetch-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Keywords */
.keyword-section {
  background: white;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 1px solid #e9ecef;
}

.keyword-section h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 0.9em;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.keyword-tag {
  background: #f0f0f0;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85em;
  transition: all 0.2s;
  border: 2px solid transparent;
  user-select: none;
}

.keyword-tag:hover {
  background: #4a90d9;
  color: white;
}

.keyword-tag.active {
  background: #4a90d9;
  color: white;
  border-color: #357abd;
}

.clear-btn {
  background: none;
  border: 1px solid #ddd;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.8em;
  color: #666;
}

.clear-btn:hover {
  background: #fee2e2;
  border-color: #dc2626;
  color: #dc2626;
}

/* Stats */
.stats-section {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  border-radius: 10px;
  margin-bottom: 15px;
  font-size: 0.9em;
  align-items: center;
}

.data-source-info {
  margin-left: auto;
  background: rgba(255,255,255,0.7);
  padding: 4px 12px;
  border-radius: 15px;
  font-size: 0.85em;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4a90d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}

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

/* Error */
.error-message {
  background: #fee2e2;
  color: #dc2626;
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 15px;
  border-left: 4px solid #dc2626;
}

/* Init Message */
.init-message {
  text-align: center;
  padding: 50px 20px;
  color: #666;
}

.init-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.init-message p {
  margin: 8px 0;
}

/* Papers */
.papers-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.paper-card {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
}

.paper-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border-color: #4a90d9;
}

.paper-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 10px;
  line-height: 1.4;
}

.paper-title a {
  color: inherit;
  text-decoration: none;
}

.paper-title a:hover {
  color: #4a90d9;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 10px;
  font-size: 0.85em;
  color: #666;
}

.paper-authors {
  color: #555;
  font-size: 0.9em;
  margin-bottom: 10px;
  line-height: 1.5;
}

.paper-abstract {
  color: #444;
  font-size: 0.9em;
  line-height: 1.6;
  max-height: 80px;
  overflow: hidden;
  position: relative;
}

.paper-abstract.expanded {
  max-height: none;
}

.paper-abstract:not(.expanded)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(transparent, white);
}

.expand-btn {
  background: none;
  border: none;
  color: #4a90d9;
  cursor: pointer;
  font-size: 0.85em;
  padding: 5px 0;
  margin-top: 5px;
}

.expand-btn:hover {
  text-decoration: underline;
}

.paper-links {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.paper-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85em;
  text-decoration: none;
  font-weight: 500;
}

.paper-link.arxiv {
  background: #b31b1b;
  color: white;
}

.paper-link.pdf {
  background: #4a90d9;
  color: white;
}

.highlight {
  background: #fff3cd;
  padding: 1px 3px;
  border-radius: 2px;
}

.no-data {
  text-align: center;
  padding: 50px 20px;
  color: #666;
}

.no-data-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

/* Responsive */
@media (max-width: 768px) {
  .source-tabs {
    flex-direction: column;
  }
  .source-tab:first-child {
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }
  .live-controls,
  .arxiv-controls {
    flex-direction: column;
  }
  .control-group,
  .control-group.search-group {
    width: 100%;
  }
  .fetch-button {
    width: 100%;
  }
  .date-controls {
    flex-direction: column;
  }
  .date-controls select,
  .nav-btn,
  .today-btn {
    width: 100%;
  }
  .stats-section {
    flex-direction: column;
    gap: 8px;
  }
  .data-source-info {
    margin-left: 0;
  }
}
