:root {
  --primary-color: #76B5AF;
  /* Muted Teal from screenshot */
  --primary-dark: #5A8F8A;
  --background-color: #F7F9F9;
  --splash-bg: #F2F7F5;
  /* Pastel Pink from screenshot */
  --text-dark: #1A1A1A;
  --text-medium: #666666;
  --text-light: #999999;
  --white: #FFFFFF;
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --border-radius: 16px;
  --nav-height: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--background-color);
  color: var(--text-dark);
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
  /* Prevent body scroll, handle in sections */
}

/* Typography */
h1,
h2,
h3 {
  color: var(--text-dark);
}

.font-serif {
  font-family: 'Playfair Display', serif;
}

/* Splash Screen */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--splash-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 2rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.splash-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.splash-image {
  width: 100%;
  max-width: 320px;
  margin-bottom: 2rem;
  border-radius: 20px;
}

.splash-logo {
  font-size: 3rem;
  font-weight: 700;
  color: #3D3D3D;
  margin-bottom: 0.5rem;
}

.splash-tagline {
  font-size: 1.1rem;
  color: #555;
  text-align: center;
  max-width: 280px;
  font-weight: 400;
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 1rem 0;
  width: 100%;
  border-radius: 30px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(118, 181, 175, 0.3);
  transition: transform 0.2s;
}

.btn-primary:active {
  transform: scale(0.98);
}

.login-link {
  margin-top: 1rem;
  color: #3D3D3D;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
}

/* Main App Container */
#app-container {
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.5s ease;
}

/* Header */
.app-header {
  padding: 1.5rem 1.5rem 0.5rem;
  background: var(--background-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.location-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.location-text {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.location-icon {
  color: var(--text-dark);
}

.filter-icon {
  color: var(--text-dark);
  font-size: 1.2rem;
  cursor: pointer;
}

.search-bar {
  position: relative;
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  border: none;
  border-radius: 16px;
  background-color: #E8F0F0;
  /* Light greenish grey */
  font-size: 1rem;
  color: var(--text-dark);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-medium);
}

/* Content Area */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 1rem 100px;
  /* Bottom padding for nav */
  scrollbar-width: none;
  /* Firefox */
}

.content-area::-webkit-scrollbar {
  display: none;
  /* Chrome/Safari */
}

/* Categories */
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 1rem;
  padding: 0 0.5rem;
}

.categories-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.category-icon {
  width: 64px;
  height: 64px;
  background-color: var(--white);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s;
}

.category-item.active .category-icon {
  background-color: var(--primary-color);
  color: white;
}

.category-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-medium);
}

.category-item.active .category-label {
  color: var(--primary-color);
}

/* Pet Grid */
.pet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pet-card {
  background: transparent;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.pet-card:active {
  transform: scale(0.98);
}

.pet-image-container {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 0.75rem;
  background-color: #E0E0E0;
  position: relative;
}

.pet-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-info h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.pet-distance {
  font-size: 0.9rem;
  color: var(--primary-color);
  font-weight: 500;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  background: var(--white);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  padding-bottom: 10px;
  /* Safe area for modern phones */
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  color: #C4C4C4;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s;
}

.nav-item i {
  font-size: 1.5rem;
}

.nav-item.active {
  color: var(--text-dark);
}

/* Screen Visibility */
.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: block;
}

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

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

/* Chat Screen Styles */
.chat-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem;
  background: white;
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  min-height: 70px;
}

.chat-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.chat-name {
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-preview {
  font-size: 0.85rem;
  color: var(--text-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Profile Styles */
.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
}

.profile-avatar-container {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 1rem;
  border: 3px solid var(--primary-color);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-location {
  color: var(--text-medium);
}

.profile-menu {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.menu-item {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item i {
  color: var(--primary-color);
  width: 24px;
}