:root {
  /* Scrollbar */
  --scrollbar-track: #2d2d2d;
  --scrollbar-thumb: #4d4d4d;
  --scrollbar-hover: #6d6d4d;

  /* Chat color scheme - Option 1: Pink theme matching index.html */
  --background: 0 0% 0%; /* Pure black like index.html */
  --foreground: 0 0% 100%;
  --card: 0 0% 5%;
  --card-foreground: 0 0% 98%;
  --popover: 0 0% 5%;
  --popover-foreground: 0 0% 98%;
  --primary: 340 82% 62%; /* Pink from index.html (#ff4081) */
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 8%; /* Dark gray for message bubbles */
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 15%;
  --muted-foreground: 0 0% 65%;
  --accent: 340 82% 62%; /* Pink accent */
  --accent-foreground: 0 0% 100%;
  --destructive: 0 85% 60%;
  --destructive-foreground: 0 0% 98%;
  --border: 0 0% 15%; /* Subtle borders */
  --input: 0 0% 12%;
  --ring: 340 82% 62%; /* Pink focus rings */

  /* Index.html colors - inherit from style.css */
  --primary-color: #ff4081;
  --primary-hover-color: #ffb3d1;
  --background-dark: #000000;
  --background-light: #ffffff;
  --text-primary: #000000;
  --text-secondary: #ffffff;
  --text-muted: #6b7280;
  --text-gray: #374151;
  --border-color: #e5e7eb;
  --border-dark: #4b5563;
  --header-background: rgba(0, 0, 0, 0.4);
  --header-text-color: #ffffff;
  --header-text-hover: var(--primary-color);
  --button-primary-bg: var(--primary-color);
  --button-primary-text: #ffffff;
  --button-primary-hover: var(--primary-hover-color);
  --button-secondary-bg: #ffffff;
  --button-secondary-text: var(--primary-color);
  --button-secondary-hover: #f3f4f6;
}

/* Ensure full viewport usage */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

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

@supports not (height: 100dvh) {
  html,
  body {
    height: 100vh;
  }
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-hover);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.hover-accent:hover {
  background: hsl(var(--accent)) !important;
}
.chat-item-active {
  background: hsl(var(--accent)) !important;
}

input,
textarea {
  border-color: hsl(var(--input)) !important;
  border-width: 1px !important;
}
input:focus-visible,
textarea:focus-visible {
  border-color: hsl(var(--ring)) !important;
  box-shadow: 0 0 0 1px hsl(var(--ring)) !important;
}

/* Mobile overlay */
.mobile-overlay {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* Page-like transition effects */
.section-transition {
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, opacity;
}

/* Mobile-first responsive sections */
.chat-selection-section {
  transform: translateX(0%) scale(1);
  opacity: 1;
}

.chat-section {
  transform: translateX(100%) scale(0.95);
  opacity: 0;
}

.profile-section {
  transform: translateX(100%) scale(0.9);
  opacity: 0;
  position: absolute;
}

/* Active states for mobile - page changing effect */
.chat-selection-active .chat-selection-section {
  transform: translateX(0%) scale(1);
  opacity: 1;
  z-index: 50;
}
.chat-selection-active .chat-section {
  transform: translateX(100%) scale(0.95);
  opacity: 0;
  z-index: 30;
}
.chat-selection-active .profile-section {
  transform: translateX(100%) scale(0.9);
  opacity: 0;
  z-index: 20;
}

.chat-active .chat-selection-section {
  transform: translateX(-100%) scale(0.95);
  opacity: 0;
  z-index: 20;
}
.chat-active .chat-section {
  transform: translateX(0%) scale(1);
  opacity: 1;
  z-index: 50;
}
.chat-active .profile-section {
  transform: translateX(100%) scale(0.95);
  opacity: 0;
  z-index: 30;
}

.profile-active .chat-selection-section {
  transform: translateX(-100%) scale(0.9);
  opacity: 0;
  z-index: 20;
}
.profile-active .chat-section {
  transform: translateX(-100%) scale(0.95);
  opacity: 0;
  z-index: 30;
}
.profile-active .profile-section {
  transform: translateX(0%) scale(1);
  opacity: 1;
  z-index: 50;
}

/* Desktop overrides */
@media (min-width: 1024px) {
  .chat-selection-section,
  .chat-section,
  .profile-section {
    transform: translateX(0%) !important;
    position: static !important;
    z-index: auto !important;
    opacity: 1 !important;
    display: flex !important;
  }

  .profile-hidden .profile-section {
    display: none !important;
  }

  .profile-hidden .chat-section {
    flex: 1;
    max-width: none;
  }
}

/* Mobile specific */
@media (max-width: 1023px) {
  .section-container {
    position: relative;
    overflow: hidden;
    height: 100vh;
    max-height: 100vh;
  }

  .chat-selection-section,
  .chat-section,
  .profile-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    z-index: 10;
    overflow: hidden;
  }

  .mobile-hidden {
    display: none !important;
  }
  .mobile-full {
    width: 100% !important;
  }
}

/* Profile section specific styles */
.profile-bg {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}

.tab-active {
  border-bottom: 2px solid hsl(var(--primary));
  color: hsl(var(--foreground));
}

.tab-inactive {
  color: hsl(var(--muted-foreground));
}

.attribute-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}

.attribute-icon {
  background: #13131f;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.scrollbar-hide {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

/* Optimized profile section styles */
.profile-section {
  contain: strict;
  overflow-y: visible;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  perspective: 1000px;
  max-height: none;
  height: auto;
  min-height: calc(100vh - 80px);
}

.profile-content-container {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  contain: content;
}

.profile-section img {
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform;
  image-rendering: -webkit-optimize-contrast;
}

/* Remove all other will-change declarations from profile section children */
.profile-section * {
  will-change: auto;
  transform-style: flat;
}

/* Force GPU acceleration for smooth scrolling */
.profile-section > div {
  transform: translate3d(0, 0, 0);
}

/* Fix for background image container */
.profile-bg-container {
  position: relative;
  overflow: hidden;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

.profile-bg-container img {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
}

/* Like and Favorite button styles */
.like-btn,
.favorite-btn {
  border: none;
  background: transparent;
}

.like-btn:hover,
.favorite-btn:hover {
  background: hsl(340 82% 65%) !important;
}

.like-btn.liked .like-icon,
.favorite-btn.favorited .favorite-icon {
  color: white !important;
}

.like-btn.liked .like-icon::before {
  content: "\f004"; /* fas fa-heart */
  font-weight: 900;
}

.favorite-btn.favorited .favorite-icon::before {
  content: "\f005"; /* fas fa-star */
  font-weight: 900;
}

/* Loading dots animation */
.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.loading-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: loading-dots 1.4s infinite ease-in-out;
}

.loading-dots .dot:nth-child(1) {
  animation-delay: 0s;
}
.loading-dots .dot:nth-child(2) {
  animation-delay: 0.2s;
}
.loading-dots .dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes loading-dots {
  0%,
  80%,
  100% {
    opacity: 0.4;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Tip Modal and General Button Hover Styles */
.modal button:hover,
.tip-modal button:hover,
button[class*="tip"]:hover,
button[class*="modal"]:hover {
  background: hsl(340 82% 65%) !important;
}

/* Cancel button dimmer hover */
button[class*="cancel"]:hover,
button[onclick*="cancel"]:hover,
.cancel-btn:hover,
.btn-cancel:hover {
  background: hsl(0 0% 40%) !important;
  color: hsl(0 0% 80%) !important;
}

/* Like and Favorite icon colors */
.like-btn .like-icon,
.favorite-btn .favorite-icon {
  color: hsl(340 82% 65%) !important;
}

.like-btn:hover .like-icon,
.favorite-btn:hover .favorite-icon {
  color: white !important;
}

/* Additional button hover styles for any pink buttons */
button[style*="340"],
button[style*="#ff4081"],
.btn-pink:hover,
.button-pink:hover {
  background: hsl(340 82% 75%) !important;
}

/* Textarea text color - dark pink */
textarea {
  color: hsl(340 82% 35%) !important;
}
