/* ========== Chat Container ========== */
.chat-container {
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 80px;
  box-sizing: border-box;
  background: transparent;
  position: relative;
  z-index: 1;
}

@media (max-height: 700px) {
  .chat-container {
    padding-top: 20px;
    padding-bottom: 20px;
    align-items: flex-start;
    overflow-y: auto;
  }
}

/* ========== State Management ========== */
.chat-panel {
  display: none !important;
}

.chat-panel.active {
  display: flex !important;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.btn-action-light:hover {
  background: var(--text-primary) !important;
  color: #fff !important;
  border-color: var(--text-primary) !important;
}

.btn-action-light:hover i {
  color: #fff !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Preferences Panel ========== */
#preferences-panel {
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

@media (max-width: 1024px) {
  #preferences-panel {
    max-height: 100vh;
  }
}

.preferences-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(229, 229, 229, 0.5);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
}

.preferences-card h2 {
  text-align: left;
  margin-bottom: 32px;
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.5px;
}

.preferences-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: -18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: -15px;
}

.preferences-header h2 {
  margin: 0 !important;
  display: flex;
  align-items: center;
  font-size: 1.75rem !important;
}

.preferences-header .header-icon {
  margin-right: 12px;
  color: var(--accent-cyan);
  width: 28px;
  height: 28px;
}

@media (max-height: 700px) {
  .preferences-card {
    padding: 24px;
  }
  .preferences-card h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
  }
  .form-group {
    margin-bottom: 16px;
  }
}

@media (max-height: 500px) {
  .preferences-header {
    margin-bottom: 16px;
    padding-bottom: 8px;
  }

  .preferences-header h2 {
    font-size: 1.2rem !important;
  }

  .form-group label {
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .preferences-header h2 {
    margin: 0 !important;
    display: flex;
    align-items: center;
    font-size: 1.4rem !important;
  }
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-family: var(--font-head);
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--text-primary);
}

.form-group input::placeholder {
  color: var(--text-secondary);
}

/* Badge Selection (Age/Gender) */
.badges-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.badges-options input[type="radio"],
.badges-options input[type="checkbox"] {
  display: none;
}

.badges-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.badge-icon-sm {
  width: 16px;
  height: 16px;
  opacity: 0.8;
}

.badges-options label:hover {
  background: rgba(10, 10, 10, 0.03);
  border-color: var(--text-primary);
  font-weight: 700;
}

.badges-options label:hover .badge-icon-sm {
  opacity: 1;
}

/* Ensure active (green) labels maintain their color on hover but get bolder */
.badges-options input[type="radio"]:checked + label:hover,
.badges-options input[type="checkbox"]:checked + label:hover {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: #10b981;
  font-weight: 700;
}

.badges-options input[type="radio"]:checked + label,
.badges-options input[type="checkbox"]:checked + label {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: #10b981;
  font-weight: 500;
}

.form-submit {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.form-submit button {
  width: 100%;
  max-width: none;
}

/* Full width buttons with centered text */
#start-chat-btn,
#create-room-btn,
#join-room-btn {
  width: 100%;
  max-width: none;
  text-align: center;
}

/* ========== Room Features ========== */
.room-mode-toggle {
  display: none;
}

.room-actions {
  display: none !important;
}

#mode-room {
  display: none !important;
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.mode-btn.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

.mode-btn i {
  width: 18px;
  height: 18px;
}

/* Room Actions */
.room-actions {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.room-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.room-tab {
  flex: 1;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.room-tab:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.room-tab.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: white;
}

.room-panel {
  display: none;
}

.room-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* Room Input */
.room-input-wrapper {
  display: flex;
  gap: 8px;
}

.room-input-wrapper input {
  flex: 1;
}

.room-input-wrapper .btn-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.room-input-wrapper .btn-icon:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.input-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 8px;
  margin-bottom: 0;
}

/* Room Status */
.room-status {
  margin-top: 16px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.status-badge.info {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.status-badge.success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-badge i {
  width: 16px;
  height: 16px;
}

/* Room Info Badge */
.room-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* ========== Partner Details Bar ========== */
.partner-details-bar {
  background: var(--bg-secondary);
  padding: 0 24px;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.partner-details-bar::-webkit-scrollbar {
  display: none;
}

.details-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-chip {
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-chip:hover {
  transform: translateY(-1px);
}

/* Categorized Chips */
.detail-chip.gender-male {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
  border-color: rgba(37, 99, 235, 0.3);
}

.detail-chip.gender-female {
  background: rgba(219, 39, 119, 0.15);
  color: #f472b6;
  border-color: rgba(219, 39, 119, 0.3);
}

.detail-chip.gender-non-binary {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  border-color: rgba(124, 58, 237, 0.3);
}

.detail-chip.age-chip {
  background: rgba(5, 150, 105, 0.15);
  color: #34d399;
  border-color: rgba(5, 150, 105, 0.3);
}

.detail-chip.interest-chip {
  background: rgba(202, 138, 4, 0.15);
  color: #fbbf24;
  border-color: rgba(202, 138, 4, 0.3);
}

.detail-chip.muted {
  opacity: 0.5;
  font-weight: 400;
  font-style: italic;
}

.chip-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.partner-details-bar .interest-tag {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.15);
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ========== Searching Panel ========== */
#searching-panel {
  text-align: center;
  padding: 80px 24px;
}

.searching-animation {
  width: 120px;
  height: 120px;
  margin: 0 auto 40px;
  position: relative;
}

.searching-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid var(--accent-cyan);
  animation: ripple 2s infinite ease-out;
}

.searching-ring:nth-child(1) {
  width: 40px;
  height: 40px;
  animation-delay: 0s;
}

.searching-ring:nth-child(2) {
  width: 80px;
  height: 80px;
  animation-delay: 0.5s;
}

.searching-ring:nth-child(3) {
  width: 120px;
  height: 120px;
  animation-delay: 1s;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

.searching-text {
  font-family: var(--font-head);
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.searching-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
}

/* ========== Chatting Panel ========== */
#chatting-panel {
  width: 100%;
  max-width: 1000px;
  height: 95vh;
}

/* Partner Left Banner */
.partner-left-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.partner-left-banner p {
  color: #ef4444;
  margin: 0;
  font-weight: 500;
}

.partner-left-banner.hidden {
  display: none;
}

/* Active Chat Wrapper (Mockup Style) */
.active-chat-wrapper {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(229, 229, 229, 0.5);
  border-radius: var(--radius-lg);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Header */
.chat-mock-header {
  background: var(--text-primary);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-info-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.chat-header-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.1rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.5px;
}

.chat-header-actions {
  display: flex;
  gap: 12px;
}

.btn-action-light {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-light:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.chat-avatar {
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.2rem;
}

.chat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-info h5 {
  margin: 0;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-head);
}

.chat-header-status-row {
  margin: 0;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.status-indicator .badge-dot {
  width: 8px;
  height: 8px;
}

@media (max-width: 600px) {
  .chat-mock-header {
    padding: 8px 12px; /* Reduced padding */
  }

  .chat-info-block {
    gap: 12px;
  }

  .chat-avatar {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .chat-info h5 {
    font-size: 0.9rem;
  }

  .btn-action-light {
    width: 34px;
    height: 34px;
  }

  .partner-details-bar {
    margin: 8px 0;
    padding: 0 16px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 0;
    display: flex;
    justify-content: center;
    box-shadow: none;
    position: relative;
  }

  .details-chips {
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    /* Center info on mobile */
  }

  .detail-chip {
    padding: 8px 16px;
    font-size: 0.75rem;
    border-radius: 50px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
  }

  .chip-divider {
    display: none;
  }
}

.partner-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.interest-tag {
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Body / Messages Container */
.chat-mock-body {
  padding: 8px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: transparent;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}

/* Partner Info Banner in Messages Area */
.partner-info-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin: 8px 0 16px 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(250,250,250,0.95) 100%);
  border-radius: 16px;
  animation: slideDown 0.4s ease;
}

.partner-info-banner.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.partner-info-banner .banner-flag {
  font-size: 1.4rem;
  margin-right: 4px;
}

.partner-info-banner .banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.2s ease;
}

.partner-info-banner .banner-badge:hover {
  transform: translateY(-1px);
}

/* Gender badges */
.partner-info-banner .badge-gender-male {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.partner-info-banner .badge-gender-female {
  background: rgba(219, 39, 119, 0.12);
  color: #db2777;
}

.partner-info-banner .badge-gender-nonbinary {
  background: rgba(124, 58, 237, 0.12);
  color: #7c3aed;
}

.partner-info-banner .badge-gender-unknown {
  background: rgba(107, 114, 128, 0.12);
  color: #6b7280;
}

/* Age badge */
.partner-info-banner .badge-age {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

/* Interest badges */
.partner-info-banner .badge-interest {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.partner-info-banner .banner-divider {
  width: 1px;
  height: 16px;
  background: rgba(0,0,0,0.1);
  margin: 0 4px;
}

@media (max-width: 600px) {
  .chat-header-title {
    font-size: 0.95rem;
  }
  
  .partner-info-banner {
    padding: 10px 12px;
    gap: 8px;
    margin: 4px 0 12px 0;
  }
  
  .partner-info-banner .banner-badge {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  
  .partner-info-banner .banner-flag {
    font-size: 1.2rem;
  }
  
  .partner-info-banner .banner-divider {
    display: none;
  }
}

.chat-mock-body::-webkit-scrollbar {
  display: none;
}

.message {
  display: flex;
  max-width: 78%;
  margin-bottom: 4px;
}

.message:first-child {
  margin-top: 8px;
}

.message.own {
  margin-left: auto;
  justify-content: flex-end;
}

.message.partner {
  margin-right: auto;
}

.message-bubble {
  position: relative;
  padding: 8px 16px 4px;
  border-radius: 100px;
  word-break: break-word;
  font-size: 0.88rem;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.message-bubble.multiline {
  border-radius: 16px;
}

.message.own .message-bubble {
  background: var(--text-primary);
  color: white;
}

.message.partner .message-bubble {
  background: var(--bg-primary);
  border: 1px solid var(--border);
}

.message-content {
  margin-bottom: 4px;
}

.message-content p {
  margin: 0;
  color: inherit;
}

.message-image {
  max-width: 280px;
  max-height: 400px;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  display: block;
}

.media-message-wrapper {
  position: relative;
  line-height: normal;
  display: flex;
  flex-direction: column;
  margin-top: 4px;
}

.message-image:hover {
  transform: translateY(-2px);
}

.message-audio {
  width: 280px;
  height: 48px;
  filter: invert(0.9) hue-rotate(180deg) brightness(1.2);
  /* Techy dark theme for native audio */
  border-radius: 50px;
  opacity: 0.9;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 2px;
}

.message.own .message-meta {
  justify-content: flex-end;
}

.message-likes {
  color: var(--accent-pink);
}

.message-likes.active {
  font-weight: 500;
}

/* Message Actions - Hidden by default, show on hover */
.message-actions {
  position: absolute;
  top: -14px;
  display: flex;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: white;
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  z-index: 10;
  transform: translateY(4px);
}

.message.own .message-actions {
  right: 12px;
}

.message.partner .message-actions {
  left: 12px;
}

.message:hover .message-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.action-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  transition: all 0.2s ease;
}

.action-btn i {
  width: 10px;
  height: 10px;
  margin: 0 1px;
  stroke-width: 2px;
  transition: stroke-width 0.2s;
}

.action-btn:hover {
  background: transparent;
  color: var(--text-primary);
}

.action-btn:hover i {
  stroke-width: 3.5px;
}

.action-btn.like-btn.active {
  color: var(--accent-pink);
}

.action-btn.like-btn.active i {
  fill: currentColor;
}

.action-btn.delete-btn:hover {
  background: #fee2e2;
  color: #ef4444;
}

/* Double Click Heart Animation */
.heart-burst {
  position: absolute;
  pointer-events: none;
  font-size: 2rem;
  animation: heart-burst-anim 0.8s ease-out forwards;
  z-index: 100;
  user-select: none;
}

@keyframes heart-burst-anim {
  0% {
    transform: scale(0) rotate(-15deg);
    opacity: 0;
  }

  25% {
    transform: scale(1.2) rotate(0deg);
    opacity: 1;
  }

  50% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: scale(1.5) rotate(15deg);
    opacity: 0;
    translatey: (-40px);
  }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.typing-dots {
  display: flex;
  gap: 4px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

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

@keyframes typingBounce {
  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Input Area */
.chat-mock-input {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-primary);
  width: 100%;
}

@media (max-width: 768px) {
  .chat-mock-input {
    padding: 10px 12px !important;
  }

  .input-wrapper {
    gap: 4px !important;
    padding: 4px 6px !important;
  }

  .mock-input-field {
    font-size: 0.9rem !important;
  }

  .input-btn,
  .mock-send-btn {
    width: 32px !important;
    height: 32px !important;
  }
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 6px 8px;
  width: 100%;
  gap: 8px;
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  border-color: var(--text-primary);
  background: var(--bg-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.input-media-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
}

.mock-input-field {
  flex: 1;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s;
}

.mock-input-field:focus {
  outline: none;
  border-color: var(--border);
  background: var(--bg-primary);
}

.mock-input-field::placeholder {
  color: var(--text-secondary);
}

.input-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.input-btn i {
  transition: all 0.2s ease;
}

.input-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.input-btn:hover i {
  stroke-width: 2.8px;
}

.input-btn.recording {
  background: #ef4444;
  border-color: #ef4444;
  color: white;
  animation: pulse 1s infinite;
}

.mock-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
  transition: all 0.2s ease;
}

.mock-send-btn i {
  width: 11px;
  height: 11px;
  margin-left: 1px;
  transition: transform 0.2s ease;
}

.mock-send-btn:hover {
  background: #262626;
  color: #fff;
  transform: scale(1.08);
}

.mock-send-btn:hover i {
  transform: translateX(2px) translateY(-1px);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox img {
  position: relative;
  z-index: 1;
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--glass);
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .chat-container {
    padding: 16px 40px;
  }
}

@media (max-width: 768px) {
  html,
  body {
    height: 100%;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: fixed;
    width: 100%;
  }

  .chat-container {
    padding: 0;
    height: 100dvh;
    width: 100%;
  }

  #chatting-panel,
  #preferences-panel,
  #searching-panel {
    height: 100%;
    max-height: 100%;
    width: 100%;
    border-radius: 0;
    border: none;
    margin: 0;
    overflow: hidden;
  }

  .chat-container {
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .active-chat-wrapper {
    border-radius: 0;
    border: none;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .preferences-card {
    border-radius: 0;
    border: none;
    height: 100%;
    overflow-y: auto;
    padding: 24px 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }

  #searching-panel {
    border-radius: 0;
    border: none;
    height: 100%;
    overflow-y: auto;
    padding: 24px 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .preferences-card {
    align-items: stretch;
    /* Form fields should stretch */
  }

  .preferences-card h2 {
    font-size: 1.5rem;
  }

  .badges-options {
    flex-wrap: wrap;
  }

  .badges-options label {
    padding: 8px 16px;
    font-size: 0.85rem;
  }

  .message {
    max-width: 90%;
  }

  .partner-header {
    flex-direction: column;
    text-align: center;
  }

  .chat-actions {
    flex-wrap: wrap;
  }
}

/* Recording Overlay & Waveform */
#recording-overlay {
  background: transparent;
  z-index: 5;
}

.rec-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.rec-wave span {
  width: 3px;
  height: 100%;
  background: #ef4444;
  border-radius: 3px;
  animation: wave 0.8s ease-in-out infinite;
}

.rec-wave span:nth-child(2) {
  animation-delay: 0.1s;
}

.rec-wave span:nth-child(3) {
  animation-delay: 0.2s;
}

.rec-wave span:nth-child(4) {
  animation-delay: 0.3s;
}

.rec-wave span:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes wave {
  0%,
  100% {
    transform: scaleY(0.4);
  }

  50% {
    transform: scaleY(1);
  }
}

.rec-timer {
  color: #ef4444;
  /* High visibility red */
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  min-width: 50px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Input Background Animation */
.chat-mock-input {
  position: relative;
  overflow: hidden;
}

.input-bg-animation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

.input-bg-animation svg {
  width: 100%;
  height: 100%;
}

.blob-1 {
  animation: float-blob-1 15s ease-in-out infinite;
  filter: blur(10px);
}

.blob-2 {
  animation: float-blob-2 20s ease-in-out infinite;
  filter: blur(15px);
}

@keyframes float-blob-1 {
  0%,
  100% {
    cx: 10%;
    cy: 50%;
    opacity: 0.2;
  }

  50% {
    cx: 20%;
    cy: 40%;
    opacity: 0.3;
  }
}

@keyframes float-blob-2 {
  0%,
  100% {
    cx: 90%;
    cy: 50%;
    opacity: 0.2;
  }

  50% {
    cx: 80%;
    cy: 60%;
    opacity: 0.3;
  }
}

/* Ensure content stays on top */
.mock-input-field,
.input-actions {
  position: relative;
  z-index: 1;
}

.trash-btn-premium {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: none;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.trash-btn-premium:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.05);
}

.trash-btn-premium i {
  width: 18px;
  height: 18px;
}

.rec-badge {
  font-size: 0.7rem;
  color: #ef4444;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: rgba(239, 68, 68, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
  animation: pulse 1s infinite alternate;
}

/* ========== Message Status Icons ========== */
.message-status {
  display: inline-flex;
  align-items: center;
  position: relative;
  height: 12px;
}

.status-icon {
  width: 12px;
  height: 12px;
  color: #9ca3af;
  flex-shrink: 0;
  stroke-width: 2.5px;
}

.status-icon.read,
.status-icon.sent {
  color: #9ca3af;
}

/* Double tick for read messages - two overlapping check marks */
.message-status.read {
  width: 18px;
}

.message-status.read .status-icon {
  position: absolute;
  left: 0;
}

.message-status.read .status-icon::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0;
  width: 12px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
}

.audio-pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--text-primary);
  border-radius: 50%;
  animation: pulse 1s infinite;
}

/* ========== Room Features Responsive ========== */
@media (max-width: 768px) {
  .room-mode-toggle {
    flex-direction: row;
    gap: 8px;
  }

  .mode-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
  }

  .mode-btn i {
    width: 16px;
    height: 16px;
  }

  .room-actions {
    padding: 16px;
  }

  .room-tabs {
    flex-direction: row;
    gap: 8px;
  }

  .room-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.85rem;
    min-width: 0;
  }

  .room-input-wrapper {
    flex-direction: column;
  }

  .room-input-wrapper .btn-icon {
    width: 100%;
    height: 44px;
  }
}

@media (max-width: 480px) {
  .room-mode-toggle {
    gap: 6px;
  }

  .mode-btn {
    padding: 8px 8px;
    font-size: 0.8rem;
  }

  .mode-btn i {
    width: 14px;
    height: 14px;
  }

  .room-tabs {
    gap: 6px;
  }

  .room-tab {
    padding: 8px 8px;
    font-size: 0.8rem;
  }
  
  /* Chat header optimizations */
  .chat-mock-header {
    padding: 10px 12px;
    min-height: 52px;
  }
  
  .chat-header-title {
    font-size: 0.9rem;
    letter-spacing: 0.3px;
  }
  
  .chat-header-actions {
    gap: 8px;
  }
  
  .btn-action-light {
    width: 36px;
    height: 36px;
  }
  
  .btn-action-light i {
    width: 18px;
    height: 18px;
  }
  
  /* Partner info banner - more compact */
  .partner-info-banner {
    padding: 8px 10px;
    gap: 6px;
    margin: 4px 0 10px 0;
    border-radius: 12px;
  }
  
  .partner-info-banner .banner-badge {
    padding: 4px 10px;
    font-size: 0.7rem;
    gap: 4px;
  }
  
  .partner-info-banner .banner-flag {
    font-size: 1.1rem;
  }
  
  /* Messages - smaller bubbles */
  .chat-mock-body {
    padding: 6px 12px 12px;
  }
  
  .message {
    max-width: 92%;
    margin-bottom: 3px;
  }
  
  .message:first-child {
    margin-top: 4px;
  }
  
  .message-bubble {
    padding: 6px 12px 3px;
    font-size: 0.85rem;
    line-height: 1.4;
  }
  
  .message-meta {
    font-size: 0.65rem;
    gap: 4px;
  }
  
  /* Input area - more compact */
  .chat-mock-input {
    padding: 10px 12px;
  }
  
  .input-wrapper {
    padding: 4px 6px;
    gap: 4px;
    border-radius: 24px;
  }
  
  .mock-input-field {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
  
  .input-btn {
    width: 34px;
    height: 34px;
  }
  
  .input-btn i {
    width: 18px;
    height: 18px;
  }
  
  .mock-send-btn {
    width: 38px;
    height: 38px;
  }
  
  .mock-send-btn i {
    width: 10px;
    height: 10px;
  }
  
  /* Typing indicator - smaller */
  .typing-indicator {
    padding: 8px 14px;
    font-size: 0.8rem;
    gap: 8px;
  }
  
  .typing-dots span {
    width: 5px;
    height: 5px;
  }
  
  /* Message images - smaller */
  .message-image {
    max-width: 220px;
    max-height: 320px;
  }
  
  /* Message audio - smaller */
  .message-audio {
    width: 220px;
    height: 40px;
  }
}

/* Extra small screens - 360px and below */
@media (max-width: 360px) {
  .chat-mock-header {
    padding: 8px 10px;
    min-height: 48px;
  }
  
  .chat-header-title {
    font-size: 0.85rem;
  }
  
  .btn-action-light {
    width: 32px;
    height: 32px;
  }
  
  .btn-action-light i {
    width: 16px;
    height: 16px;
  }
  
  /* Partner banner - single row scrollable */
  .partner-info-banner {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 6px 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  
  .partner-info-banner::-webkit-scrollbar {
    display: none;
  }
  
  .partner-info-banner .banner-badge {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 0.65rem;
  }
  
  /* Input - hide labels, show only icons */
  .input-wrapper {
    padding: 3px 5px;
  }
  
  .input-media-group {
    gap: 2px;
  }
  
  .input-btn {
    width: 32px;
    height: 32px;
  }
  
  .mock-send-btn {
    width: 34px;
    height: 34px;
  }
  
  /* Messages - full width bubbles */
  .message {
    max-width: 94%;
  }
  
  .message-bubble {
    padding: 5px 10px 2px;
    font-size: 0.82rem;
  }
  
  /* Message actions - hidden on mobile, show on hover */
  .message-actions {
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    padding: 4px 10px;
    gap: 6px;
  }
  
  .action-btn {
    width: 20px;
    height: 20px;
  }
  
  .action-btn i {
    width: 12px;
    height: 12px;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .message-actions {
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    background: rgba(255, 255, 255, 0.95);
  }
  
  .message:hover .message-actions,
  .message:focus-within .message-actions {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Read Receipt Status Icons ========== */
.message-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 14px;
  width: 16px;
}

.status-icon {
  width: 14px;
  height: 14px;
  transition: all 0.3s ease;
}

.status-icon.sent {
  color: var(--text-secondary);
  opacity: 0.6;
}

.status-icon.delivered {
  color: var(--text-secondary);
  opacity: 0.8;
}

.status-icon.read {
  color: #10b981; /* Green for read */
  opacity: 1;
}

/* Double check (check-check) icon sizing */
.status-icon[data-lucide="check-check"] {
  width: 16px;
  height: 16px;
}
