html {
  height: 100%;
}

main {
  flex: 1;
}

:root {
  --primary-color: #4a90e2;
  --primary-hover: #357abd;
  --bg-color: #f8f9fa;
  --text-color: #2d3436;
  --text-muted: #636e72;
  --card-bg: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.95);
  --border-color: #dfe6e9;
  --input-bg: #ffffff;
  --shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 12px;
  --submit-button-bg: #ffffff;
  --submit-button-text: #000000;
}

[data-theme='dark'] {
  --primary-color: #5d9cec;
  --primary-hover: #4a90e2;
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --text-muted: #a0a0a0;
  --card-bg: #1e1e1e;
  --header-bg: rgba(30, 30, 30, 0.95);
  --border-color: #333333;
  --input-bg: #2d2d2d;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --submit-button-bg: #000000;
  --submit-button-text: #ffffff;
}

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

body {
  font-family:
    'Outfit',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
  transition:
    background 0.3s ease,
    color 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.2s ease;
}

ul {
  list-style: none;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

header {
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 2rem;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary-color);
  padding-left: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
}

.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.5rem;
  color: var(--text-muted);
  border-radius: 50%;
  transition: 0.2s ease;
}

.theme-toggle-btn:hover {
  background: rgba(128, 128, 128, 0.1);
  color: var(--primary-color);
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: 0.2s ease;
}

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

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

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text-color);
  transition: 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

textarea.form-control {
  min-height: 120px;
  resize: none;
}

.custum-file-upload {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: 0.3s ease;
  text-align: center;
}

.custum-file-upload:hover {
  border-color: var(--primary-color);
  background: rgba(74, 144, 226, 0.05);
}

.custum-file-upload input {
  display: none;
}

.custum-file-upload svg {
  width: 50px;
  height: 50px;
  fill: var(--primary-color);
}

.post-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn {
  background: var(--primary-color);
  color: #fff;
}

.btn-auth {
    margin-right: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
    background: transparent;
}
.btn-auth:hover {
    margin-right: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    border-radius: 10px;
    transition: 0.2s ease;
    background: transparent;
    background: var(--primary-hover);
}
.btn:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-color);
}

.loginIcon {
    width: 60px;
    height: 40px;


}

.submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(144deg, #af40ff, #5b42f3 50%, #00ddeb);
  max-width: 100%;
}

.submit-btn span {
  background: var(--submit-button-bg);
  color: var(--submit-button-text);
  padding: 16px;
  border-radius: 6px;
  width: 100%;
  transition: 0.3s ease;
  font-size: large;
}

.submit-btn:hover span {
  background: none;
  color: #fff;
}

.post-actions .btn {
  flex: 1 1 auto;
  min-width: 120px;
}

footer {
  text-align: center;
  padding: 1.2rem 0;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

.hidden {
  display: none;
}

.text-center {
  text-align: center;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

/* ── Vets + Shared Grid ───────────────────────────────────────── */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}

#shopGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

#shopGrid .card {
  margin-bottom: 0;
  padding: 1rem;
  border: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#shopGrid .card h3 {
  font-size: 1.02rem;
  line-height: 1.35;
  min-height: 2.75rem;
}

.product-image {
  height: 220px;
  width: 100%;
  object-fit: contain;
  padding: 1rem;
  border-radius: 10px;
  background: white;
}

.product-category {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--primary-color);
}

.shop-buy-btn {
  width: 100%;
  margin-top: auto;
}

.vet-card {
  margin-bottom: 0;
  padding: 1.25rem;
}

.vet-card h3 {
  margin-bottom: 0.4rem;
}

.vet-card > p {
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}

.vet-contact {
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.vet-contact p {
  margin: 0;
}

.vet-contact p + p {
  margin-top: 0.5rem;
}

.vet-contact a {
  color: var(--primary-color);
}

.vet-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

#no-results {
  color: var(--text-muted);
  margin-top: 2rem;
}

/* ── Posts ─────────────────────────────────────────────────────── */
.posts-container {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  padding: 1rem;
  transition: 0.2s ease;
}

.post-card img.post-image {
  width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.post-header {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

.post-date {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-caption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .post-actions {
    flex-direction: column;
  }

  .post-actions .btn {
    width: 100%;
  }

  .submit-btn {
    width: 100%;
  }

  .submit-btn span {
    padding: 14px;
    font-size: 0.95rem;
  }

  #shopGrid {
    grid-template-columns: 1fr;
  }
}

/* ── Toast notification ───────────────────────────────────────── */
.vet-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(1rem);
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  z-index: 999;
  white-space: nowrap;
  pointer-events: none;
}

.vet-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Auth Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

.auth-modal {
  width: 100%;
  max-width: 450px;
  position: relative;
  padding: 2.5rem;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

.close-modal {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s ease;
}

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

.auth-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  background: none;
  border: none;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: 0.2s ease;
  position: relative;
}

.auth-tab.active {
  color: var(--primary-color);
}

.auth-tab.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-color);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-form.hidden {
  display: none;
}

.w-100 {
  width: 100%;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Avatar Styles */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.btn-auth:hover .user-avatar {
    transform: scale(1.05);
}

/* Profile Modal Styles */
.profile-modal {
    width: 100%;
    max-width: 400px;
    position: relative;
    padding: 2.5rem;
    animation: modalFadeIn 0.3s ease;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.profile-email {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.profile-form {
    margin-bottom: 1.5rem;
}

.profile-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Login Prompt Overlay */
.login-prompt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--card-bg-rgb, 255, 255, 255), 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: var(--radius);
}

[data-theme="dark"] .login-prompt-overlay {
    background: rgba(30, 30, 30, 0.95);
}

.login-prompt-content {
    text-align: center;
    padding: 2rem;
}

.login-prompt-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-prompt-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.login-prompt-content p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.login-prompt-overlay.hidden {
    display: none;
}

/* Posts Filter */
.posts-filter {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: transparent;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

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

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

/* Post Actions (Edit/Delete buttons) */
.post-card {
    position: relative;
}

.post-owner-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.post-edit-btn,
.post-delete-btn {
    padding: 0.25rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s ease;
}

.post-edit-btn {
    background: var(--primary-color);
    color: white;
}

.post-edit-btn:hover {
    background: var(--primary-hover);
}

.post-delete-btn {
    background: #e74c3c;
    color: white;
}

.post-delete-btn:hover {
    background: #c0392b;
}

/* Edit Post Modal */
.edit-post-modal {
    width: 100%;
    max-width: 500px;
    position: relative;
    padding: 2rem;
}

.edit-post-modal h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}