/* ============================================
   SINDICA PROFISSIONAL - STYLESHEET
   Marta Moura - Gestão Condominial
   ============================================ */

/* ============================================
   1. RESET E CONFIGURAÇÕES GLOBAIS
   ============================================ */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Previne texto muito longo sem quebra */
* {
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  transition: all 0.3s ease;
}

::selection {
  background: #c67a8a;
  color: white;
}

::-moz-selection {
  background: #c67a8a;
  color: white;
}

*:focus-visible {
  outline: 3px solid #d8b36a;
  outline-offset: 2px;
}

/* ============================================
   2. SCROLLBAR CUSTOMIZADA
   ============================================ */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f8f8f8;
}

::-webkit-scrollbar-thumb {
  background: #c67a8a;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2e5266;
}

/* ============================================
   3. CARDS DE SERVIÇO
   ============================================ */
.service-card {
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background-color: #f8f8f8 !important;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.service-card h4,
.service-card .text-xl.font-bold {
  color: #2e5266 !important;
  font-weight: 700 !important;
}

.service-card p,
.service-card .text-gray-600 {
  color: #4b5563 !important;
}

.service-card .text-brand-rose {
  color: #c67a8a !important;
}

/* ============================================
   4. TIMELINE (LINHA CENTRAL)
   ============================================ */
#trabalhos {
  position: relative;
  z-index: 10;
}

#timeline-container {
  position: relative;
  z-index: 10;
  padding: 2rem 0;
}

#timeline-container::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  width: 3px;
  background: linear-gradient(to bottom, #c67a8a 0%, #d8b36a 50%, #c67a8a 100%);
  z-index: 0;
  box-shadow: 0 0 10px rgba(198, 122, 138, 0.3);
}

.timeline-item-wrapper {
  position: relative;
  z-index: 10;
  margin-bottom: 4rem;
}

.timeline-item-wrapper:last-child {
  margin-bottom: 0;
}

.timeline-item-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.timeline-item-wrapper img:hover {
  transform: scale(1.02);
}

/* ============================================
   5. CALENDÁRIO
   ============================================ */
#events-list::-webkit-scrollbar {
  width: 6px;
}

#events-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#events-list::-webkit-scrollbar-thumb {
  background: #c67a8a;
  border-radius: 10px;
}

#events-list {
  scroll-behavior: smooth;
}

/* Cores dos eventos no calendário */
.evento-assembleia {
  background-color: rgba(255, 182, 193, 0.25) !important;
  border-color: #ffb6c1 !important;
  color: #ffd1dc !important;
}
.evento-vistoria {
  background-color: rgba(255, 228, 181, 0.25) !important;
  border-color: #ffe4b5 !important;
  color: #fff0d4 !important;
}
.evento-comemorativo {
  background-color: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.7) !important;
  color: #ffffff !important;
}
.evento-reuniao {
  background-color: rgba(134, 239, 172, 0.25) !important;
  border-color: #86efac !important;
  color: #b7f4d1 !important;
}

#events-list .font-bold {
  color: #ffffff !important;
}
#events-list .opacity-75,
#events-list .opacity-80 {
  color: rgba(255, 255, 255, 0.85) !important;
}

.dot-assembleia {
  background-color: #ffb6c1 !important;
  box-shadow: 0 0 8px rgba(255, 182, 193, 0.6);
}
.dot-vistoria {
  background-color: #ffe4b5 !important;
  box-shadow: 0 0 8px rgba(255, 228, 181, 0.6);
}
.dot-evento {
  background-color: rgba(255, 255, 255, 0.9) !important;
}
.dot-reuniao {
  background-color: #86efac !important;
  box-shadow: 0 0 8px rgba(134, 239, 172, 0.6);
}

#events-list > div {
  background: rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(4px);
  border-radius: 8px;
  transition: all 0.3s ease;
}

#events-list > div:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  transform: translateX(4px);
}

/* Tooltip do Calendário */
.has-event-tooltip {
  position: relative;
}
.has-event-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2e5266;
  color: white;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-line;
  z-index: 50;
  min-width: 200px;
  max-width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeInTooltip 0.3s ease forwards;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.has-event-tooltip:hover::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2e5266;
  z-index: 50;
  margin-bottom: -2px;
  opacity: 0;
  animation: fadeInTooltip 0.3s ease forwards;
}

@keyframes fadeInTooltip {
  to {
    opacity: 1;
  }
}

/* ============================================
   6. GALERIA DE FOTOS E FILTROS
   ============================================ */
#galeria-grid > div {
  position: relative;
}

#galeria-grid img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#galeria-grid .absolute.bottom-0 {
  z-index: 10;
  pointer-events: none;
}

#galeria-grid .absolute.bottom-0 * {
  pointer-events: auto;
}

/* GARANTIA DE EXIBIÇÃO DOS BOTÕES DE FILTRO DA GALERIA */
.gallery-filter {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 10 !important;
}

/* ============================================
   7. FILTROS DE CONDOMÍNIOS
   ============================================ */
.filter-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 10 !important;
}

/* ============================================
   8. BOTÃO DE LOADING (FORMULÁRIO)
   ============================================ */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   9. LIGHTBOX
   ============================================ */
.lb-data .lb-caption {
  font-family: "Inter", sans-serif;
  color: #2e5266;
  font-weight: 600;
}

/* ============================================
   10. RESPONSIVIDADE MOBILE (UNIFICADA)
   ============================================ */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  /* Hero */
  #home {
    min-height: auto !important;
    padding-top: 6rem !important;
  }
  #home h1 {
    font-size: 2rem !important;
    line-height: 1.2 !important;
  }
  #home .flex-col.sm\:flex-row {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  #home .flex-col.sm\:flex-row a {
    width: 100% !important;
    text-align: center !important;
  }
  #home img[alt="Foto profissional"] {
    max-height: 300px !important;
  }

  /* Sobre */
  #sobre .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  #sobre .grid.grid-cols-1.sm\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Serviços */
  #servicos .grid.md\:grid-cols-2.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  /* Timeline Mobile */
  #timeline-container::before {
    display: none;
  }
  .timeline-item-wrapper {
    margin-bottom: 3rem;
  }
  .timeline-item-wrapper > div {
    flex-direction: column !important;
  }
  .timeline-item-wrapper > div > div:nth-child(2) {
    display: none;
  } /* Esconde ano central no mobile */
  .timeline-item-wrapper > div > div:first-child,
  .timeline-item-wrapper > div > div:last-child {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    margin-bottom: 1rem;
  }
  .timeline-item-wrapper img {
    height: 200px !important;
    margin-top: 1rem !important;
  }

  /* Calendário Mobile */
  #calendario .grid.grid-cols-1.lg\:grid-cols-3 {
    grid-template-columns: 1fr !important;
  }
  #calendario .lg\:h-\[480px\] {
    height: auto !important;
    min-height: 300px !important;
  }

  /* Depoimentos */
  .swiper-slide > div {
    padding: 2rem !important;
  }

  /* Galeria Mobile */
  #galeria .grid.grid-cols-2.md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  #galeria-grid .absolute.bottom-0 {
    padding: 1rem;
    padding-top: 3rem;
  }
  #galeria-grid .absolute.bottom-0 p {
    font-size: 0.875rem !important;
  }

  /* Contato Mobile */
  #contato .grid.lg\:grid-cols-2 {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }
  #contato iframe {
    height: 250px !important;
  }
  #contact-form .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }

  /* Footer Mobile */
  footer .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }
  footer .flex.justify-center {
    justify-content: center !important;
  }

  /* Ajuste de tooltips no mobile */
  .has-event-tooltip:active::after,
  .has-event-tooltip:active::before {
    opacity: 1;
  }
}

@media (max-width: 375px) {
  h1 {
    font-size: 1.75rem !important;
  }
  h2 {
    font-size: 1.5rem !important;
  }
  h3 {
    font-size: 1.25rem !important;
  }
  .text-3xl {
    font-size: 1.5rem !important;
  }
  .text-4xl {
    font-size: 1.75rem !important;
  }
  .px-6 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  .py-24 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media print {
  header,
  footer,
  .no-print {
    display: none !important;
  }
  body {
    background: white !important;
    color: black !important;
  }
}
