/* publications-enhanced.css */

/* Control sections */
.publications-controls {
  margin-bottom: 2rem;
}

.export-options,
.display-options,
.visualization-controls {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

/* Export buttons */
.export-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Display options */
.display-options {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.display-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

/* Enhanced filters */
.datatable-filters {
  background-color: #f5f5f5;
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.filter-row-main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

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

.filter-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.search-group input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.filter-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.filter-group small {
  display: block;
  color: #666;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* Advanced filters */
.advanced-filters {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #ddd;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.advanced-filters .filter-group {
  min-width: 200px;
}

.range-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.range-filter input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Keyword cloud filter */
.keyword-cloud-filter {
  grid-column: 1 / -1; /* Span full width */
  margin-top: 1rem;
}

.keyword-cloud-small {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1rem;
  background-color: white;
  border-radius: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.keyword-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: #e3f2fd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.keyword-tag:hover {
  background-color: #bbdefb;
}

.keyword-tag.active {
  background-color: #0056b3;
  color: white;
  border-color: #004085;
}

/* Stats modal */
#statsModal .modal-content {
  max-width: 500px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-item {
  text-align: center;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: #0056b3;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #666;
}

/* Type badges */
.type-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  white-space: nowrap;
}

.type-buch { background-color: #d4edda; color: #155724; }
.type-zeitschriftenaufsatz { background-color: #d1ecf1; color: #0c5460; }
.type-buchbeitrag { background-color: #fff3cd; color: #856404; }
.type-lexikonartikel { background-color: #f8d7da; color: #721c24; }
.type-rezension { background-color: #e2e3e5; color: #383d41; }
.type-interview { background-color: #d6f4f4; color: #0c5460; }
.type-übersetzung { background-color: #fce4ec; color: #721c24; }
.type-lizentiatsarbeit { background-color: #e8f5e9; color: #2e7d32; }

/* Table enhancements */
#publicationsTable th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.5rem;
}

.sort-indicator {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 0.75rem;
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.items-per-page {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pagination {
  display: flex;
  gap: 0.25rem;
}

.page-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 2.5rem;
}

.page-btn:hover:not(:disabled) {
  background-color: #e9ecef;
}

.page-btn.active {
  background-color: #0056b3;
  color: white;
  border-color: #0056b3;
}

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

.page-ellipsis {
  padding: 0.5rem;
  color: #666;
}

/* Citation modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.citation-format {
  margin: 1rem 0;
}

#citationText {
  width: 100%;
  height: 150px;
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: monospace;
  resize: vertical;
}

/* Info tabs */
.info-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab-button {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  background-color: white;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 4px 4px 0 0;
}

.tab-button.active {
  background-color: #0056b3;
  color: white;
  border-color: #0056b3;
}

.tab-content {
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 0 4px 4px 4px;
}

.quick-links ul {
  list-style: none;
  padding: 0;
}

.quick-links li {
  margin-bottom: 0.5rem;
}

.quick-filter {
  color: #0056b3;
  text-decoration: none;
  cursor: pointer;
}

.quick-filter:hover {
  text-decoration: underline;
}

.numbering-system {
  columns: 2;
  column-gap: 2rem;
}

/* Visualization styles */
#visualizationContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  z-index: 1001;
}

.timeline {
  max-height: 500px;
  overflow-y: auto;
}

.timeline-year {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.timeline-year h4 {
  margin-top: 0;
  color: #0056b3;
}

.timeline-year ul {
  list-style: none;
  padding: 0;
}

.timeline-year li {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: white;
  border-radius: 4px;
}

/* Type chart */
.type-chart {
  margin-top: 1rem;
}

.chart-bar {
  margin-bottom: 1rem;
}

.bar-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.bar-container {
  position: relative;
  height: 30px;
  background-color: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background-color: #0056b3;
  transition: width 0.5s ease;
}

.bar-value {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  font-weight: 500;
  color: #333;
}

/* Compact view */
.compact-view .datatable-table {
  font-size: 0.875rem;
}

.compact-view .datatable-table td,
.compact-view .datatable-table th {
  padding: 0.25rem 0.5rem;
}

.compact-view .publication-details,
.compact-view .editor,
.compact-view .isbn {
  display: none;
}

/* Print styles */
@media print {
  .publications-controls,
  .info-tabs,
  .pagination-wrapper,
  .filter-status,
  #visualizationContainer,
  .modal {
    display: none !important;
  }

  .datatable-filters {
    display: none !important;
  }

  .datatable-table {
    font-size: 0.75rem;
  }

  .datatable-table td,
  .datatable-table th {
    padding: 2px 4px;
  }

  .type-badge {
    padding: 1px 4px;
    font-size: 0.65rem;
  }

  .tag {
    font-size: 0.65rem;
    padding: 1px 3px;
  }

  .bibliography-info {
    page-break-before: always;
  }
}

/* Responsive adjustments */
.visualization-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .filter-row-main {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .numbering-system {
    columns: 1;
  }

  .pagination-wrapper {
    flex-direction: column;
    gap: 1rem;
  }

  #visualizationContainer {
    padding: 1rem;
  }

  .keyword-cloud-small {
    max-height: 150px;
  }
}

@media (max-width: 480px) {
  .export-options {
    flex-direction: column;
  }

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

  .visualization-controls {
    flex-direction: column;
  }
}
