/* Custom header color */
.md-header {
  background-color: #000000 !important;
}

.md-tabs {
  background-color: #000000 !important;
}

/* Increase logo size */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  width: 2rem !important;  /* Original is typically around 1.2rem */
  height: 2rem !important;
}

/* Black theme for buttons */
.md-button, 
.md-typeset .md-button,
button.md-button,
.refresh-btn,
.save-btn,
.edit-contributions,
.md-icon-button,
.md-header__button,
.md-nav__toggle,
.centerButton {
  background-color: #000000 !important;
  color: white !important;
  border-color: #333333 !important;
}

.md-button:hover, 
.md-typeset .md-button:hover,
button.md-button:hover,
.refresh-btn:hover,
.save-btn:hover,
.edit-contributions:hover,
.md-icon-button:hover,
.md-header__button:hover,
.centerButton:hover {
  background-color: #333333 !important;
  border-color: #000000 !important;
}

/* Black theme for main action buttons */
.save-btn {
  background-color: #000000 !important;
  color: white !important;
  border: 1px solid #333333 !important;
}

.save-btn:hover {
  background-color: #333333 !important;
}

/* Style cancel buttons with inverted colors but still in theme */
.cancel-btn {
  background-color: white !important;
  color: #000000 !important;
  border: 1px solid #000000 !important;
}

.cancel-btn:hover {
  background-color: #f0f0f0 !important;
}

/* Graph UI elements */
#knowledge-graph button {
  background-color: #000000 !important;
  color: white !important;
}

/* Black theme for links */
.md-nav__link:hover,
.md-nav__link:focus,
.md-nav__link--active,
.md-nav__item--active > .md-nav__link {
  color: #000000 !important;
}

/* Black theme for active nav items */
.md-nav__item--active {
  color: #000000 !important;
}

/* Black theme for selected items */
.document-item.selected {
  background-color: #f0f0f0 !important;
  border-color: #000000 !important;
}

/* Style input focus states */
.search-container input:focus {
  outline: none;
  border-color: #000000 !important;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1) !important;
}

/* Override any Material theme primary colors */
:root {
  --md-primary-fg-color: #000000 !important;
  --md-primary-fg-color--light: #333333 !important;
  --md-primary-fg-color--dark: #000000 !important;
  --md-accent-fg-color: #333333 !important;
}

#knowledge-graph {
  width: 100%;
  height: 90vh;
  background-color: #f5f5f5;
  border-radius: 15px;
  position: relative;
  overflow: hidden;  /* No scroll */
}

/* Panel Styling */
#document-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 40%;
    height: 100%;
    background: white;
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
    transform: translateX(100%);  /* ✅ Initially hidden */
    overflow-y: auto;
    padding: 20px;
    z-index: 9999;
    display: none; /* ✅ Prevents clicking before opening */
}

#document-panel.open {
    transform: translateX(0);
    display: block;  /* ✅ Ensures it remains visible */
}

#close-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

/* Contributors Page Styles */
.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}

.profile-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.profile-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.profile-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #f5f5f5;
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  padding: 1.5rem;
  text-align: center;
}

.profile-info h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.organization {
  color: #666;
  margin: 0 0 1rem 0;
}

.linkedin-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #000000 !important;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  margin-bottom: 1rem;
}

.linkedin-link:hover {
  color: #333333 !important;
}

.linkedin-link svg {
  width: 20px;
  height: 20px;
}

/* Contribution Details Styles */
.contributions {
  margin-top: 1rem;
  text-align: left;
}

.contributions summary {
  cursor: pointer;
  color: #666;
  padding: 0.5rem;
  border-radius: 4px;
  background-color: #f5f5f5;
  transition: background-color 0.2s ease;
}

.contributions summary:hover {
  background-color: #e0e0e0;
}

.contributions ul {
  margin: 0.5rem 0 0 0;
  padding-left: 1.5rem;
  list-style-type: none;
}

.contributions ul li {
  margin: 0.5rem 0;
}

.contributions ul li a {
  color: #000000 !important;
  text-decoration: none;
  transition: color 0.2s ease;
}

.contributions ul li a:hover {
  color: #333333 !important;
  text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .contributors-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .profile-card {
    max-width: 100%;
  }
}

/* Contributions Container */
.contributions-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.edit-contributions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: white;
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.edit-contributions:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  position: relative;
  background-color: white;
  margin: 10vh auto;
  padding: 0;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

.modal-body {
  padding: 1rem;
  max-height: 60vh;
  overflow-y: auto;
}

.search-container {
  margin-bottom: 1rem;
}

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

.search-container input:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

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

.document-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.document-item:hover {
  background-color: #f5f5f5;
}

.document-item.selected {
  background-color: #e3f2fd;
  border-color: #2196f3;
}

.modal-footer {
  padding: 1rem;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.modal-footer button {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-row input {
  flex: 1;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: white;
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.refresh-btn svg {
  transition: transform 0.3s ease;
  fill: white !important;
}

.refresh-btn:hover {
  background-color: #f5f5f5;
  border-color: #ccc;
}

.refresh-btn:hover svg {
  transform: rotate(180deg);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.no-documents {
  text-align: center;
  padding: 2rem;
  color: #666;
  font-style: italic;
}

/* Style refresh button icon rotation */
.refresh-btn svg {
  transition: transform 0.3s ease;
  fill: white !important;
}

/* Customize graph nodes color scheme */
circle.node {
  fill: #000000 !important;
  stroke: #333333 !important;
}

circle.node:hover {
  fill: #333333 !important;
}

.node-label {
  fill: white !important;
}

/* Make graph lines black */
line.link {
  stroke: #000000 !important;
}

/* Override any blue focus indicators */
*:focus {
  outline-color: #000000 !important;
}

/* Override any primary colored elements */
.md-typeset a {
  color: #000000 !important;
}

.md-typeset a:hover {
  color: #333333 !important;
}
