* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', serif;
  background: #f5f5f0;
  color: #333;
}

/* Header Styling */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f5f5f0;
  padding: 20px 40px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 1000;
  border-bottom: 1px solid #e0e0e0;
}

/* Ensure Roboto is used for specific labels in user info modal */
#userInfoModal label {
  font-family: 'Roboto', sans-serif;
}

/* No logo in header per latest design */

/* Navbar layout helpers for new design */
.header .header-center a.btn { text-decoration: none; }
.header a.btn { text-decoration: none; }

.nav-left, .nav-right {
  display: flex;
  gap: 18px;
  align-items: center;
}
.nav-left { /* align with header padding via .header */ gap: 18px; }
.nav-right { margin-left: auto; }

/* Submit button uses same style as other .btn */

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  margin-left: 10px;
}

.nav-menu {
  position: absolute;
  top: 70px;
  right: 20px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px 0;
  display: none;
  flex-direction: column;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1100;
}
.nav-menu.active { display: flex; }
.nav-menu a, .nav-menu button {
  background: none;
  border: none;
  text-align: left;
  padding: 10px 20px;
  font-family: 'Georgia', serif;
  font-size: 15px;
  cursor: pointer;
  color: #333;
  text-decoration: none;
}
.nav-menu a:hover, .nav-menu button:hover {
  background: #f5f5f5;
}

/* Active link style */
a[aria-current="page"], .nav-left .btn.link-home[href="index.html"]:focus {
  box-shadow: inset 0 0 0 2px #4a5268;
}

@media (max-width: 820px) {
  .nav-left .link-home, .nav-right .link-login { display: none; }
  .nav-toggle { display: block; }
  .nav-left { margin-left: 10px; }
  .btn.btn-submit { padding: 10px 22px; }
  .header { padding: 16px 20px; }
}

.btn {
  padding: 12px 28px;
  background: #4a5268;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.3s;
  font-family: 'Georgia', serif;
}

.btn:hover {
  background: #5d6580;
}

.btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.search-bar {
  padding: 12px 24px;
  width: 500px;
  border: 1px solid #ddd;
  border-radius: 25px;
  font-size: 16px;
  background: white;
}

/* Page Container */
.page {
  display: none;
  padding: 120px 40px 40px 40px;
  min-height: 100vh;
}

.page.active {
  display: block;
}

/* Home Page (Archive) Styling */
.home-header {
  text-align: center;
  margin-bottom: 60px;
}

.date-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
}

.home-header h1 {
  font-size: 48px;
  font-weight: normal;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.home-header p {
  font-size: 16px;
  color: #666;
  font-style: italic;
}

/* Network Graph Styles */
.graph-container {
  width: 100%;
  height: calc(100vh - 200px);
  background: white;
  border-radius: 20px;
  margin: 0 auto;
  max-width: 1400px;
  position: relative;
  overflow: hidden;
}

.graph-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  max-width: 300px;
}

.graph-controls h3 {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: normal;
}

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

.category-filter label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.category-filter input[type="checkbox"] {
  cursor: pointer;
}

.tag-filter-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
}

.graph-search {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
}

.node {
  cursor: pointer;
  stroke: #fff;
  stroke-width: 3px;
  transition: all 0.05s ease-in-out;
}

.link {
  stroke: #999;
  stroke-opacity: 0.3;
  stroke-width: 1px;
}

.node-tooltip {
  position: absolute;
  background: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  pointer-events: none;
  z-index: 1000;
  max-width: 300px;
  display: none;
}

.node-tooltip.active {
  display: block;
}

.node-tooltip h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: normal;
}

.node-tooltip .tooltip-date {
  color: #666;
  font-size: 12px;
  margin-bottom: 8px;
}

.node-tooltip .tooltip-format {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 13px;
}

.node-tooltip .tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.node-tooltip .tag {
  font-size: 11px;
  padding: 4px 10px;
}

.zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
}

.zoom-btn {
  width: 40px;
  height: 40px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.zoom-btn:hover {
  background: #f5f5f5;
}

/* Tags */
.tag {
  padding: 10px 20px;
  background: #e0e0e0;
  color: #333;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
}

.tag:hover {
  background: #d0d0d0;
}

.tag.readonly {
  cursor: default;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  padding: 40px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-header {
  position: sticky;
  top: 0;
  background: white;
  padding: 20px 40px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 20px 20px 0 0;
  z-index: 10;
}

.close-modal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f0f0f0;
  border: none;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background: #e0e0e0;
}

.modal-body {
  padding: 40px;
}

/* Artifact Display */
.artifact-section {
  margin-bottom: 30px;
}

.artifact-section h3 {
  font-size: 20px;
  margin-bottom: 15px;
  font-weight: normal;
}

.artifact-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 15px;
}

.artifact-pdf {
  width: 100%;
  height: 600px;
  border: none;
  border-radius: 15px;
}

.artifact-audio {
  width: 100%;
}

.artifact-text {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
  line-height: 1.8;
}

.artifact-tags-display {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.artifact-viewer {
  background: white;
  border-radius: 20px;
  padding: 40px;
  margin-bottom: 30px;
}

/* Help Button */
.btn-help {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  padding: 0;
  border: 2px solid #514575;
  background: white;
  color: #514575;
  transition: all 0.2s ease;
}

.btn-help:hover {
  background: #514575;
  color: white;
  transform: scale(1.05);
}

/* Responsive */
@media (max-width: 1024px) {
  .search-bar {
    width: 300px;
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .search-bar {
    width: 100%;
  }
  
  .graph-controls {
    max-width: 250px;
  }
}