/* style.css */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Roboto', sans-serif;
  background-color: #ECF0F1;
}
.menu {
  background-color: #2C3E50;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  color: white;
}
.menu .nav-link {
  color: #ECF0F1;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: 0.2s;
}
.menu .nav-link:hover {
  background-color: #5FAEE3;
  color: white;
}
.menu .nav-link.active {
  background-color: #3498DB;
  color: white;
}
.content-area {
  background-color: #ECF0F1;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  position: relative;
}
.btn-custom {
  background-color: #3498DB;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 1.2rem;
  transition: background-color 0.2s;
}
.btn-custom:hover {
  background-color: #5FAEE3;
  color: white;
}
.form-label {
  font-weight: 500;
  color: #2C3E50;
}
.chat-message-customer {
  background-color: white;
  border-left: 5px solid #3498DB;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.chat-message-owner {
  background-color: #E8F0F7;
  border-left: 5px solid #2C3E50;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
}
.icon-btn {
  background: transparent;
  border: none;
  color: #2C3E50;
  font-size: 1.1rem;
  transition: color 0.15s;
  padding: 0 0.35rem;
}
.icon-btn:hover {
  color: #3498DB;
}

/* Profile & catalog images */
.profile-pic {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.catalog-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}
.remove-photo {
  font-size: 10px;
  padding: 2px 5px;
  line-height: 1;
}

.card { border-radius: 0.75rem; border: none; }
.reply-area { margin-top: 0.75rem; }

/* mobile menu */
.menu-toggle {
  display: none;
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 1050;
}
.menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 1040;
  transition: opacity 0.3s;
}
@media (max-width: 768px) {
  .menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
  }
  .menu.show { left: 0; }
  .menu-toggle { display: inline-block; }
  .menu-backdrop.show { display: block; }
  .content-area { padding-top: 4rem; }
}

/* Payment methods chips */
.payment-chip {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 2rem;
  padding: 0.3rem 1rem;
  font-size: 0.9rem;
  color: #2C3E50;
  transition: all 0.15s;
  cursor: pointer;
}
.payment-chip:hover {
  background-color: #e2e6ea;
  border-color: #adb5bd;
}
.payment-chip.active {
  background-color: #3498DB;
  border-color: #2980b9;
  color: white;
}
.payment-chip.active:hover {
  background-color: #5FAEE3;
  border-color: #3498DB;
}

.chip {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 2rem;
  padding: 0.3rem 1rem;
  font-size: 0.9rem;
  color: #2C3E50;
  transition: all 0.15s;
  cursor: pointer;
}
.chip:hover {
  background-color: #e2e6ea;
  border-color: #adb5bd;
}
.chip.active {
  background-color: #3498DB;
  border-color: #2980b9;
  color: white;
}
.chip.active:hover {
  background-color: #5FAEE3;
  border-color: #3498DB;
}

.chat-message-customer.unread {
  background-color: #e7f8fc;
}

/* ── Service chips (removable tags) ── */
.service-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background-color: #EBF5FB;
  border: 1px solid #AED6F1;
  border-radius: 2rem;
  padding: 0.3rem 0.75rem 0.3rem 1rem;
  font-size: 0.88rem;
  color: #1A5276;
  font-weight: 500;
}
.service-chip-remove {
  background: none;
  border: none;
  color: #2980B9;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.service-chip-remove:hover {
  color: #E74C3C;
}

/*css login*/

.login-card {
  background-color: white;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
}
.login-card h2 {
  color: #2C3E50;
  font-weight: 500;
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-card h2 i {
  color: #3498DB;
  margin-right: 0.5rem;
}
.form-label {
  font-weight: 500;
  color: #2C3E50;
}
.form-control {
  border-radius: 0.5rem;
  border: 1px solid #ced4da;
}
.form-control:focus {
  border-color: #3498DB;
  box-shadow: 0 0 0 0.2rem rgba(52,152,219,0.25);
}
.btn-login {
  background-color: #3498DB;
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  width: 100%;
  transition: background-color 0.2s;
}
.btn-login:hover {
  background-color: #5FAEE3;
  color: white;
}
.forgot-link {
  color: #3498DB;
  text-decoration: none;
  font-size: 0.9rem;
}
.forgot-link:hover {
  text-decoration: underline;
}
.create-account {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
.create-account a {
  color: #3498DB;
  font-weight: 500;
  text-decoration: none;
}
.create-account a:hover {
  text-decoration: underline;
}
.divider {
  display: flex;
  align-items: center;
  color: #95a5a6;
  margin: 1.5rem 0;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e0e0e0;
}
.divider span {
  padding: 0 0.8rem;
  font-size: 0.9rem;
}
.location-suggestions {
    position: absolute;
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    width: 100%;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.location-suggestions .suggestion-item {
    padding: 0.6rem 0.9rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2C3E50;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}
.location-suggestions .suggestion-item:last-child {
    border-bottom: none;
}
.location-suggestions .suggestion-item:hover {
    background-color: #EBF5FB;
}
.location-suggestions .suggestion-item i {
    color: #3498DB;
    margin-top: 2px;
    flex-shrink: 0;
}
.location-wrap {
    position: relative;
}
.location-loading {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #3498DB;
    font-size: 0.85rem;
}

/* ══════════════════════════════════════════════════════════════
   CHAT — two-pane messenger layout
   ══════════════════════════════════════════════════════════════ */

/* The chat tab replaces the normal padded content-area behaviour */
.content-area:has(.chat-layout) {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.chat-layout {
  display: flex;
  height: calc(100vh - 0px); /* full viewport within content pane */
  overflow: hidden;
}

/* ── Left pane: room list ─────────────────────────────────── */
.chat-rooms-pane {
  width: 280px;
  min-width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid #e0e6ed;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-rooms-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid #e0e6ed;
  background: #fff;
  flex-shrink: 0;
}

.chat-rooms-list {
  overflow-y: auto;
  flex: 1;
}

.chat-room-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f4f8;
  transition: background 0.15s;
  position: relative;
}
.chat-room-item:hover  { background: #f5f8fc; }
.chat-room-item.active { background: #EBF5FB; border-left: 3px solid #3498DB; }

.chat-room-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #D6EAF8;
  color: #2980B9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.chat-room-info { flex: 1; min-width: 0; }
.chat-room-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: #2C3E50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-room-date { font-size: 0.75rem; margin-top: 2px; }

.chat-unread-dot {
  background: #E74C3C;
  color: white;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Nav badge (sidebar) */
.chat-nav-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  background: #E74C3C;
  color: white;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* Loading skeleton */
.chat-rooms-loading { padding: 0.75rem 1rem; }
.chat-skeleton {
  height: 52px;
  background: linear-gradient(90deg, #f0f4f8 25%, #e4eaf0 50%, #f0f4f8 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.2s infinite;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.chat-empty-rooms {
  padding: 2rem 1rem;
  text-align: center;
  color: #95a5a6;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ── Right pane: message view ────────────────────────────── */
.chat-messages-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #F4F6F9;
}

.chat-no-room {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #95a5a6;
}

.chat-room-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Room header */
.chat-room-view-header {
  background: #fff;
  border-bottom: 1px solid #e0e6ed;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-room-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #D6EAF8;
  color: #2980B9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* Message scroll area */
.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Bubble rows */
.chat-bubble-row {
  display: flex;
}
.chat-bubble-row.mine   { justify-content: flex-end; }
.chat-bubble-row.theirs { justify-content: flex-start; }

.chat-bubble {
  max-width: 70%;
  padding: 0.55rem 0.9rem;
  border-radius: 1.1rem;
  position: relative;
  word-break: break-word;
}
.bubble-mine {
  background: #3498DB;
  color: white;
  border-bottom-right-radius: 0.25rem;
}
.bubble-theirs {
  background: #fff;
  color: #2C3E50;
  border: 1px solid #e0e6ed;
  border-bottom-left-radius: 0.25rem;
}
.bubble-content { font-size: 0.93rem; line-height: 1.45; }
.bubble-time {
  font-size: 0.68rem;
  margin-top: 3px;
  text-align: right;
  opacity: 0.65;
}
.bubble-mine   .bubble-time { color: rgba(255,255,255,0.8); }
.bubble-theirs .bubble-time { color: #95a5a6; }

/* Loading / empty in message area */
.chat-msg-loading,
.chat-msg-empty {
  text-align: center;
  color: #95a5a6;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}

/* Error banner above input */
.chat-error-banner {
  background: #fdecea;
  border-top: 1px solid #f5c6cb;
  color: #721c24;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Input row */
.chat-input-area {
  background: #fff;
  border-top: 1px solid #e0e6ed;
  padding: 0.85rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-shrink: 0;
}
.chat-textarea {
  flex: 1;
  resize: none;
  border-radius: 0.75rem;
  font-size: 0.93rem;
  min-height: 44px;
  max-height: 140px;
  overflow-y: auto;
  border-color: #d1dce8;
}
.chat-textarea:focus {
  border-color: #3498DB;
  box-shadow: 0 0 0 0.18rem rgba(52,152,219,0.2);
}
.chat-send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.chat-send-btn:disabled { opacity: 0.5; }

/* ── Responsive: stack panes on small screens ── */
@media (max-width: 768px) {
  .chat-layout { flex-direction: column; }
  .chat-rooms-pane {
    width: 100%;
    max-height: 220px;
    border-right: none;
    border-bottom: 1px solid #e0e6ed;
  }
  .content-area { padding-top: 4rem; }
}