@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  --pink: #87A878;
  --light-pink: #A8C69F;
  --pale-pink: #C4DEB5;
  --deep-pink: #E8F0E3;
  --cream: #4A5D4A;
  --white: #ffffff;
  --text: #4a3347;
  --text-light: #8a7088;
  --text-muted: #b8a5b6;
  --border: rgba(255, 105, 180, 0.15);
  --shadow-sm: 0 1px 3px rgba(255, 20, 147, 0.08);
  --shadow-md: 0 4px 12px rgba(255, 20, 147, 0.1);
  --shadow-lg: 0 8px 24px rgba(255, 20, 147, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 50px;
}

::selection {
  background: var(--pink);
  color: var(--white);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(255, 182, 193, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 192, 203, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 105, 180, 0.08) 0%, transparent 50%);
}

/* ===== APP SHELL ===== */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  background: linear-gradient(135deg, var(--deep-pink), var(--pink), var(--light-pink));
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  animation: headerShimmer 8s ease-in-out infinite;
}

@keyframes headerShimmer {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10%, 5%); }
}

.header-content {
  position: relative;
  z-index: 1;
}

.header-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.3rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.header-title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.8rem;
  color: var(--white);
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(255, 20, 147, 0.3);
}

.header-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  margin-top: 0.2rem;
}

/* ===== TAB BAR ===== */
.tab-bar {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.7rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background: var(--deep-pink);
  border-radius: 3px 3px 0 0;
  transition: width 0.25s ease;
}

.tab-btn.active {
  color: var(--deep-pink);
}

.tab-btn.active::after {
  width: 60%;
}

.tab-icon {
  font-size: 1.3rem;
}

.tab-label {
  font-size: 0.72rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  padding: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ===== TOOLBAR ===== */
.profiles-toolbar,
.playdates-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.chip:hover {
  border-color: var(--light-pink);
  background: rgba(255, 182, 193, 0.1);
}

.chip.active {
  background: var(--pink);
  color: var(--white);
  border-color: var(--pink);
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.25);
}

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  border: none;
  background: linear-gradient(135deg, var(--deep-pink), var(--pink));
  color: var(--white);
  font-family: 'Quicksand', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 3px 12px rgba(255, 20, 147, 0.25);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(255, 20, 147, 0.35);
}

.btn-secondary {
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--light-pink);
  background: var(--white);
  color: var(--text);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--pink);
  background: rgba(255, 182, 193, 0.1);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text-light);
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sm:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.btn-edit { border-color: var(--light-pink); color: var(--pink); }
.btn-delete { border-color: #fecaca; color: #ef4444; }
.btn-delete:hover { background: #fef2f2; border-color: #ef4444; }
.btn-request { background: var(--pale-pink); border-color: var(--pink); color: var(--deep-pink); }
.btn-accept { background: #dcfce7; border-color: #86efac; color: #16a34a; }
.btn-decline { background: #fef2f2; border-color: #fecaca; color: #ef4444; }
.btn-complete { background: #fef3c7; border-color: #fbbf24; color: #d97706; }

.add-pet-btn {
  flex-shrink: 0;
}

/* ===== PET CARDS GRID ===== */
.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pet-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  animation: fadeInUp 0.45s ease both;
}

.pet-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--light-pink);
}

.pet-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--pale-pink), var(--light-pink));
  position: relative;
  overflow: hidden;
}

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

.pet-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  opacity: 0.7;
}

.pet-species-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--white);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: var(--shadow-md);
}

.pet-card-body {
  padding: 1rem;
}

.pet-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.pet-breed {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.6rem;
}

.pet-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.tag {
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.tag-size {
  background: rgba(255, 192, 203, 0.3);
  color: var(--deep-pink);
}

.temp-calm { background: #dbeafe; color: #2563eb; }
.temp-playful { background: #fef3c7; color: #d97706; }
.temp-energetic { background: #fce7f3; color: #db2777; }
.temp-shy { background: #ede9fe; color: #7c3aed; }
.temp-friendly { background: #dcfce7; color: #16a34a; }
.temp-aggressive { background: #fef2f2; color: #ef4444; }

.pet-notes {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.pet-card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

/* ===== PLAYDATES LIST ===== */
.playdates-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.playdate-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease both;
}

.playdate-card:hover {
  box-shadow: var(--shadow-md);
}

.playdate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.playdate-pets {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.playdate-pet-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}

.playdate-arrow {
  color: var(--pink);
  font-weight: 700;
}

.status-badge {
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pending { background: #fef3c7; color: #92400e; }
.status-accepted { background: #dcfce7; color: #166534; }
.status-completed { background: #ede9fe; color: #5b21b6; }
.status-declined { background: #fef2f2; color: #991b1b; }

.playdate-message {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 0.5rem;
  padding-left: 0.8rem;
  border-left: 3px solid var(--pale-pink);
}

.playdate-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.playdate-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ===== MAP VIEW ===== */
.map-view {
  position: relative;
  height: calc(100vh - 200px);
  min-height: 400px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.map-container {
  width: 100%;
  height: 100%;
}

.pet-map-marker .marker-bubble {
  width: 40px;
  height: 40px;
  background: var(--white);
  border: 3px solid var(--pink);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}

.pet-map-marker .marker-emoji {
  transform: rotate(45deg);
  font-size: 1.2rem;
}

.map-popup {
  font-family: 'Quicksand', sans-serif;
  text-align: center;
  min-width: 140px;
}

.map-popup .popup-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
}

.map-popup strong {
  font-family: 'Nunito', sans-serif;
  color: var(--deep-pink);
}

.map-overlay-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 500;
  pointer-events: none;
}

.map-overlay-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 2rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 300px;
}

.map-overlay-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.map-overlay-card h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.map-overlay-card p {
  font-size: 0.82rem;
  color: var(--text-light);
}

.map-sidebar {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.8rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: 500;
  max-width: 220px;
}

.map-sidebar h4 {
  font-family: 'Nunito', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.map-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.map-sidebar-item {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.8rem;
  padding: 0.25rem 0;
}

.map-detail-panel {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-width: 240px;
  animation: fadeInUp 0.3s ease;
}

.panel-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
}

.panel-pet-info {
  text-align: center;
}

.panel-pet-img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

.panel-pet-info h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  color: var(--deep-pink);
}

.panel-pet-info p {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 51, 71, 0.45);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(255, 20, 147, 0.2);
  animation: modalSlideUp 0.3s ease;
}

.modal-sm {
  max-width: 440px;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--deep-pink);
}

/* ===== FORMS ===== */
.profile-form {
  padding: 1.2rem 1.5rem 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--cream);
  transition: all 0.2s ease;
  min-height: 44px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.15);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.size-selector,
.temperament-selector {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.size-btn,
.temp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--cream);
  cursor: pointer;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.2s ease;
  text-transform: capitalize;
  min-width: 52px;
}

.size-btn.active,
.temp-btn.active {
  border-color: var(--pink);
  background: rgba(255, 105, 180, 0.1);
  color: var(--deep-pink);
  box-shadow: 0 2px 8px rgba(255, 105, 180, 0.15);
}

.size-btn:hover,
.temp-btn:hover {
  border-color: var(--light-pink);
}

.photo-upload-area {
  border: 2px dashed var(--light-pink);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s;
}

.photo-upload-area:hover {
  border-color: var(--pink);
}

.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  font-size: 0.85rem;
}

.upload-icon {
  font-size: 1.8rem;
}

.photo-preview {
  position: relative;
  text-align: center;
}

.photo-preview img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
}

.photo-preview .btn-sm {
  margin: 0.5rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  animation: fadeInUp 0.5s ease;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 0.8rem;
  filter: grayscale(30%);
}

.empty-state h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.empty-state p {
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 1.2rem;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== LOADING / SKELETONS ===== */
.loading-container {
  padding: 1rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.skeleton-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.skeleton-img {
  height: 180px;
  background: linear-gradient(90deg, var(--pale-pink), var(--light-pink), var(--pale-pink));
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f3e8ed, #fce4ec, #f3e8ed);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
  margin: 0.8rem 1rem;
  width: 60%;
}

.skeleton-line.wide {
  width: 80%;
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skeleton-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  background: var(--white);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.skeleton-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f3e8ed, #fce4ec, #f3e8ed);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

.skeleton-lines {
  flex: 1;
}

.skeleton-lines .skeleton-line {
  margin: 0.3rem 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .app-header {
    padding: 1.4rem 1rem 1rem;
  }

  .header-title {
    font-size: 1.4rem;
  }

  .header-icon {
    font-size: 1.8rem;
  }

  .main-content {
    padding: 0.8rem;
  }

  .profiles-toolbar,
  .playdates-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.3rem;
    -webkit-overflow-scrolling: touch;
  }

  .pets-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .map-view {
    height: calc(100vh - 180px);
    border-radius: var(--radius-md);
  }

  .map-sidebar {
    bottom: 0.5rem;
    left: 0.5rem;
    max-width: 180px;
    font-size: 0.75rem;
  }

  .map-detail-panel {
    top: auto;
    bottom: 0.5rem;
    right: 0.5rem;
    max-width: 200px;
  }

  .modal-content {
    max-height: 95vh;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    align-self: flex-end;
  }

  .playdate-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 380px) {
  .size-btn,
  .temp-btn {
    min-width: 44px;
    padding: 0.4rem;
    font-size: 0.68rem;
  }
}

/* ===== FOCUS STYLES ===== */
:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

button:focus-visible {
  outline: 2px solid var(--deep-pink);
  outline-offset: 2px;
}

/* ===== LEAFLET OVERRIDES ===== */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-content {
  margin: 0.6rem !important;
  font-family: 'Quicksand', sans-serif !important;
}

.leaflet-popup-tip {
  box-shadow: none !important;
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to PawPals! This is your pet playdate matchmaker. You'll see three tabs: Pets, Map, and Playdates.", "view": "user", "highlight_selector": ".tab-bar", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Let's add your first pet! Tap the 'Add Pet' button to create a profile.", "view": "user", "highlight_selector": ".add-pet-btn", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Fill in your pet's details — name, species, breed, size, and temperament. Upload a photo too!", "view": "user", "highlight_selector": ".profile-form", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Add latitude and longitude coordinates to place your pet on the map. This helps find nearby playmates!", "view": "user", "highlight_selector": "input[placeholder='40.7128']", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "Your pet card appears in the grid. You can edit or delete it anytime. Use the filter chips to browse by species.", "view": "user", "highlight_selector": ".pets-grid", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Switch to the Map tab to see your pets on an interactive map. Tap a marker to see details!", "view": "user", "highlight_selector": ".tab-btn:nth-child(2)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "Now check the Playdates tab. Create playdate requests, track their status, and manage your schedule.", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 8, "narration": "Tap 'New Request' to set up a playdate. Pick your pet, name the playdate partner, add a message and date!", "view": "user", "highlight_selector": ".btn-primary", "wait_for": "user_interaction"},
  {"step": 9, "narration": "You're all set! Add more pets, plan playdates, and find the perfect playmate for your furry friend. 🐾", "view": "user", "highlight_selector": ".app-header", "wait_for": "tap_to_continue"}
]
-->

.auth-panel {
  padding: 1.25rem 1.5rem 1.5rem;
  text-align: center;
}

.auth-panel p {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-google-btn {
  width: 100%;
  justify-content: center;
}

.owner-identity-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 182, 193, 0.08);
}

.owner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.owner-identity-bar strong {
  display: block;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  color: var(--text);
  font-size: 0.92rem;
}

.owner-identity-bar div div {
  font-size: 0.78rem;
  color: var(--text-light);
}

.profiles-user {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.profiles-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 182, 193, 0.18);
  flex-shrink: 0;
}

.profiles-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profiles-user-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.profiles-user-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
}

.profiles-user-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 0.1rem;
}

.tag-distance {
  background: rgba(255, 105, 180, 0.12);
  color: var(--deep-pink);
}

.map-nearby-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

.map-nearby-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.map-nearby-panel-header h3 {
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 800;
}

.map-nearby-panel-header span {
  font-size: 0.8rem;
  color: var(--text-light);
}

.map-nearby-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.playdate-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.request-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 182, 193, 0.08);
}

.request-identity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 182, 193, 0.18);
  color: var(--deep-pink);
  font-size: 1rem;
}

.request-identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.request-identity-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.request-identity-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.request-identity-meta strong {
  font-family: 'Nunito', sans-serif;
  font-size: 0.92rem;
  color: var(--text);
}

.request-identity-meta span:last-child {
  font-size: 0.78rem;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-summary { display: flex; gap: 0.45rem; flex-wrap: wrap; align-items: center; }
.presence-pill, .presence-inline { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.22rem 0.55rem; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.presence-online { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.presence-available { background: rgba(168, 85, 247, 0.12); color: #7c3aed; }
.presence-offline { background: rgba(148, 163, 184, 0.12); color: #64748b; }

.profile-actions-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.share-link-box {
  margin-bottom: 1rem;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 182, 193, 0.06);
}

.share-link-box label {
  display: block;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--text);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.share-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-link-row input {
  flex: 1;
  min-width: 0;
}

.ai-match-panel {
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 182, 193, 0.12), rgba(255, 255, 255, 0.9));
}

.ai-match-header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.7rem;
}

.ai-match-header h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}

.ai-match-header span,
.ai-match-note,
.ai-match-summary,
.ai-match-card p {
  font-size: 0.82rem;
  color: var(--text-light);
}

.ai-match-summary {
  margin-bottom: 0.75rem;
}

.ai-match-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.ai-match-card {
  padding: 0.8rem;
  border-radius: var(--radius-md);
  background: var(--white);
  border: 1px solid rgba(255, 182, 193, 0.45);
  box-shadow: var(--shadow-sm);
}

.ai-match-card-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.ai-match-card-top strong {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  font-size: 0.92rem;
}

.ai-match-score {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--deep-pink);
  background: rgba(255, 105, 180, 0.12);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-full);
}

.ai-match-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
}

@media (max-width: 640px) {
  .profile-actions-row,
  .share-link-row {
    flex-direction: column;
    align-items: stretch;
  }

  .share-link-row input {
    width: 100%;
  }
}
