/* Papers Page Styles - Enhanced */

.papers-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* Sidebar */
.papers-sidebar {
  position: sticky;
  top: 24px;
  height: fit-content;
}

.sidebar-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #4b5563;
}

.filter-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #2563eb;
}

.filter-item span:first-of-type {
  flex: 1;
}

.filter-count {
  font-size: 12px;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 10px;
}

.filter-toggle {
  background: #f0f9ff;
  padding: 10px 12px;
  border-radius: 8px;
  margin: -4px;
}

.sidebar-info {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.sidebar-info p {
  font-size: 13px;
  color: #4b5563;
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.sidebar-info .update-info {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

.data-note {
  font-size: 11px !important;
  color: #6b7280 !important;
  margin-top: 8px !important;
  padding-top: 8px;
  border-top: 1px dashed #bae6fd;
}

/* Main Area */
.papers-main {
  min-width: 0;
}

.papers-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.papers-title h1 {
  font-size: 24px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.papers-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

.papers-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.showing-text {
  font-size: 14px;
  color: #6b7280;
}

.sort-select {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
}

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

.loading {
  text-align: center;
  padding: 60px;
  color: #6b7280;
  font-size: 16px;
}

.paper-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

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

.paper-card.no-abstract {
  background: #fafafa;
}

.paper-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.paper-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.paper-title a {
  color: #1f2937;
  text-decoration: none;
}

.paper-title a:hover {
  color: #2563eb;
}

.paper-year {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
}

.paper-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paper-meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.paper-venue {
  color: #4b5563 !important;
  font-weight: 500;
}

.paper-citations {
  color: #059669 !important;
  font-weight: 500;
}

.paper-abstract {
  font-size: 14px;
  line-height: 1.7;
  color: #4b5563;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.paper-abstract.expanded {
  -webkit-line-clamp: unset;
}

.paper-no-abstract {
  font-size: 13px;
  color: #9ca3af;
  font-style: italic;
  margin: 0 0 12px 0;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
}

.paper-expand-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
}

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

.paper-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.paper-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.paper-category {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f3f4f6;
  color: #4b5563;
}

.paper-category.cat-material { background: #fef3c7; color: #92400e; }
.paper-category.cat-structure { background: #fee2e2; color: #991b1b; }
.paper-category.cat-design { background: #e0e7ff; color: #3730a3; }
.paper-category.cat-equipment { background: #d1fae5; color: #065f46; }
.paper-category.cat-sustainability { background: #cffafe; color: #0e7490; }
.paper-category.cat-economics { background: #fce7f3; color: #9d174d; }
.paper-category.cat-education { background: #ede9fe; color: #5b21b6; }
.paper-category.cat-review { background: #f3f4f6; color: #374151; }

.paper-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.paper-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  background: #f3f4f6;
  transition: background 0.2s;
}

.paper-link:hover {
  background: #e5e7eb;
}

.paper-link.pdf-link {
  background: #fef2f2;
  color: #dc2626;
}

.paper-link.pdf-link:hover {
  background: #fee2e2;
}

.paper-link.arxiv-link {
  background: #fef3c7;
  color: #b45309;
}

.paper-primary-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  background: #2563eb;
  transition: background 0.2s;
}

.paper-primary-link:hover {
  background: #1d4ed8;
}

.paper-primary-link svg {
  width: 14px;
  height: 14px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
  padding: 16px 0;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.page-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-ellipsis {
  color: #9ca3af;
  padding: 0 4px;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 60px 24px;
  color: #6b7280;
}

.no-results h3 {
  font-size: 18px;
  color: #374151;
  margin: 16px 0 8px;
}

.no-results p {
  margin: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .papers-container {
    grid-template-columns: 1fr;
  }
  
  .papers-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }
  
  .sidebar-section {
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .papers-container {
    padding: 16px;
  }
  
  .papers-sidebar {
    grid-template-columns: 1fr;
  }
  
  .papers-header {
    flex-direction: column;
  }
  
  .paper-card {
    padding: 16px;
  }
  
  .paper-header {
    flex-direction: column;
    gap: 8px;
  }
  
  .paper-footer {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .paper-links {
    width: 100%;
    justify-content: flex-end;
  }
}
