* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #eef3f8;
  color: #1f2937;
}

.app {
  display: flex;
  height: 100vh;
  width: 100%;
}

.map-area {
  flex: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  padding: 22px 24px;
  background: linear-gradient(135deg, #0f766e, #155e75);
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.topbar h1 {
  font-size: 26px;
  margin-bottom: 6px;
}

.topbar p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.88);
}

.map-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  z-index: 10;
}

.map-search-bar input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  font-size: 14px;
  background: #f8fafc;
  transition: all 0.2s ease;
  outline: none;
}

.map-search-bar input::placeholder {
  color: #94a3b8;
}

.map-search-bar input:focus {
  border-color: #10b981;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.map-wrapper {
  position: relative;
  flex: 1;
}

#map {
  flex: 1;
  width: 100%;
  height: 100%;
}

.sidebar {
  flex: 1;
  min-width: 380px;
  max-width: 520px;
  background: #ffffff;
  border-left: 1px solid #dbe3ec;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(15, 23, 42, 0.05);
}

.sidebar-drag-area {
  display: block;
}

.sidebar-handle {
  display: none;
}

.sidebar-header {
  padding: 22px 20px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.sidebar-header h2 {
  font-size: 22px;
  color: #0f172a;
  margin-bottom: 4px;
}

.sidebar-header p {
  font-size: 14px;
  color: #64748b;
}

.sidebar-content {
  padding: 20px;
  overflow-y: auto;
}

.sidebar-empty {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 18px;
  color: #64748b;
  line-height: 1.5;
}

.city-title {
  font-size: 24px;
  font-weight: bold;
  color: #0f172a;
  margin-bottom: 8px;
}

.city-meta {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 12px;
  background: #ecfeff;
  color: #0f766e;
  border: 1px solid #a5f3fc;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
}

.workshop-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.workshop-card h4 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #0f172a;
}

.workshop-description {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 14px;
}

.workshop-item {
  font-size: 14px;
  color: #334155;
  margin-bottom: 8px;
  line-height: 1.5;
}

.workshop-item strong {
  color: #111827;
}

.status-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  background: #e2e8f0;
  color: #334155;
}

.status-badge.aberto {
  background: #dcfce7;
  color: #166534;
}

.status-badge.ultimas-vagas {
  background: #fef3c7;
  color: #92400e;
}

.status-badge.em-breve {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge.encerrado {
  background: #e5e7eb;
  color: #4b5563;
}

.workshop-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #0f766e;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: 0.2s ease;
}

.workshop-link:hover {
  opacity: 0.92;
}

.workshop-link.disabled {
  background: #cbd5e1;
  color: #475569;
  cursor: not-allowed;
  pointer-events: none;
}

.legend-box {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #dbe3ec;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-size: 13px;
  color: #334155;
}

.legend-box strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

@media (max-width: 768px) {

  .app {
    position: relative;
    display: block;
    height: 100vh;
    overflow: hidden;
  }

  .map-area {
    height: 100vh;
    width: 100%;
  }

  .topbar {
    padding: 16px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar p {
    font-size: 13px;
  }

  .map-search-bar {
    padding: 12px 16px;
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
  }

  .map-search-bar input {
    width: 100%;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 110px;
    min-width: unset;
    max-width: unset;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.16);
    z-index: 1200;
    background: #ffffff;
    transition: height 0.22s ease;
    overflow: hidden;
  }

  .sidebar.dragging {
    transition: none;
  }

  .sidebar.collapsed {
    height: 110px;
  }

  .sidebar.expanded {
    height: 82vh;
  }

  .sidebar-drag-area {
    cursor: grab;
    touch-action: none;
    user-select: none;
  }

  .sidebar-drag-area:active {
    cursor: grabbing;
  }

  .sidebar-handle {
    display: block;
    width: 52px;
    height: 6px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 10px auto 6px;
  }

  .sidebar-header {
    padding: 12px 16px 14px;
  }

  .sidebar-header h2 {
    font-size: 18px;
  }

  .sidebar-header p {
    font-size: 13px;
  }

  .sidebar-content {
    padding: 14px 16px 22px;
    overflow-y: auto;
    height: calc(100% - 80px);
  }

  .legend-box {
    right: 12px;
    bottom: 56vh;
    font-size: 12px;
    max-width: 180px;
  }
}

.custom-city-marker-wrapper {
  background: transparent;
  border: none;
}

.custom-city-marker {
  position: relative;
  width: 26px;
  height: 38px;
  background: linear-gradient(180deg, #0f766e, #0b5d56);
  border: 2px solid #ffffff;
  border-radius: 18px 18px 18px 0;
  transform: rotate(-45deg);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.28);
}

.custom-city-marker span {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
}

.custom-city-marker-wrapper {
  background: transparent;
  border: none;
}

.custom-city-marker {
  position: relative;
  width: 26px;
  height: 38px;
  background: linear-gradient(180deg, #0f766e, #155e75);
  border: 2px solid #ffffff;
  border-radius: 18px 18px 18px 0;
  transform: rotate(-45deg);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.28);
}

.custom-city-marker span {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
}

.custom-marker .pin {
  width: 16px;
  height: 16px;
  background-color: #2ecc71; /* verde */
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  transition: transform 0.2s ease;
}

.custom-marker .pin:hover {
  transform: scale(1.3);
}

.city-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.clear-filter-btn {
  border: 1px solid #10b981;
  background: #ecfdf5;
  color: #047857;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-filter-btn:hover {
  background: #d1fae5;
  transform: translateY(-1px);
}

.clear-filter-btn:active {
  transform: translateY(0);
}

.search-container {
  position: relative;
  width: 100%;
}

#searchInput {
  width: 100%;
  padding-right: 35px; /* espaço pro X */
}

.clear-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  
  background: transparent;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  display: none; /* começa escondido */
}

.clear-search-btn:hover {
  color: #10b981; /* verde */
}

.search-container {
  position: relative;
}

#searchInput {
  padding-right: 35px;
}

#clearSearchBtn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  display: none;
}


.topbar-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 200px;
  height: 50px;
  object-fit: contain;
}

.topbar-text {
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {

  .topbar-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar-logo {
    width: 140px;
  }

}
