/* =========================================================================
   PetGoodLife — style.css (Merged version - Option B)
   - Duplicate selectors merged (properties merged, last occurrence wins)
   - Kept all unique styles and ordering intentions
   - Pet grid forced horizontal (flex + wrap)
   - Unified button sizing & rounded corners
   ========================================================================= */

/* --- GLOBAL RESET --- */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Darker Grotesque', sans-serif;
}

/* --- STRUCTURE --- */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden; /* prevent body scroll (preserved from original) */
}

/* --- FIXED HEADER --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: linear-gradient(90deg, #5bbcff, #004a91);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* --- FIXED FOOTER --- */
/* merged footer rules (single authoritative block) */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(90deg, #004a91, #1b263b);
  color: #fff;
  text-align: center;
  line-height: 60px;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
  z-index: 1000;
  padding: 15px 10px;
  font-size: 0.95rem;
  margin-top: auto;
  width: 100%;
}

/* --- MAIN CONTENT --- */
.site-main {
  flex: 1;
  overflow-y: auto;           /* scroll only main content */
  padding: 20px 20px 80px;    /* space for fixed header & footer */
  box-sizing: border-box;
  background: #121212;
}

/* --- HEADER CHILDREN --- */
.logo {
  width: 100px;
  height: auto;
}

.title-wrap h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 0.5px;
}

.tagline {
  display: block;
  font-size: 0.9rem;
  opacity: 0.8;
}

/* --- NAV & AUTH --- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-menu a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease, transform 0.2s;
}

.nav-menu a:hover {
  color: #d9f1ff;
  transform: translateY(-2px);
}

/* Auth buttons (merged & preserved) */
.nav-menu .btn-login,
.nav-menu .btn-register {
  background: #004a91;
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 700;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  color: #fff;
  cursor: pointer;
}

.nav-menu .btn-login:hover,
.nav-menu .btn-register:hover {
  background: #5bbcff;
  border-color: #fff;
}

/* Burger for mobile (kept) */
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
}

.burger img {
  width: 28px;
}

/* --- UNIVERSAL MODAL (merged) --- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.6);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal.open { display:flex; }


/* Close button */
.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  color: #333;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #e60000;
}

.modal h2 {
  margin-top: 0;
  text-align: center;
  color: #004a91;
  font-weight: 700;
  font-size: 1.8rem;
}

/* Modal form controls (merged rules) */
.modal label {
  display: block;
  font-weight: 600;
  margin-top: 10px;
  color: #333;
}

.modal input[type="text"],
.modal input[type="password"],
.modal input[type="email"],
.modal input[type="date"],
.modal select,
.modal textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #f9f9f9;
  margin-top: 5px;
  box-sizing: border-box;
}

.modal textarea {
  min-height: 120px;
  resize: vertical;
}

.modal button[type="submit"] {
  width: 100%;
  padding: 14px;
  background-color: #004a91 !important;
  color: #fff;
  font-size: 1.2rem;
  border: none;
  border-radius: 8px; /* unified slightly larger rounded buttons */
  font-weight: 700;
  margin-top: 15px;
  transition: background 0.3s ease, transform 0.12s;
  cursor: pointer;
}

.modal button[type="submit"]:hover {
  background-color: #003366;
  transform: translateY(-2px);
}

/* Scrollbar styling for modal content */
.modal-content::-webkit-scrollbar {
  width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
  background-color: #5bbcff;
  border-radius: 3px;
}
.modal-content::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.modal-content {
  background: #fff;
}

#addPetModal {
  display: none;
  justify-content: center;
  align-items: center;
}

#addPetModal .modal-content {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  width: 90%;
  max-width: 500px;
  background: #fff !important;
  border-radius: 10px;
  padding: 25px 25px 30px;
  overflow-y: auto;
  max-height: 85vh;
  box-shadow: 0 4px 15px rgba(0,0,0,0.25);
  /* padding-right kept in earlier block removed intentionally because last block defined these properties */
}

#addPetForm,
#addPetModal form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 12px;
  margin: 0;
  padding: 0;
}

#addPetForm label,
#addPetModal label {
  font-weight: 600;
  margin-top: 4px;
  color: #333;
}

/* inputs inside add pet form */
#addPetForm input[type="text"],
#addPetForm input[type="date"],
#addPetForm select,
#addPetForm button,
#addPetModal input[type="text"],
#addPetModal input[type="date"],
#addPetModal select,
#addPetModal button {
  width: 100% !important;
  max-width: 100% !important;
  padding: 10px 12px !important;
  border: 1px solid #ccc !important;
  border-radius: 6px !important;
  box-sizing: border-box !important;
  font-size: 1rem !important;
  background: #fff;
}

/* breed wrapper merged (last property wins when conflicts) */
.breed-select-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Breed preview box (kept final size from latest blocks) */
#breedPreviewBox {
  width: 280px;
  height: 280px;
  border-radius: 10px;
  border: 1px solid #ccc;
  overflow: hidden;
  background: #fff;
  display: none;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

#breedPreviewBox img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Breed dropdown / options — merged behavior: dark styles kept where present, final color rules kept from last occurrences */
.breed-select-box {
  background: #fff;
  border: 1px solid #ccc;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: 0.2s;
  text-align: left;
  color: #222 !important;
}

.breed-select-box:hover {
  border-color: #5bbcff;
}

.breed-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 250px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  z-index: 9999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* If a dark dropdown class is used by JS, these are kept (compat) */
.breed-dropdown.dark {
  background: #1f1f1f;
  border-color: #333;
}
.breed-dropdown.dark .breed-option {
  color: #eee;
}
.breed-dropdown.dark .breed-option:hover {
  background: #333;
}

/* options */
.breed-option {
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.2s;
  color: #222;
}
.breed-option:hover {
  background: #f0f8ff;
  color: #000;
}

/* breed preview fallbacks — keep last-specified fallback image and sizes */
/* ============================
   BREED PREVIEW IMAGE BOX
============================ */

.breed-ui {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

/* Fixed preview */
.breed-option {
  width: 220px;
  height: 220px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f3f3;
  flex-shrink: 0;
}

.breed-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Scrollable list */
.breed-list {
  width: 240px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
}

.breed-item {
  padding: 10px 12px;
  cursor: pointer;
}

.breed-item:hover {
  background: #f0f0f0;
}


}

/* --- Ensure placeholders/empty states readable (kept) --- */
.breed-select-box::placeholder,
.breed-select-box:empty {
  color: #555 !important;
}

/* --- DASHBOARD --- */
.dashboard {
  padding: 50px 20px;
  border-radius: 10px;
  text-align: center;
}

.dashboard h2 {
  font-size: 1.8rem;
  color: #222; /* fixed double-hash typo from earlier (##9dcaf5) */
  margin-bottom: 30px;
}

/* =============================
   PET GRID — HORIZONTAL (FLEX)
   --> Per your instruction: use FLEX rows, wrap when needed
   ============================= */
.pet-grid {
  display: flex;                  /* horizontal flow */
  flex-wrap: wrap;                /* allow wrapping on narrower screens */
  gap: 20px;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0;                     /* preserve outer spacing via container */
}

/* Pet card container (merged — last wins for border-radius / sizes) */
.pet-card {
  background: #7a7979;
  border-radius: 10px;
  padding: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
  margin-bottom: 1rem;
  width: 200px;        /* fixed card width to keep horizontal layout consistent */
  flex: 0 0 200px;     /* ensure cards line up horizontally and don't collapse */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* hover effect (kept) */
.pet-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Pet image — keep last-specified heights and object-fit */


/* Pet name (merged) */
.pet-card h3 {
  font-size: 1.1rem;
  margin: 10px 0;
  color: #000000;
  text-decoration: none;
}

.pet-card a {
	text-decoration: none;
    color:inherit; 
}

.pet-card a:hover {
	text-decoration: none;
}
/* Buttons & actions — unify shape & size globally while preserving colors */
.pet-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}

.pet-actions button {
  flex: 1;
  padding: 10px 12px;      /* slightly larger buttons */
  border: none;
  border-radius: 12px;     /* larger consistent radius */
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.18s ease, transform 0.12s;
}

/* keep original color choices but ensure hover states */
.btn-edit { background: #004a91; }
.btn-edit:hover { background: #0066cc; transform: translateY(-2px); }

.btn-delete { background: #b30000; }
.btn-delete:hover { background: #e60000; transform: translateY(-2px); }

/* Also keep .pet-card button rules (if used elsewhere) but unify */
.pet-card button {
  margin: 0;                 /* controlled by .pet-actions instead */
  padding: 10px 12px;
  border-radius: 12px;
  border: none;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

/* === DELETE Confirmation Modal (merged block) === */
#deleteConfirmModal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.8); /* Dark overlay */
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#deleteConfirmModal .modal-content {
  background: linear-gradient(180deg, #000000, #000000); /* Deep red gradient */
  color: #ff0000;
  border-radius: 10px;
  border: solid 4px;
  padding: 20px 15px;
  width: 90%;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 0 15px rgba(255,0,0,0.4);
  animation: fadeInModal 0.2s ease-in-out;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

#deleteConfirmModal h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: #ffcccc;
}

#deleteConfirmModal p {
  font-size: 1.5rem;
  margin-bottom: 25px;
  font-weight: 900;
}

#deleteConfirmModal .modal-actions {
  display: flex;
  justify-content: center;
  gap: 15px;
}

#deleteConfirmModal .btn-delete {
  background-color: #ff0000;
  color: white;
  border: none;
  padding: 10px 20px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}
#deleteConfirmModal .btn-delete:hover {
  background-color: #cc0000;
}

#deleteConfirmModal .btn-edit {
  background-color: #444;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
}
#deleteConfirmModal .btn-edit:hover {
  background-color: #666;
}

#deleteConfirmModal .close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

/* Confirm overlay and box (kept) */
.confirm-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.confirm-box {
  background: #111;
  color: #fff;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  width: 300px;
  box-shadow: 0 0 10px #000;
  border: 2px solid #b30000;
}
.confirm-actions {
  margin-top: 20px;
  display: flex;
  justify-content: space-around;
}
.btn-confirm {
  background: #000000;
  color: #dd0000;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.btn-cancel {
  background: #444;
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.btn-confirm:hover { background: #e60000; }
.btn-cancel:hover { background: #666; }

/* MEMORIAL MESSAGE (merged) */
.memorial-message {
  background: rgba(0, 0, 0, 0.8);
  color: #dd0000;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 1.1rem;
  margin-top: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* HERO (merged) */
.hero {
  text-align: center;
  background: #0d1b2a;
  color: #fff;
  padding: 80px 20px;
  border-radius: 8px;
  margin: 2rem auto;
}
.hero h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}
.hero p {
  opacity: 0.85;
}

/* BUTTONS (global unified small utility to enforce consistent styling across site) */
.btn, .button, button, input[type="submit"] {
  background: #004a91;
  color: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  text-decoration: none;
  display: inline-block;
  font-weight: 700;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}
.btn:hover, .button:hover, button:hover, input[type="submit"]:hover {
  background: #0066cc;
  transform: translateY(-2px);
}

/* preserve any .btn rules by color if used */
.btn-delete { background: #b30000; }
.btn-delete:hover { background: #e60000; }

/* RESPONSIVE rules (merged & corrected) */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    flex-direction: column;
    background: #004a91;
    position: absolute;
    top: 70px;
    right: 10px;
    padding: 15px;
    border-radius: 5px;
  }
  .burger {
    display: block;
  }

  /* stack pet cards on smaller screens */
  .pet-card {
    width: calc(50% - 16px);
    flex: 0 0 calc(50% - 16px);
  }

  #breedPreviewBox { width: 220px; height: 220px; }
  #addPetModal .modal-content { max-width: 92%; padding: 18px; }
}

@media (max-width: 600px) {
  .pet-card {
    width: 100%;
    flex: 0 0 100%;
  }

  .pet-thumb {
    height: 220px;
  }
}

/* Large-screen adjustments to keep more cards per row */
@media (min-width: 1200px) {
  .pet-card {
    width: 260px;
    flex: 0 0 260px;
  }
}

/* Accessibility / small helpers kept from original file */
.footer-links {
  margin-bottom: 0.5rem;
}
.footer-links a {
  color: #cde6ff;
  text-decoration: none;
  margin: 0 8px;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: #fff;
}

/* End of merged file */
/* =========================================================
   FORCE HORIZONTAL PET LISTING — OVERRIDE
========================================================= */

.pet-grid {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  align-items: flex-start !important;
  gap: 20px !important;
  width: 100% !important;
}

/* Explicit fixed card width to guarantee row layout */
.pet-card {
  flex: 0 0 240px !important;
  width: 240px !important;
  max-width: 240px !important;
  box-sizing: border-box !important;
}
/* =========================================================
   LOGO POSITION & SIZE FIX
========================================================= */

.site-header .logo {
  width: 62px !important;      /* bigger logo */
  height: auto !important;
  margin-top: 4px !important;  /* push logo DOWN */
  transform: translateY(4px);  /* additional slight lowering */
}
/* =========================================================
   FORCE HORIZONTAL PET LIST (REAL FIX)
========================================================= */

.pet-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 10px 0 !important;
}

.pet-list .pet-card {
    width: 240px !important;
    max-width: 240px !important;
    flex: 0 0 240px !important;
    display: flex;
    flex-direction: column;
}
/* =========================================================
   PET CARD IMAGE — EXACT 180 × 242 (Precision Cropped)
========================================================= */

.pet-thumb {
    width: 180px !important;
    height: 242px !important;
    object-fit: cover !important;      /* ensures perfect crop */
    object-position: center center !important;
    border-radius: 12px !important;
    border: 3px solid transparent;
    display: block;
    margin: 0 auto 10px auto;          /* centers inside card */
}
/* ================================
   PASSED AWAY PET — RAINBOW OVERLAY
   ================================ */
.pet-card.passed .pet-photo-wrapper {
    position: relative;
}

.pet-card.passed .pet-photo-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        45deg,
        rgba(255,0,0,0.35),
        rgba(255,165,0,0.35),
        rgba(255,255,0,0.35),
        rgba(0,128,0,0.35),
        rgba(0,0,255,0.35),
        rgba(75,0,130,0.35),
        rgba(238,130,238,0.35)
    );
    border-radius: 12px;
}
/* Position the action buttons */
.pet-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 6px;
}

/* Small square icon buttons */
.icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;

    transition: all 0.2s ease;
}

.icon-btn.edit {
    background: #1e88e5;
}

.icon-btn.edit:hover {
    background: #1565c0;
    transform: translateY(-2px);
}

.icon-btn.delete {
    background: #e53935;
}

.icon-btn.delete:hover {
    background: #c62828;
    transform: translateY(-2px);
}

/* Tooltip on hover (native browser tooltip improved with opacity) */
.icon-btn[title] {
    position: relative;
}

.icon-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0.9;
    pointer-events: none;
}
/* ==========================================
   FORCE ICON BUTTON STYLE (override all)
========================================== */

.pet-actions .icon-btn {
    all: unset;                 /* Wipe inherited button styles */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 36px !important;
    height: 36px !important;

    background: #1e88e5;
    color: #fff !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-size: 16px !important;

    transition: 0.2s ease-in-out;
}

/* EDIT button */
.pet-actions .icon-btn.edit {
    background: #1e88e5 !important;
}

.pet-actions .icon-btn.edit:hover {
    background: #1565c0 !important;
    transform: translateY(-2px);
}

/* DELETE button */
.pet-actions .icon-btn.delete {
    background: #e53935 !important;
}

.pet-actions .icon-btn.delete:hover {
    background: #c62828 !important;
    transform: translateY(-2px);
}

/* Tooltip */
.pet-actions .icon-btn[title]::after {
    display: none;
}

.pet-actions .icon-btn[title]:hover::after {
    display: block;
    content: attr(title);
    position: absolute;
    padding: 4px 8px;
    font-size: 11px;
    background: black;
    color: white;
    border-radius: 4px;
    white-space: nowrap;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.9;
}
/* Custom tooltip using data-tip */
.pet-actions .icon-btn[data-tip] {
    position: relative;
}

.pet-actions .icon-btn[data-tip]::after {
    content: attr(data-tip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: black;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: 0.15s ease-in-out;
}

.pet-actions .icon-btn[data-tip]:hover::after {
    opacity: 0.9;
}
//* Deceased pet styling */
/* Passed pet image container */
.pet-card.passed .pet-image-container {
  position: relative;
}

/* Image stays normal */
.pet-card.passed .pet-thumb {
  display: block;
  border: 3px solid #000;
}

/* Rainbow overlay ON IMAGE ONLY */
.pet-card.passed .pet-image-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../images/rainbow_bridge.png") center / cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
}
.pet-card a {
  text-decoration: none;
  color: inherit;
}

.pet-card a:hover {
  text-decoration: none;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  color: #222;
  padding: 24px;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}
