/* =======================================================
   GLOBAL RESET & BASE
======================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #05070c;
  color: #f5f5f5;
  height: 100vh;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* =======================================================
   TOP BAR
======================================================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #1a2233;
  background: #050a13;
}

.title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #dce3ff;
}

.call-controls button {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: none;
  background: #1d4ed8;
  color: white;
  font-weight: 500;
  cursor: pointer;
}

.call-controls button:hover {
  background: #2563eb;
}

/* =======================================================
   CHAT LOG AREA
======================================================= */
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.msg {
  max-width: 75%;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 1rem;
}

.msg.user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.msg.assistant {
  align-self: flex-start;
  background: #0f172a;
  color: #dce3ff;
}

/* =======================================================
   TYPING INDICATOR
======================================================= */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 1rem;
  background: #0f172a;
  border-radius: 14px;
  max-width: 80px;
  margin-left: 0;
}

.typing-indicator.hidden {
  display: none;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #4f5e7b;
  border-radius: 50%;
  animation: blink 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% { opacity: 0.2; }
  20% { opacity: 1; }
  100% { opacity: 0.2; }
}

/* =======================================================
   INPUT FORM
======================================================= */
.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #1a2233;
  background: #05070c;
}

#user-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #f5f5f5;
  outline: none;
  font-size: 1rem;
}

#user-input::placeholder {
  color: #6b7280;
}

#send-btn {
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  border: none;
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

#send-btn:hover {
  background: #1d4ed8;
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* =======================================================
   VOICE CALL (voice.html)
======================================================= */
#status {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 1rem;
}

#transcript-box {
  background: #0f172a;
  border: 1px solid #1a2233;
  padding: 1rem;
  min-height: 250px;
  max-height: 55vh;
  overflow-y: auto;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 0.95rem;
  white-space: pre-line;
}

#end-call {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #dc2626;
  border: none;
  border-radius: 10px;
  color: #fff;
  cursor: pointer;
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
}

#end-call:hover {
  background: #ef4444;
}

/* =======================================================
   SCROLLBARS
======================================================= */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0f19;
}

::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* =======================================================
   MOBILE RESPONSIVE
======================================================= */
@media (max-width: 600px) {
  .msg {
    max-width: 85%;
  }

  #send-btn {
    padding: 0.6rem 0.85rem;
  }
  
  .boat-listings {
    grid-template-columns: 1fr !important;
  }
}

/* =======================================================
   BOAT LISTINGS CARDS
======================================================= */
.boat-listings {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
  max-width: 100%;
}

.boat-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.boat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.boat-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #1e293b;
}

.boat-info {
  padding: 0.75rem;
}

.boat-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #dce3ff;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.boat-details {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

.boat-price {
  font-size: 0.85rem;
  font-weight: 600;
  color: #22c55e;
}

.boat-link {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.35rem 0.75rem;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  transition: background 0.2s;
}

.boat-link:hover {
  background: #1d4ed8;
}

/* Chat message links */
.chat-message a {
  color: #60a5fa;
  text-decoration: underline;
}

.chat-message a:hover {
  color: #93c5fd;
}
