/* Academic Portfolio - Custom Styles */
/* Complements Tailwind CDN - dark navy + white theme */

:root {
  --navy-900: #0c1a2e;
  --navy-800: #122240;
  --navy-700: #1a3058;
  --navy-600: #234170;
  --navy-500: #2c5288;
  --navy-400: #3a6ba8;
  --navy-300: #5a8cc8;
  --navy-200: #8ab4e0;
  --navy-100: #c0d8f0;
  --navy-50: #e8f0f8;
  --accent: #d4a843;
  --accent-light: #e8c870;
}

/* Base */
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: #1a1a2e;
  background-color: #fafbfc;
}

/* Navigation */
.nav-link {
  position: relative;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #c0d8f0;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; }
.nav-link.active {
  color: #fff;
  font-weight: 600;
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Mobile nav */
.mobile-nav { display: none; }
.mobile-nav.open { display: block; }



/* Cite dropdown */
.cite-menu { flex-direction: column; }
.cite-menu:not(.hidden) { display: flex; }
.cite-menu-item {
  display: block;
  width: 100%;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  text-align: left;
  color: #374151;
  background: none;
  border: none;
  cursor: pointer;
}
.cite-menu-item:hover { background: #f3f4f6; }
.cite-menu-item:first-child { border-radius: 0.375rem 0.375rem 0 0; }
.cite-menu-item:last-child { border-radius: 0 0 0.375rem 0.375rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
}
.badge-journal { background: var(--navy-50); color: var(--navy-700); }
.badge-year { background: #f0fdf4; color: #166534; }
.badge-tag { background: #fef3c7; color: #92400e; }
.badge-rr { background: #fef3c7; color: #92400e; }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-wp { background: #f3f4f6; color: #4b5563; }

/* Abstract / Details toggle */
.abstract-content, .details-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}
.abstract-content.open, .details-content.open {
  max-height: 5000px;
  transition: max-height 0.5s ease-in;
}

/* Awards badge */
.badge-award {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  font-weight: 600;
}

/* Open access badge */
.badge-oa {
  background: #d1fae5;
  color: #065f46;
  font-weight: 600;
}

/* Notes block */
.pub-notes {
  font-size: 0.8125rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.5rem;
}

/* Details section within card */
.pub-details-section {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  color: #4b5563;
}
.pub-details-section dt {
  font-weight: 600;
  color: #374151;
  margin-top: 0.5rem;
}
.pub-details-section dt:first-child { margin-top: 0; }
.pub-details-section dd {
  margin-left: 0;
  margin-top: 0.125rem;
}

/* Category header */
.category-header {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy-800);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--navy-100);
}
.category-header:first-child { margin-top: 0; }

/* Action buttons on cards */
.btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s;
  border: 1px solid #d1d5db;
  color: #374151;
  background: #fff;
}
.btn-sm:hover {
  background: var(--navy-50);
  border-color: var(--navy-300);
  color: var(--navy-700);
}

/* Filter bar */
.filter-select {
  padding: 0.375rem 2rem 0.375rem 0.625rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
}
.filter-select:focus {
  outline: none;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 2px rgba(44, 82, 136, 0.2);
}

/* Search input */
.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
}
.search-input:focus {
  outline: none;
  border-color: var(--navy-400);
  box-shadow: 0 0 0 2px rgba(44, 82, 136, 0.2);
}

/* Table styles for commodity DB */
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.db-table th {
  background: var(--navy-800);
  color: #fff;
  padding: 0.625rem 0.75rem;
  text-align: left;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}
.db-table th.sortable { cursor: pointer; user-select: none; }
.db-table th.sortable:hover { background: var(--navy-700); }
.db-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}
.db-table tbody.entry-group:hover td { background: var(--navy-50); }
.db-table .entry-row-has-links td { border-bottom: none; }
.db-table .links-row td { border-bottom: 1px solid #e5e7eb; }
.db-table .links-row.has-abstract td { border-bottom: none; }

/* Profile links */
.profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--navy-700);
  background: var(--navy-50);
  border: 1px solid var(--navy-100);
  transition: all 0.15s;
}
.profile-link:hover {
  background: var(--navy-100);
  color: var(--navy-800);
  border-color: var(--navy-200);
}

/* Toast notification for clipboard */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--navy-800);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 50;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
  .filter-bar { flex-direction: column; }
  #cit-paper-sidebar { display: none !important; }
  #cit-graph-container { height: 400px !important; }
  #cit-author-panel .grid { grid-template-columns: 1fr; }
}

/* Print styles */
@media print {
  nav, .filter-bar, .btn-sm, footer { display: none; }
  .abstract-content { max-height: none; }
  #network-view { display: none; }
}
