/* IMPORTAÇÃO DE FONTES */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* VARIÁVEIS ROOT E ESTILOS GERAIS - TEMA MODERNO */
:root {
  --primary-accent: #2c3e50; /* Azul Ardósia */
  --primary-accent-dark: #1a252f;
  --secondary-accent: #1abc9c; /* Verde Menta */
  --bg: #ecf0f1; /* Cinza Claro */
  --card-bg: #ffffff;
  --text-dark: #34495e; /* Azul Petróleo */
  --text-muted: #7f8c8d; /* Cinza Médio */
  --border-color: #bdc3c7; /* Cinza Prata */
  --success-color: #000000;
  --danger-color: #c0392b;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(44, 62, 80, 0.1);
}

* { box-sizing: border-box; }

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  background-color: var(--bg);
  color: var(--text-dark);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* CABEÇALHO */
.site-header {
  background: var(--primary-accent);
  color: var(--card-bg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 40px;
  height: 40px;
}
/* Cores do ícone de lupa e caixa */
.brand-icon .icon-magnifier-glass {
    fill: none;
    stroke: var(--card-bg);
    stroke-width: 4;
    stroke-miterlimit: 10;
}
.brand-icon .icon-box-top {
    fill: var(--secondary-accent);
    stroke: var(--primary-accent-dark);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.brand-icon .icon-box-side {
    fill: none;
    stroke: var(--primary-accent-dark);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.brand h1 { margin: 0; font-size: 1.5rem; }
.brand a { color: var(--card-bg); text-decoration: none; font-weight: 700; }

.search-bar {
  flex-grow: 1;
  display: flex;
  align-items: center;
  background: var(--primary-accent-dark);
  border-radius: var(--radius);
  padding: 0 0.8rem;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--secondary-accent); }
.search-bar i { color: var(--text-muted); }
.search-bar input {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.7rem 0.5rem;
  font-size: 1rem;
  outline: none;
  color: var(--card-bg);
}
.search-bar input::placeholder { color: var(--text-muted); }

.header-actions { display: flex; align-items: center; gap: 1rem; }
.auth-area { font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.auth-area .btn { background: var(--secondary-accent); color: var(--primary-accent-dark); border: none; }
.auth-area .btn:hover { opacity: 0.9; }

/* NAVEGAÇÃO DE FILTRO */
.filter-nav {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
}
.filter-nav .container { display: flex; gap: 0.5rem; }
.nav-btn {
  background: transparent;
  border: none;
  border-bottom: 4px solid transparent;
  padding: 0.8rem 1rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
}
.nav-btn.active, .nav-btn:hover {
  color: var(--primary-accent);
  border-bottom-color: var(--secondary-accent);
}

/* BOTÕES */
.btn {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn.primary {
  background: var(--primary-accent);
  color: #fff;
  border-color: var(--primary-accent);
}
.btn.primary:hover { background: var(--primary-accent-dark); transform: translateY(-2px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Grade de itens e cartões do feed */
.feed-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding-top: 1.5rem;
}

.feed-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}
.feed-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

.item-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.item-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.item-body h4 { font-size: 1.1rem; margin: 0.5rem 0; }

.item-badge {
  background-color: var(--secondary-accent);
  color: var(--primary-accent-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  align-self: flex-start;
  text-transform: capitalize;
}

.item-status { font-weight: 700; }
.item-status.perdido { color: var(--danger-color); }
.item-status.encontrado { color: var(--success-color); }

.item-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}
.item-actions .btn { width: 100%; justify-content: center; }


/* ESTILOS DO MODAL */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
  align-items: center;
  justify-content: center;
}
.modal.show { display: flex; }

.modal-content {
  background-color: var(--card-bg);
  margin: auto;
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  width: 90%;
  max-width: 600px;
  position: relative;
  animation: slide-down 0.3s ease-out;
}

.modal-close {
  color: var(--text-muted);
  position: absolute;
  top: 1rem; right: 1.5rem;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  border: none;
  background: none;
}
.modal-close:hover { color: var(--text-dark); }

@keyframes slide-down {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ESTILOS DO FORMULÁRIO (dentro do modal) */
.item-form .row { display: flex; gap: 1rem; }
.item-form .field { display: block; flex: 1; font-size: 1rem; margin-bottom: 1rem; }
.item-form input, .item-form textarea, .item-form select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 0.25rem;
  font-size: 1rem;
}
.form-actions { display: flex; gap: 1rem; margin-top: 1rem; justify-content: flex-end; }


/* DETALHES ESPECÍFICOS DO MODAL */
#detailsModalContent img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
#detailsModalContent h3 { margin-top: 0; font-size: 1.8rem; }
#comments-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}
.comment { background: var(--bg); padding: 0.8rem; border-radius: 8px; margin-top: 0.5rem; }


/* RODAPÉ */
.site-footer {
  background: var(--primary-accent);
  padding: 2.5rem 0;
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.8);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}
.footer-column h4 { color: var(--card-bg); margin-top: 0; }
.footer-column ul { list-style: none; padding: 0; }
.footer-column ul li { margin-bottom: 0.5rem; }
.footer-column a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.footer-column a:hover { color: var(--card-bg); }

/* ESTILOS DE NOTIFICAÇÃO TOAST */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  animation: slide-up 0.5s ease-out forwards;
}
.toast.success { background-color: var(--success-color); }
.toast.error { background-color: var(--danger-color); }
.toast.show {
  opacity: 1;
  visibility: visible;
}
@keyframes slide-up {
  from {
    transform: translate(-50%, 30px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}


/* RESPONSIVIDADE */
@media(max-width: 768px) {
  .header-inner { flex-wrap: wrap; }
  .search-bar { order: 3; width: 100%; flex-basis: 100%; }
  .filter-nav .container { overflow-x: auto; }
  .form-actions { justify-content: center; }
  .item-form .row { flex-direction: column; }
}
