/* Allgemeine Styles */
body {
  margin: 0;
  font-family: "Stolzl", sans-serif;
  color: #3a00af;
  transition: background-color 0.3s ease;
}

h2 {
  font-size: 2rem;
  margin: 2% 10%;
}

a {
  color: #ff6ca0;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Filter-Container now on the right */
#filter-container {
  position: fixed;
  top: 0;
  right: 0;      /* Align to right */
  left: auto;
  width: 100%;
  background-color: #3a00af;
  padding: 10px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Button zum Öffnen des Filter-Popups */
#open-filter-button {
  background-color: #8d64ff;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

#open-filter-button:hover {
  background-color: #7c54e6;
}

/* Filter Icon inside the Filter Button */
#open-filter-button .filter-icon {
  vertical-align: middle;
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
}

/* Filter Popup (Desktop) */
#filter-popup {
  position: absolute;
  top: 70px;
  right: 10px;
  width: 300px;
  background-color: #fff;
  border: 2px solid #3a00af;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  display: none;
  z-index: 2000;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  transform: translateY(-20px);
  opacity: 0;
}

#filter-popup.expanded {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* New: Optional Close Button for Mobile Modal */
#close-filter-button {
  display: none; /* Shown only on mobile in our media query below */
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #3a00af;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Institution count */
#inst-count {
  margin: 10px 10px;
  text-align: left;
  font-size: 1rem;
  color: #3a00af;
  font-weight: bold;
}

/* Filter Sections */
.filter-section {
  margin-bottom: 20px;
}

.filter-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #3a00af;
}

/* Filter Tags */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tags .tag {
  background: transparent;
  color: #3a00af;
  border: 2px solid #3a00af;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
}

.filter-tags .tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(58, 0, 175, 0.1);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.filter-tags .tag:hover::before {
  transform: translateX(0);
}

.filter-tags .tag.active {
  background: #3a00af;
  color: #fff;
  border-color: #3a00af;
  transform: scale(1.05);
  box-shadow: 0 3px 8px rgba(58, 0, 175, 0.3);
}

/* Button Row in Popup */
.button-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#reset-button,
#apply-button {
  padding: 8px 16px;
  background-color: #8d64ff;
  border: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#reset-button:hover,
#apply-button:hover {
  background-color: #7c54e6;
}

/* Sidebar */
#sidebar {
  width: 20%;
  height: calc(95vh - var(--filter-height));
  overflow-y: auto;
  background-color: #f3f0ff;
  position: absolute;
  left: 0;
  top: var(--filter-height);
  padding: 10px 5px;
  overflow: hidden;
}

#center-list {
  list-style: none;
  padding: 0;
  margin: 0;
  height: 100%;
  overflow-y: auto;
  max-height: calc(95vh - var(--filter-height) - 40px);
  padding-bottom: 20px;
  scrollbar-width: thin;
  scrollbar-color: #ff6ca0 #f3f0ff;
}

#center-list li {
  padding: 12px 15px;
  border: 1px solid #ff6ca0;
  margin: 0 15px 6px 10px;
  cursor: pointer;
  border-radius: 30px;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  color: #3a00af;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 95%;
  transform-origin: left center;
  animation: fadeIn 0.5s ease backwards;
  animation-delay: calc(var(--item-index, 0) * 0.05s);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#center-list li:hover {
  background-color: #ff6ca0;
  color: #fff;
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(255, 108, 160, 0.2);
}

#center-list li.active {
  background-color: #3a00af;
  color: #fff;
  font-weight: 800;
}

#center-list li:last-child {
  margin-bottom: 20px;
}

/* Map Container */
#map-container {
  position: absolute;
  top: var(--filter-height);
  left: 20%;
  width: 77%;
  height: calc(95vh - var(--filter-height));
  background-color: white;
  z-index: 1;
  margin: 20px;
  overflow: hidden;
}

#hamburg-map {
  background-color: white;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}

/* Map Dots */
.dot {
  cursor: pointer;
  transition: r 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), 
              fill 0.3s ease, 
              stroke 0.3s ease,
              stroke-width 0.3s ease;
  animation: dotPulse 2s infinite alternate ease-in-out;
}

@keyframes dotPulse {
  0% {
    stroke-opacity: 0.7;
  }
  100% {
    stroke-opacity: 0.3;
  }
}

.dot:hover {
  stroke: #ff6ca0;
  stroke-width: 4;
  animation-play-state: paused;
}

.dot.hover-highlight {
  fill: #ff6ca0 !important;
  animation: highlightPulse 1s infinite alternate ease-in-out;
}

@keyframes highlightPulse {
  0% {
    r: 12;
  }
  100% {
    r: 14;
  }
}

/* Tooltip */
#tooltip {
  position: absolute;
  background-color: rgba(58, 0, 175, 0.95);
  backdrop-filter: blur(8px);
  border: solid 1px rgba(255, 108, 160, 0.5);
  font-size: 14px;
  color: #fff;
  padding: 16px;
  border-radius: 12px;
  pointer-events: auto;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  max-width: 280px;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#tooltip-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  position: relative;
  padding-bottom: 8px;
}

#tooltip-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: #ff6ca0;
}

#tooltip-description {
  line-height: 1.6;
  margin-bottom: 14px;
  font-weight: 400;
}

/* New styles for tech focus bubbles */
.tech-focus-bubbles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.tech-bubble {
  background: #ff6ca0;
  color: #fff;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tech-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#tooltip a {
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 8px 16px;
  background-color: #ff6ca0;
  border-radius: 30px;
}

#tooltip a:hover {
  background-color: #ff8fb7;
  box-shadow: 0 4px 12px rgba(255, 108, 160, 0.3);
  transform: translateY(-2px);
}

/* Icons für Tech-Bubbles */
.tech-bubble::before {
  content: '';
  display: inline-block;
  height: 14px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.tech-bubble.q-computing::before {
  background-image: url('path/to/computing-icon.svg');
}

.tech-bubble.q-sensing::before {
  background-image: url('path/to/sensing-icon.svg');
}

/* Info Section */
#info-section {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background-color: #fff;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
  display: none;
  z-index: 100;
}

#info-section:not(.hidden) {
  display: block;
}

#info-section.hidden {
  display: none;
}

/* Mobile Tooltip */
#mobile-tooltip {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #2b00a0f5;
  color: #fff;
  padding: 10px 0;
  border-radius: 10px 10px 0 0;
  z-index: 1100;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
  margin: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 10px;
  padding-right: 10px;
}

#mobile-tooltip h3 {
  font-size: 1rem;
  margin: 0 0 8px 0;
  text-align: left;
}

#mobile-tooltip p {
  font-size: 0.9rem;
  margin: 0 0 15px 0;
  text-align: left;
}

#mobile-tooltip a {
  display: inline-block;
  padding: 8px 20px;
  background-color: #ff6ca0;
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-weight: bold;
  margin: 5px 0;
  text-align: center;
}

#mobile-tooltip a:hover {
  background-color: #ff8fb7;
}

/* Mobile Media Query */
@media (max-width: 768px) {
  /* Stack sidebar above map */
  #sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 10px;
    background-color: #f3f0ff;
    border-right: none;
  }

  /* Limit center list height */
  #center-list {
    max-height: 200px;
    overflow-y: auto;
    margin: 10px 0;
  }

  /* Place map container below sidebar */
  #map-container {
    position: relative;
    left: 0;
    width: 100%;
    height: 60vh;
    margin: 0;
  }

  /* Adjust filter container to span the top */
  #filter-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    justify-content: space-between;
    padding: 10px;
  }

  /* Make the filter popup a full-screen modal overlay */
  #filter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
    background-color: #fff;
    overflow-y: auto;
    z-index: 2000;
  }

  /* Show the close button on mobile */
  #close-filter-button {
    display: block;
  }

  /* Adjust button styles for a compact mobile look */
  body {
    font-size: 0.9rem;
  }

  #open-filter-button {
    padding: 10px 16px;
    font-size: 1rem;
    display: flex;
    align-items: center;
  }

  /* Adjust filter icon: make it bigger and reduce margin */
  #open-filter-button .filter-icon {
    vertical-align: middle;
    margin-right: 4px;
    display: inline-flex;
    align-items: center;
  }

  /* Adjust mobile tooltip */
  #mobile-tooltip {
    font-size: 0.9rem;
    padding: 8px 10px;
  }
}

/* Styling für den Actor Type Tag */
.actor-type-tag {
  background-color: #6a69ff;
  font-weight: 700;
}

/* Anpassung der Scrollbars für WebKit-Browser (Chrome, Safari) */
#center-list::-webkit-scrollbar {
  width: 8px;
}

#center-list::-webkit-scrollbar-track {
  background: #f3f0ff;
  border-radius: 4px;
}

#center-list::-webkit-scrollbar-thumb {
  background-color: #ff6ca0;
  border-radius: 4px;
}

/* Verbesserung der Tooltip-Positionierung mit größerer Schrift */
@media (max-width: 1024px) {
  #center-list li {
    font-size: 1.1rem;
  }
}

/* Verbesserung der Lesbarkeit auf verschiedenen Geräten */
@media (max-width: 1280px) {
  #center-list li {
    font-size: 1rem;
    padding: 10px 15px;
  }
}

/* Styling für die Suchfunktion */
#search-container {
  margin: 10px;
  position: relative;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 30px;
  padding: 8px 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-wrapper:focus-within {
  box-shadow: 0 4px 15px rgba(58, 0, 175, 0.2);
}

.search-icon {
  margin-right: 8px;
}

#search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: #3a00af;
  background: transparent;
}

#clear-search {
  background: none;
  border: none;
  color: #3a00af;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 5px;
}

#clear-search.hidden {
  display: none;
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-top: 5px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
}

#search-results.hidden {
  display: none;
}

.search-result-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: #f3f0ff;
}

.search-result-item.highlight {
  background-color: #f3f0ff;
}

.search-match {
  font-weight: bold;
  color: #ff6ca0;
}

/* Styling für Statistik-Panel */
.stats-section {
  background-color: rgba(243, 240, 255, 0.5);
  border-radius: 8px;
  padding: 12px;
  margin-top: 15px;
}

.stats-container {
  display: flex;
  justify-content: space-between;
  margin: 15px 0;
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #3a00af;
}

.stat-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 5px;
}

.chart-container {
  height: 200px;
  margin: 15px 0;
}

/* Bottom Sheet für mobile Filter */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
  z-index: 2000;
  max-height: 80vh;
  overflow-y: auto;
}

.bottom-sheet.visible {
  transform: translateY(0);
}

.bottom-sheet-handle {
  width: 100%;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
}

.handle-bar {
  width: 40px;
  height: 5px;
  background-color: #ccc;
  border-radius: 3px;
}

.bottom-sheet-content {
  padding: 0 20px 20px;
}

.bottom-sheet h3 {
  text-align: center;
  margin: 10px 0 20px;
  color: #3a00af;
  font-size: 1.2rem;
}

.bottom-sheet h4 {
  margin: 5px 0 10px;
  color: #3a00af;
}

.mobile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.mobile-tags .tag {
  background-color: transparent;
  color: #3a00af;
  border: 2px solid #3a00af;
  padding: 8px 15px;
  border-radius: 30px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.mobile-tags .tag.active {
  background-color: #3a00af;
  color: white;
}

#mobile-reset-button,
#mobile-apply-button {
  padding: 12px 20px;
  border: none;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

#mobile-reset-button {
  background-color: #f3f0ff;
  color: #3a00af;
}

#mobile-apply-button {
  background-color: #3a00af;
  color: white;
}

/* Floating Action Button für Filter auf Mobile */
#filter-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #ff6ca0;
  color: white;
  box-shadow: 0 4px 12px rgba(255, 108, 160, 0.4);
  border: none;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
}

#filter-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(255, 108, 160, 0.5);
}

#filter-fab svg {
  width: 24px;
  height: 24px;
}

/* Touch-freundlichere UI-Elemente für Mobile */
@media (max-width: 768px) {
  #filter-container {
    display: none;
  }
  
  #filter-fab {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  #center-list li {
    padding: 15px;
    margin: 0 10px 10px;
    font-size: 1rem;
  }
  
  .tech-bubble {
    padding: 6px 12px; /* Größere Touch-Fläche */
  }
  
  #tooltip {
    width: 90%;
    max-width: none;
    left: 5% !important;
    border-radius: 15px;
  }
}

/* Fix for tag buttons text alignment */
.tech-bubble,
.actor-type-tag,
#tooltip a,
#mobile-tooltip a,
[class*="tag"] {
  display: inline-flex;
  align-items: center;
  justify-content: left;
  text-align: center;
  padding: 5px 10px;
  line-height: 1;
  white-space: nowrap;
}

/* Fix for "Visit Website" button */
#tooltip a,
#mobile-tooltip a {
  margin: 5px 0;
  padding: 8px 16px;
  justify-content: center;
  text-align: center;
  width: auto;
}
