/* ==========================================================================
   PAGE-SPECIFIC STYLES (DARK THEME, PHOTO GALLERIES, CLEAN CHAT BUBBLES)
   ========================================================================== */

/* Service List Cards */
.service-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.service-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.service-avatar {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
  border: 1px solid var(--chip-border);
  color: #93C5FD;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.service-avatar-lg {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  font-size: 20px;
}

.service-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.service-meta {
  min-width: 0;
  flex: 1;
}

.service-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.service-rating-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
  gap: 3px;
}

.rating-big-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

/* Sort bar in Catalog */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 12px;
}

.sort-bar-label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-select {
  border: none;
  background: transparent;
  color: #60A5FA;
  font-weight: 600;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  text-align: right;
  max-width: 190px;
}

/* Service Detail */
.service-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.rating-summary-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.rating-hero-score {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.criteria-breakdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.criteria-breakdown-row:last-child { border-bottom: none; }

/* Review Photos Gallery */
.photo-thumbs-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.photo-thumb-wrap {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  flex-shrink: 0;
}

.photo-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s var(--ease-smooth);
}
.photo-thumb-img:hover { transform: scale(1.05); }

.photo-thumb-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #FCA5A5;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Wizard Step 4 criterion row */
.criterion-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.criterion-rate-row:last-child { border-bottom: none; }

.criterion-rate-left { min-width: 0; flex: 1; }

.criterion-rate-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.criterion-rate-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.criterion-rate-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex-shrink: 0;
}

.not-tested-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  transition: all 0.18s ease;
}

.not-tested-btn.active {
  color: var(--chip-text);
  border-color: var(--primary);
  background: var(--chip-bg);
}

/* Upload dropbox */
.upload-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 15px 12px;
  border-radius: 12px;
  border: 1.5px dashed rgba(96, 165, 250, 0.45);
  background-color: var(--surface-subtle);
  color: #60A5FA;
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  width: 100%;
  transition: all 0.2s var(--ease-smooth);
}
.upload-card-btn:hover { background-color: var(--surface-elevated); }
.upload-card-btn.active {
  border-style: solid;
  border-color: var(--primary);
  background-color: var(--chip-bg);
  color: var(--chip-text);
}

/* ==========================================================================
   SUPPORT CHAT (CLEAN COMPACT BUBBLES + PHOTO ATTACHMENTS)
   ========================================================================== */
.support-chat-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  margin-right: 5px;
  vertical-align: middle;
}
.status-dot.online { background: #4ADE80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }
.status-dot.offline { background: #64748B; }

.chat-topbar {
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: #60A5FA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-avatar svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.chat-feed {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: var(--app-bg);
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: fit-content;
  min-width: 68px;
  max-width: 82%;
  flex-shrink: 0;
  padding: 9px 12px;
  border-radius: 16px;
  font-size: 13.5px;
  animation: bubbleIn 0.2s var(--ease-smooth) both;
}

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

.chat-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}

.chat-msg.from-support {
  align-self: flex-start;
  background-color: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 5px;
}

.chat-msg.from-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  border-bottom-right-radius: 5px;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.25);
}

.chat-attachments-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.chat-attachments-grid.single {
  grid-template-columns: 1fr;
}

.chat-attachment-img {
  width: 100%;
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.chat-msg-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  font-size: 10px;
  opacity: 0.78;
  line-height: 1;
}

.chat-msg-status {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.chat-msg-status.is-read {
  color: #BAE6FD;
}

.chat-attachment-preview-bar {
  padding: 8px 12px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--chip-text);
  flex-shrink: 0;
}

.chat-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  max-width: 180px;
}

.chat-preview-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-chat-fullscreen {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  height: 100%;
  min-height: 0;
  background: var(--app-bg);
  overflow: hidden;
}

.admin-chat-fullscreen .chat-composer {
  padding-bottom: calc(9px + var(--tg-bottom-inset, 0px));
}

html.is-keyboard-open .admin-chat-fullscreen .chat-composer {
  padding-bottom: 9px;
}

.chat-unread-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 4px;
  color: #93C5FD;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.chat-unread-divider::before,
.chat-unread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.45), transparent);
}

.chat-unread-divider span {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.chat-composer {
  padding: 9px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.chat-attach-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.chat-attach-btn:hover { color: var(--text-primary); border-color: var(--primary); }

.chat-input {
  flex: 1;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  border-radius: 18px;
  padding: 8px 13px;
  font-size: 14.5px;
  color: var(--text-primary);
  outline: none;
  min-height: 36px;
  max-height: 100px;
  overflow-y: auto;
  resize: none;
  line-height: 1.35;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.chat-input:focus {
  border-color: var(--primary);
  background: var(--surface-elevated);
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.chat-send-btn:hover { filter: brightness(1.08); }
.chat-send-btn:active:not(:disabled) { transform: scale(0.92); }
.chat-send-btn:disabled { background: #1E3A5F; opacity: 0.6; cursor: not-allowed; }

/* ==========================================================================
   ADMIN PANEL
   ========================================================================== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #60A5FA;
  line-height: 1.15;
}

.admin-tabs-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  cursor: grab;
  user-select: none;
  scrollbar-width: none;
}
.admin-tabs-scroll:active { cursor: grabbing; }
.admin-tabs-scroll::-webkit-scrollbar { display: none; }

@media (hover: hover) and (pointer: fine) {
  .admin-tabs-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  }
  .admin-tabs-scroll::-webkit-scrollbar {
    display: block;
    height: 5px;
  }
  .admin-tabs-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
  }
}

.evidence-preview-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
}

.lightbox-img {
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-subtle);
}

/* Review likes / dislikes */
.vote-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.16s ease;
}

.vote-btn:active {
  transform: scale(0.95);
}

.vote-btn.active-like {
  background: var(--badge-green-bg);
  color: var(--badge-green-text);
  border-color: var(--badge-green-border);
}

.vote-btn.active-dislike {
  background: var(--badge-red-bg);
  color: var(--badge-red-text);
  border-color: var(--badge-red-border);
}
