/* ====================================================================
   PORTAL CANIL & ADOÇÃO RESPONSÁVEL - ESTILOS PERSONALIZADOS
   ==================================================================== */

:root {
  --primary-color: #2b7a78;
  --primary-hover: #205c5a;
  --secondary-color: #fe9a37;
  --secondary-hover: #e08328;
  --accent-color: #17252a;
  --bg-light: #f8fafc;
  --text-muted: #64748b;
  --card-border-radius: 1.25rem;
  --transition-fast: 0.25s ease;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-light);
  color: #334155;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Navbar */
.navbar {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95) !important;
  transition: box-shadow 0.3s ease;
}

.brand-icon {
  background: linear-gradient(135deg, var(--secondary-color), #f77f00);
  color: white;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.navbar-logo {
  max-height: 48px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-fast);
}

.navbar-brand:hover .navbar-logo {
  transform: scale(1.04);
}

.footer-logo {
  max-height: 44px;
  width: auto;
  object-fit: contain;
}

.navbar-nav .nav-link {
  font-weight: 500;
  color: #475569;
  transition: color var(--transition-fast);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #f0fdfa 0%, #e6fffa 50%, #fff7ed 100%);
  padding: 5rem 0 4rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.hero-badge {
  background-color: rgba(43, 122, 120, 0.12);
  color: var(--primary-color);
  font-weight: 600;
  border-radius: 50rem;
  padding: 0.45rem 1.1rem;
  display: inline-block;
  font-size: 0.88rem;
}

.hero-img-container {
  position: relative;
}

.hero-img {
  border-radius: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  width: 100%;
  max-height: 460px;
}

.hero-floating-card {
  position: absolute;
  bottom: -20px;
  left: 20px;
  background: white;
  border-radius: 1rem;
  padding: 0.9rem 1.3rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Institutional Alert */
.alert-institutional {
  background-color: #fffbeb;
  border: 1px solid #fef3c7;
  border-left: 5px solid var(--secondary-color);
  color: #92400e;
  border-radius: 1rem;
}

/* Filter Bar */
.filter-card {
  background: #ffffff;
  border-radius: var(--card-border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
}

/* Pet Cards */
.pet-card {
  border: none;
  border-radius: var(--card-border-radius);
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.pet-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.09);
}

.pet-img-wrap {
  position: relative;
  height: 230px;
  background-color: #e2e8f0;
  overflow: hidden;
}

.pet-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.pet-card:hover .pet-img {
  transform: scale(1.05);
}

.pet-badge-status {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 50rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.badge-disponivel {
  background-color: #10b981;
  color: white;
}

.badge-adotado {
  background-color: #64748b;
  color: white;
}

.badge-tratamento {
  background-color: #f59e0b;
  color: white;
}

.pet-gender-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  padding: 0.25rem 0.7rem;
  border-radius: 50rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.tag-badge {
  background-color: #f1f5f9;
  color: #475569;
  border-radius: 50rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag-badge.active-feature {
  background-color: #ecfdf5;
  color: #059669;
}

/* Section Header */
.section-title {
  font-weight: 800;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* PIX Donation Box */
.pix-card {
  background: linear-gradient(145deg, #ffffff, #f8fafc);
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.qr-code-box {
  background: white;
  padding: 1.25rem;
  border-radius: 1.25rem;
  border: 2px dashed #cbd5e1;
  display: inline-block;
}

.pix-key-display {
  background-color: #f1f5f9;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-family: monospace;
  font-size: 1rem;
  color: #1e293b;
  word-break: break-all;
}

/* Needs List */
.need-item {
  background: white;
  border-radius: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform var(--transition-fast);
}

.need-item:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.need-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background-color: #e0f2fe;
  color: #0284c7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Admin Styles */
.admin-sidebar {
  background-color: #0f172a;
  color: white;
  border-radius: 1rem;
  padding: 1.25rem;
}

.admin-nav-link {
  color: #94a3b8;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.admin-nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.07);
}

.admin-nav-link.active {
  color: white;
  background-color: var(--primary-color);
}

.status-select {
  border-radius: 0.5rem;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  font-weight: 600;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

/* Modal tweaks */
.modal-content {
  border-radius: 1.5rem;
  border: none;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Custom Primary Button */
.btn-primary-custom {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
  color: white;
  box-shadow: 0 4px 12px rgba(43, 122, 120, 0.3);
}

.btn-secondary-custom {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
}

.btn-secondary-custom:hover,
.btn-secondary-custom:focus {
  background-color: var(--secondary-hover);
  border-color: var(--secondary-hover);
  color: white;
  box-shadow: 0 4px 12px rgba(254, 154, 55, 0.3);
}

/* Live connection indicator */
.api-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.api-status-online { background-color: #10b981; }
.api-status-offline { background-color: #f59e0b; }

/* Image preview in admin */
.img-preview-box {
  width: 100%;
  height: 170px;
  border: 2px dashed #cbd5e1;
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f8fafc;
}
.img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Admin Tabs Styling */
#adminTabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#adminTabs .nav-item {
  flex: 1 1 auto;
}

#adminTabs .nav-link {
  font-size: 0.85rem;
  padding: 0.55rem 0.95rem;
  white-space: nowrap;
  color: #475569 !important;
  border-radius: 9999px;
  background-color: transparent;
  transition: all 0.2s ease;
}

#adminTabs .nav-link:hover {
  background-color: #e2e8f0;
  color: #0f172a !important;
}

#adminTabs .nav-link.active {
  background-color: var(--primary-color, #2b7a78) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(43, 122, 120, 0.35);
}

#adminTabs .nav-link.active i,
#adminTabs .nav-link.active span:not(.badge) {
  color: #ffffff !important;
}

#adminTabs .nav-link.active .badge {
  background-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}

/* Option Badges in Categories Management */
.opt-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.opt-badge-pill .btn-close-opt {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

.opt-badge-pill .btn-close-opt:hover {
  color: #ef4444;
}

/* ====================================================================
   MELHORIAS DE RESPONSIVIDADE (MOBILE & DESKTOP)
   ==================================================================== */

/* Prevenção rigorosa de transbordo horizontal */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

/* Modal da imagem do pet */
.modal-pet-img-box {
  height: 280px;
}

/* Telas até 991px (Tablets e Celulares) */
@media (max-width: 991.98px) {
  .navbar-nav {
    padding-top: 0.75rem;
    padding-bottom: 0.5rem;
  }
  
  .navbar-nav .nav-link {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.5rem;
  }

  .navbar-nav .nav-link:hover {
    background-color: #f1f5f9;
  }

  /* Abas do painel admin com rolagem horizontal touch fluida */
  #adminTabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px !important;
    scrollbar-width: thin;
  }

  #adminTabs::-webkit-scrollbar {
    height: 4px;
  }

  #adminTabs .nav-item {
    flex: 0 0 auto !important;
  }

  .hero-floating-card {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: -30px;
    margin-left: auto;
    margin-right: auto;
    max-width: 320px;
  }
}

/* Telas até 767px (Smartphones comuns) */
@media (max-width: 767.98px) {
  .hero-section {
    padding: 2.25rem 0 2rem;
  }

  .hero-section h1,
  .hero-section .display-4,
  .hero-section .display-5 {
    font-size: 1.8rem !important;
    line-height: 1.25;
  }

  .hero-section p.lead {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .hero-img {
    max-height: 260px;
  }

  /* Botões de chamada na hero em largura confortável */
  .hero-cta-group .btn {
    width: 100%;
    margin-bottom: 0.25rem;
  }

  /* Caixas de estatísticas */
  .counter-box {
    padding: 0.6rem 0.35rem !important;
  }

  .counter-box .h3 {
    font-size: 1.35rem !important;
  }

  .counter-box small {
    font-size: 0.7rem !important;
    line-height: 1.2;
  }

  /* Títulos de seção */
  .section-title {
    font-size: 1.55rem !important;
  }

  .section-subtitle {
    font-size: 0.88rem !important;
  }

  /* Barra de filtros */
  .filter-card {
    padding: 1rem !important;
  }

  .filter-card .form-label {
    font-size: 0.75rem;
  }

  /* Cards de Pets */
  .pet-img-wrap {
    height: 200px;
  }

  .pet-card .card-body {
    padding: 1.1rem !important;
  }

  .pet-card .card-title {
    font-size: 1.15rem;
  }

  .tag-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
  }

  /* Modal de Detalhes do Pet */
  .modal-pet-img-box {
    height: 210px !important;
  }

  /* Seção PIX */
  .pix-card {
    padding: 1.15rem !important;
  }

  .pix-key-display {
    font-size: 0.82rem;
    padding: 0.6rem 0.75rem;
  }

  .qr-code-box {
    padding: 0.75rem;
  }

  .qr-code-box img {
    max-width: 175px;
    height: auto;
  }

  /* Modais gerais */
  .modal-dialog {
    margin: 0.5rem;
  }

  #adminDashboardScreen .card {
    padding: 1rem !important;
  }

  /* Tabelas responsivas do admin */
  .table-responsive {
    border-radius: 0.75rem;
    box-shadow: inset 0 0 4px rgba(0,0,0,0.03);
  }

  .table-responsive table {
    font-size: 0.82rem;
    min-width: 600px;
  }
}

/* Telas menores que 480px / 360px (iPhone SE, Galaxy A, etc.) */
@media (max-width: 480px) {
  .navbar {
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
  }

  .navbar-logo {
    max-height: 36px;
  }

  .org-name-text {
    font-size: 0.88rem !important;
    max-width: 165px;
  }

  .navbar-toggler {
    padding: 0.2rem 0.4rem;
    font-size: 1rem;
  }

  .btn-primary-custom,
  .btn-secondary-custom {
    padding: 0.55rem 0.95rem;
    font-size: 0.9rem;
  }

  /* Toasts flutuantes adaptados ao rodapé mobile */
  .toast-container {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    padding: 0 !important;
  }

  .toast {
    width: 100% !important;
    max-width: 100% !important;
  }
}
