/**
 * wkpetprofile — Ficha de Mascota
 * Estilos del módulo (front + integración con Classic Theme / Bootstrap 4)
 *
 * Convención de nombres: .wkpet-*
 *
 * @author    Wonka SEO & WebDevelopment
 * @license   AFL-3.0
 * @copyright 2026
 */

/* ─────────────────────────────────────────────────────────────────────────────
   Variables
───────────────────────────────────────────────────────────────────────────── */
:root {
  --wkpet-primary:      #3d7ebe;
  --wkpet-primary-dark: #2c5e96;
  --wkpet-accent:       #f5a623;
  --wkpet-danger:       #d9534f;
  --wkpet-success:      #4cae4c;
  --wkpet-card-radius:  14px;
  --wkpet-card-shadow:  0 2px 12px rgba(0, 0, 0, 0.08);
  --wkpet-card-hover:   0 8px 28px rgba(0, 0, 0, 0.14);
  --wkpet-photo-size:   220px;
  --wkpet-transition:   0.22s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Barra superior (título + botón añadir)
───────────────────────────────────────────────────────────────────────────── */
.wkpet-topbar {
  gap: 0.5rem;
}

.wkpet-topbar__title {
  font-weight: 600;
}

.wkpet-count {
  font-size: 0.75rem;
  vertical-align: middle;
  background: #e9ecef;
  color: #495057;
  padding: 2px 8px;
  border-radius: 99px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Alertas (cumpleaños)
───────────────────────────────────────────────────────────────────────────── */
.wkpet-alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.wkpet-alert__icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.wkpet-alert--owner {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-color: #b1dfbb;
}

.wkpet-alert--pet {
  background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
  border-color: #abdde5;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Grid de tarjetas
───────────────────────────────────────────────────────────────────────────── */
.wkpet-grid {
  margin-top: 0.5rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Tarjeta de mascota
───────────────────────────────────────────────────────────────────────────── */
.wkpet-card {
  border: 1px solid #e0e5ec;
  border-radius: var(--wkpet-card-radius);
  overflow: hidden;
  transition:
    box-shadow var(--wkpet-transition),
    transform  var(--wkpet-transition);
  background: #fff;
}

.wkpet-card:hover {
  box-shadow: var(--wkpet-card-hover);
  transform: translateY(-3px);
}

/* Tarjeta con cumpleaños hoy */
.wkpet-card--birthday {
  border-color: var(--wkpet-accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.25);
}

.wkpet-card--birthday:hover {
  box-shadow: var(--wkpet-card-hover), 0 0 0 3px rgba(245, 166, 35, 0.35);
}

/* ── Foto ──────────────────────────────────────────────────────────────────── */
.wkpet-card__photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f8f9fa;
}

.wkpet-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--wkpet-transition);
}

.wkpet-card:hover .wkpet-card__img {
  transform: scale(1.04);
}

.wkpet-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  background: linear-gradient(135deg, #f0f4f8 0%, #e2eaf4 100%);
}

/* Badge "¡Hoy!" */
.wkpet-card__birthday-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--wkpet-accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ── Body ──────────────────────────────────────────────────────────────────── */
.wkpet-card__body {
  padding: 1rem;
}

.wkpet-card__name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
  color: #212529;
}

.wkpet-card__meta {
  font-size: 0.88rem;
}

.wkpet-card__birth {
  font-size: 0.8rem;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.wkpet-card__footer {
  padding: 0.6rem 1rem;
  background: #fafbfc;
  border-top: 1px solid #e9ecef;
}

.wkpet-btn-edit,
.wkpet-btn-delete {
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all var(--wkpet-transition);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Estado vacío
───────────────────────────────────────────────────────────────────────────── */
.wkpet-empty {
  max-width: 480px;
  margin: 0 auto;
}

.wkpet-empty__icon {
  font-size: 4.5rem;
  line-height: 1;
}

.wkpet-empty__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #495057;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Formulario de mascota
───────────────────────────────────────────────────────────────────────────── */
.wkpet-form .form-control {
  border-radius: 8px;
  border-color: #ced4da;
  transition: border-color var(--wkpet-transition), box-shadow var(--wkpet-transition);
}

.wkpet-form .form-control:focus {
  border-color: var(--wkpet-primary);
  box-shadow: 0 0 0 3px rgba(61, 126, 190, 0.2);
}

.wkpet-label--required::after {
  content: " *";
  color: var(--wkpet-danger);
}

.wkpet-form__divider {
  margin: 1.5rem 0;
  border-color: #e9ecef;
}

.wkpet-form__actions {
  gap: 0.75rem;
}

/* ── Preview de foto ────────────────────────────────────────────────────────── */
.wkpet-photo-wrap {
  position: sticky;
  top: 1rem;
}

.wkpet-photo-preview {
  width: var(--wkpet-photo-size);
  height: var(--wkpet-photo-size);
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 3px dashed #ced4da;
  background: #f8f9fa;
  cursor: pointer;
  transition: border-color var(--wkpet-transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wkpet-photo-preview:hover {
  border-color: var(--wkpet-primary);
}

.wkpet-photo-preview__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wkpet-photo-preview__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1rem;
}

.wkpet-photo-preview__emoji {
  font-size: 3.5rem;
  line-height: 1;
}

.wkpet-photo-label {
  cursor: pointer;
}

.wkpet-photo-filename {
  word-break: break-all;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Hook: aviso sin mascota
───────────────────────────────────────────────────────────────────────────── */
.wkpet-no-pet-warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border-radius: 10px;
}

.wkpet-no-pet-warning__icon {
  font-size: 1.3rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Hook: enlace Mi Cuenta
───────────────────────────────────────────────────────────────────────────── */
.wkpet-account-block a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-decoration: none;
  color: inherit;
  transition: color var(--wkpet-transition);
}

.wkpet-account-block a:hover {
  color: var(--wkpet-primary);
}

.wkpet-account-block .material-icons {
  font-size: 2.2rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Admin: panel cumpleaños
───────────────────────────────────────────────────────────────────────────── */
.wkpet-admin-birthdays {
  border-left: 4px solid var(--wkpet-accent);
}

.wkpet-bday-card {
  background: #fffdf0;
  border: 1px solid #f5e5b0;
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
}

.wkpet-bday-card--today {
  background: #fff3cd;
  border-color: var(--wkpet-accent);
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.3);
}

.wkpet-bday-card__name {
  font-size: 0.95rem;
}

/* ─────────────────────────────────────────────────────────────────────────────
   Responsive
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 575px) {
  .wkpet-photo-preview {
    --wkpet-photo-size: 160px;
  }

  .wkpet-card__placeholder {
    font-size: 3.5rem;
  }

  .wkpet-form__actions {
    flex-direction: column-reverse;
  }

  .wkpet-form__actions .btn {
    width: 100%;
    text-align: center;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   Popup / Modal Global
   ───────────────────────────────────────────────────────────────────────────── */
.wkpet-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.wkpet-modal.wkpet-modal--show {
  opacity: 1;
  pointer-events: auto;
}

.wkpet-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wkpet-modal-dialog {
  position: relative;
  width: 90%;
  max-width: 500px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  z-index: 2;
}

.wkpet-modal.wkpet-modal--show .wkpet-modal-dialog {
  transform: translateY(0);
}

.wkpet-modal-content {
  position: relative;
  padding: 2.5rem 2rem 2rem 2rem;
}

.wkpet-modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s ease;
}

.wkpet-modal-close:hover {
  color: #333;
}

.wkpet-modal-body {
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
}

.wkpet-modal-body h3 {
  font-weight: 700;
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: #212529;
}

.wkpet-modal-body p {
  color: #6c757d;
  margin-bottom: 1.2rem;
}

.wkpet-modal-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 1.2rem;
}

.wkpet-modal-body .btn {
  padding: 8px 24px;
  font-weight: 600;
  border-radius: 8px;
}
