body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}

.header {
    position: relative;
    background-color: #008CBA;
    color: white;
    padding: 20px 0;
    text-align: center;
}

.header h1 {
    margin: 0;
    font-size: 28px;
}

/* Place the menu in top-right corner */
.menu {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.menu .btn {
    background: white;
    color: #008CBA;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.menu .btn:hover {
    background: #005f8b;
    color: white;
}

.search-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: white;
}


.search-bar input {
  width: 250px;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.search-bar button {
  padding: 10px;
  font-size: 16px;
  border: none;
  background: #008cba;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.container {
  display: flex;
  height: 80vh;
}

.sidebar {
  width: 300px;
  background: white;
  box-shadow: 2px 0px 5px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  transition: 0.3s;
  padding: 10px;
}

.toggle-sidebar {
  width: 100%;
  padding: 10px;
  background: #008cba;
  color: white;
  border: none;
  cursor: pointer;
  margin-bottom: 10px;
}

.category-filter {
  padding: 10px;
  margin-bottom: 10px;
}

.category-filter select {
  width: 100%;
  padding: 8px;
  border-radius: 5px;
  border: 1px solid #ccc;
}

.amenity-list {
  max-height: 600px;
  overflow-y: auto;
  padding: 10px;
}

#map {
  flex: 1;
  height: 100%;
  border-left: 1px solid #ccc;
}

.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid white;
  border-top: 5px solid #008cba;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

.sidebar.collapsed {
  width: 50px;
  overflow: hidden;
}

.sidebar.collapsed .amenity-list,
.sidebar.collapsed .category-filter {
  display: none;
}

.sidebar.collapsed .toggle-sidebar {
    width: 100%;
    height: 100%;
}

/* ========== AI CHAT PANEL ========== */

.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #008CBA, #00bcd4);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 140, 186, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0, 140, 186, 0.55);
}

.ai-chat-panel {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100% - 40px);
    height: 520px;
    max-height: calc(100vh - 150px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    z-index: 998;
    overflow: hidden;
    transform: translateY(calc(100% + 120px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}

.ai-chat-panel.chat-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chat-header {
    background: linear-gradient(135deg, #008CBA, #00bcd4);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.18);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chat-title small {
    display: block;
    opacity: 0.9;
    font-size: 11px;
    margin-top: 2px;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #c5cfdc;
    border-radius: 3px;
}

.chat-message {
    display: flex;
    max-width: 85%;
    animation: msgSlide 0.25s ease;
}

@keyframes msgSlide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-ai {
    align-self: flex-start;
}

.chat-user {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    word-wrap: break-word;
}

.chat-ai .chat-bubble {
    background: #ffffff;
    border: 1px solid #e3eaf3;
    border-top-left-radius: 4px;
    color: #243142;
}

.chat-user .chat-bubble {
    background: linear-gradient(135deg, #008CBA, #00a8c8);
    color: white;
    border-top-right-radius: 4px;
}

.chat-bubble h2,
.chat-bubble h3,
.chat-bubble h4 {
    margin: 8px 0 4px;
    color: inherit;
}

.chat-bubble ul {
    margin: 6px 0 6px 18px;
    padding: 0;
}

.chat-bubble li {
    margin: 3px 0;
}

.chat-bubble strong {
    font-weight: 700;
}

.chat-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 14px 16px;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8aa2bd;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.chat-input-area {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #eef2f7;
    flex-shrink: 0;
}

#chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d6dee8;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#chat-input:focus {
    border-color: #008CBA;
    box-shadow: 0 0 0 3px rgba(0, 140, 186, 0.15);
}

#chat-send-btn {
    background: linear-gradient(135deg, #008CBA, #00bcd4);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.15s;
}

#chat-send-btn:hover {
    transform: scale(1.05);
}

#chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .ai-chat-panel {
        right: 10px;
        left: 10px;
        width: auto;
        bottom: 80px;
        height: 480px;
    }
    .chat-toggle {
        bottom: 14px;
        right: 14px;
        padding: 12px 18px;
    }
}
