:root {
  /* Color Palette */
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Force map tiles to display */
.leaflet-tile {
  opacity: 1 !important;
  visibility: visible !important;
}

.leaflet-tile-container {
  opacity: 1 !important;
  visibility: visible !important;
}

/* App layout */
.app-layout {
  position: relative;
  aspect-ratio: 1170 / 877;
}

.map-container {
  width: 100%;
  height: 100%;
  background-color: #E7E7E7;
  position: relative;
}

.info-panel {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 274px;
  background-color: #FFFFFF;
  padding: 10px;
  z-index: 999999;
  box-shadow: 0 2px 15px 0 rgba(0, 0, 0, 0.25);
  max-height: calc(100% - 20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#searchView {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#architectDetailView {
  flex: 1;
  min-height: 0;
}

#buildingDetailView {
  flex: 1;
  min-height: 0;
}

.info-panel h2 {
  font-size: 30px;
  line-height: 30px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -1.2px;
}

.timeline {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - var(--space-8));
  max-width: 800px;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  height: 150px;
  z-index: 999999;
  box-shadow: var(--shadow-md);
}

/* Map Elements */
.map {
  width: 100%;
  height: 100%;
  background-color: #E7E7E7;
  position: relative;
}

/* Info Panel Elements */
.search-bar {
  display: flex;
  margin-bottom: 10px;
}

.search-input {
  flex: 1;
  padding: 5px 7px;
  border: 2px solid #000000;
  background-color: white;
}

.search-input::placeholder {
  color: #999;
}

.search-input:focus {
  border-color: #0000FF;
  outline: none;
}

.info-card {
  margin-bottom: 10px;
  background-color: white;
}

.info-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.36px;
  text-decoration: underline;
}

.info-card-title span {
  display: inline-block;
  text-decoration: none;
}

.info-card-subtitle {
  font-size: 18px;
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.36px;
}

.info-card-content {
  font-size: 0.875rem;
}

.tag {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  background-color: var(--gray-200);
  color: var(--gray-700);
  font-size: 0.75rem;
  margin-right: var(--space-1);
  margin-bottom: var(--space-1);
}

.architect-header {
  display: flex;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid #000000;
}

.architect-header button {
  background-color: #000000;
  height: 30px;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.building-header {
  display: flex;
  justify-content: space-between;
}

.building-header button {
  background-color: #000000;
  height: 30px;
  width: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-container {
  position: relative;
  height: 100px;
  margin-bottom: var(--space-2);
}

.timeline-axis {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--gray-400);
}

.timeline-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  height: 5px;
  background-color: var(--gray-500);
}

.timeline-tick.major {
  height: 8px;
  background-color: var(--gray-700);
}

.timeline-tick:nth-child(1) {
  left: 0%;
}

.timeline-tick:nth-child(2) {
  left: 10%;
}

.timeline-tick:nth-child(3) {
  left: 20%;
}

.timeline-tick:nth-child(4) {
  left: 30%;
}

.timeline-tick:nth-child(5) {
  left: 40%;
}

.timeline-tick:nth-child(6) {
  left: 50%;
}

.timeline-tick:nth-child(7) {
  left: 60%;
}

.timeline-tick:nth-child(8) {
  left: 70%;
}

.timeline-tick:nth-child(9) {
  left: 80%;
}

.timeline-tick:nth-child(10) {
  left: 90%;
}

.timeline-tick:nth-child(11) {
  left: 100%;
}

.timeline-period {
  position: absolute;
  height: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.timeline-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 var(--space-2);
  margin-top: var(--space-2);
}

.timeline-label {
  font-size: 0.75rem;
  color: var(--gray-600);
  position: relative;
}

.timeline-period-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--gray-900);
  color: white;
  font-size: 0.75rem;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 2;
}

.timeline-period:hover .timeline-period-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Buttons and Controls */
.btn {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.btn-secondary {
  background-color: var(--gray-200);
  color: var(--gray-800);
}

.btn-secondary:hover {
  background-color: var(--gray-300);
}

/* Form Controls */
.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 110%;
  color: #000000;
  font-weight: 700;
  letter-spacing: -0.28px;
  text-transform: capitalize;
}

.form-input {
  width: 100%;
  padding: 5px 7px;
  border: 2px solid #000000;
  background-color: white;
}

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M0.702637 0.711578L5.67139 5.61783L10.6401 0.711578' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.form-input:focus {
  border-color: #0000FF;
  outline: none;
}

/* Gender radio buttons */
.gender-checkboxes {
  display: flex;
  gap: 5px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  line-height: 110%;
  letter-spacing: -0.36px;
  padding: 5px 7px;
  border: 2px solid #000000;
}

.checkbox-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 2px solid #000000;
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
}

.checkbox-label input[type="radio"]:checked {
  background-color: #000000;
}

/* Toggles */
.toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  border-radius: 20px;
  transition: 0.4s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked+.toggle-slider {
  background-color: var(--gray-700);
}

input:checked+.toggle-slider:before {
  transform: translateX(20px);
}

/* Interactive Elements */
.toggle-button-group {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--gray-300);
  margin-bottom: var(--space-4);
}

.toggle-button {
  flex: 1;
  padding: var(--space-2);
  background-color: white;
  border: none;
  border-right: 1px solid var(--gray-300);
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-700);
}

.toggle-button:last-child {
  border-right: none;
}

.toggle-button.active {
  background-color: var(--gray-700);
  color: white;
}

/* Image Gallery Elements */
.gallery-item {
  aspect-ratio: 122 / 80;
  overflow: hidden;
  background-color: #F7F7F7;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: 2px solid transparent;
  outline-offset: -2px;
}

.gallery-item:hover {
  outline: 2px solid #0000FF;
}

.gallery-item.loading {
  background: linear-gradient(90deg,
      var(--gray-200) 0%,
      var(--gray-300) 50%,
      var(--gray-200) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

.gallery-item.loading img {
  opacity: 0;
}

/* Leaflet Zoom Control Styling */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: none !important;
}

.leaflet-control-zoom a {
  width: 30px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background-color: #000000 !important;
  transition: background-color 0.2s;
}

.leaflet-control-zoom a:hover {
  background-color: #0000FF !important;
}

.leaflet-control-zoom a.leaflet-disabled {
  background-color: #A3A3A3 !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

.leaflet-control-zoom-in {
  margin-bottom: 5px !important;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 1023px) {
  .info-panel {
    position: relative;
    width: 100%;
    right: 0;
    max-height: none;
  }

  .app-layout {
    aspect-ratio: 350 / 280;
  }
}