/* ======= BASE ======= */
html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f7f7;
  color: #222;
}

header {
  background: #222;
  color: #fff;
  padding: 30px 0 20px 0;
  text-align: center;
  font-size: 2.3rem;
  position: relative;
}
main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 8px;
  box-sizing: border-box;
}

/* ======= TOPO/COMPARTILHAMENTO ======= */
.top-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
#shareLink {
  width: 35%;
  min-width: 180px;
  padding: 9px 8px;
  font-size: 1rem;
  border-radius: 6px 0 0 6px;
  border: 1px solid #ccc;
  outline: none;
  background: #fafafa;
  transition: box-shadow 0.16s;
  box-sizing: border-box;
}
#shareLink:focus {
  box-shadow: 0 0 0 2px #1976d2;
  border-color: #1976d2;
}
#copyLinkBtn {
  background: #4d7fff;
  color: #fff;
  border: none;
  padding: 10px 14px;
  font-size: 1rem;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.16s;
  outline: none;
}
#copyLinkBtn:active {
  background: #254eda;
}
#copyLinkBtn:focus {
  box-shadow: 0 0 0 2px #1976d2;
}

/* ======= BOTÃO LOGOUT ======= */
#logoutBtn {
  background: #df2b2b;
  color: #fff;
  border: none;
  padding: 10px 18px;
  margin-left: 10px;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}
#logoutBtn:active {
  background: #ac1919;
}
#logoutBtn:focus {
  box-shadow: 0 0 0 2px #ac1919;
}

/* ======= FORMULÁRIO DE ADIÇÃO ======= */
.add-form {
  background: #fff;
  padding: 20px 16px 16px 16px;
  margin: 28px auto 25px auto;
  border-radius: 8px;
  box-shadow: 0 2px 16px 0 rgba(40,40,40,0.08);
  max-width: 650px;
  display: block;
  box-sizing: border-box;
}
.add-form input[type="text"],
.add-form input[type="file"] {
  width: 100%;
  padding: 12px 8px;
  font-size: 1rem;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-sizing: border-box;
}
.add-form input[type="text"]:focus,
.add-form input[type="file"]:focus {
  box-shadow: 0 0 0 2px #1976d2;
  border-color: #1976d2;
}
.add-form button.salvar {
  background: #1976d2;
  color: #fff;
  padding: 12px 24px;
  border: none;
  border-radius: 7px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}
.add-form button.salvar:hover {
  background: #1357a6;
}

/* ======= FILTROS & BUSCA ======= */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}
#searchInput, #categoryFilter {
  padding: 11px 9px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}
#searchInput:focus, #categoryFilter:focus {
  box-shadow: 0 0 0 2px #1976d2;
  border-color: #1976d2;
}
.fav-filter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 1.1rem;
}

/* ======= GRID & CARD ======= */
.grid {
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  margin: 0 auto 80px auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

/* CARD */
.card {
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 2px 12px rgba(30, 40, 80, 0.09);
  padding: 17px 12px 14px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  min-height: 270px;
  transition: box-shadow 0.14s;
  max-width: 340px;
  width: 100%;
  box-sizing: border-box;
}
.card:hover {
  box-shadow: 0 3px 20px rgba(40,80,120,0.14);
}
.card .fav-btn {
  position: absolute;
  left: 8px;
  top: 8px;
  font-size: 1.8rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 4;
  transition: filter 0.2s;
  padding: 0;
}
.card .fav-btn:disabled { opacity: 0.5; cursor: default; }

.sneaker-title {
  margin: 15px 0 5px 0;
  font-size: 1.08rem;
  text-align: center;
  font-weight: bold;
}
.sneaker-description {
  font-size: 0.97rem;
  color: #444;
  min-height: 32px;
  text-align: center;
}

.actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}
.edit-btn,
.delete-btn {
  padding: 6px 15px;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.16s;
}
.edit-btn {
  background: #1976d2;
  color: #fff;
}
.edit-btn:hover { background: #0e59a1; }
.delete-btn {
  background: #df2b2b;
  color: #fff;
}
.delete-btn:hover { background: #ac1919; }

/* ======= CARROSSEL ======= */
.carousel {
  width: 100%;
  min-height: 300px;
  height: 300px;
  max-width: 300px;
  border-radius: 11px;
  overflow: hidden;
  position: relative;
  margin: 0 auto 8px auto;
  background: #ffffff !important;
  box-shadow: 0 1px 6px rgba(40,40,80,0.09);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.carousel img {
  width: 100%;
  height: 300px !important;
  max-height: 300px !important;
  object-fit: contain;
  display: none;
  transition: opacity 0.24s;
  background: #ffffff !important;
  box-sizing: border-box;
}
.carousel img.active { display: block; opacity: 1; }
.carousel button {
  /* botão seta já estilizado inline pelo JS, não mexer aqui */
}

/* ======= MODAL ======= */
.modal {
  display: none;
  position: fixed;
  z-index: 1200;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(40,48,68,0.18);
  justify-content: center;
  align-items: center;
}
.modal.show { display: flex; }
.modal-content {
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 4px 28px rgba(30,30,40,0.22);
  padding: 36px 32px 25px 32px;
  width: 99vw;
  max-width: 420px;
  position: relative;
  animation: modalfade 0.18s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}
@keyframes modalfade {
  from { opacity:0; transform: translateY(50px);}
  to   { opacity:1; transform: translateY(0);}
}
.modal-content h2 {
  text-align: center;
  margin-bottom: 16px;
  font-size: 1.18rem;
}
.modal-content input[type="text"],
.modal-content input[type="file"],
.modal-content textarea {
  width: 100%;
  padding: 12px 8px;
  margin-bottom: 11px;
  border-radius: 6px;
  border: 1px solid #bbb;
  font-size: 1rem;
  box-sizing: border-box;
}
.modal-content button[type="submit"] {
  background: #1976d2;
  color: #fff;
  padding: 11px 0;
  border: none;
  border-radius: 7px;
  font-size: 1.1rem;
  margin-top: 10px;
  cursor: pointer;
}
.close {
  position: absolute;
  right: 13px;
  top: 11px;
  font-size: 2rem;
  border: none;
  background: transparent;
  color: #bbb;
  cursor: pointer;
  transition: color 0.13s;
}
.close:hover { color: #1976d2; }
.fotos-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}
.fotos-preview img {
  width: 55px;
  height: 55px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e1e1e1;
  margin-bottom: 2px;
}
.foto-remove {
  margin-left: -12px;
  color: #df2b2b;
  font-weight: bold;
  font-size: 1.3rem;
  cursor: pointer;
  margin-right: 7px;
  user-select: none;
  position: relative;
  top: 8px;
}

/* ======= RESPONSIVIDADE ======= */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
  .card { max-width: 99vw; }
  .carousel, .carousel img { max-width: 98vw; min-width: 0; }
  /* Mantém as imagens grandes */
  .carousel { height: 300px !important; min-height: 300px !important; }
  .carousel img { height: 300px !important; max-height: 300px !important; }
  .top-actions { flex-direction: column; gap: 7px; }
  main { padding: 13px 3px;}
  .add-form { padding: 13px 3px 13px 3px; }
}
@media (max-width: 400px) {
  .modal-content { padding: 9px 2px; }
}

/* ======= LOGIN/CADASTRO/RECUPERAÇÃO - index.php ======= */
.login-cadastro-container {
  max-width: 420px;
  margin: 50px auto 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 2px 16px 0 rgba(40,40,40,0.13);
}
.login-box, .cadastro-box, .esqueci-box {
  display: block;
}
.login-box h2, .cadastro-box h2, .esqueci-box h2 {
  text-align: center;
  margin-bottom: 17px;
  font-size: 1.2rem;
}
.login-box form, .cadastro-box form, .esqueci-box form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-box input, .cadastro-box input, .esqueci-box input {
  padding: 13px 9px;
  border-radius: 6px;
  border: 1px solid #bbb;
  font-size: 1rem;
  box-sizing: border-box;
}
.login-box input:focus, .cadastro-box input:focus, .esqueci-box input:focus {
  box-shadow: 0 0 0 2px #1976d2;
  border-color: #1976d2;
}
.login-box button, .cadastro-box button, .esqueci-box button {
  background: #1976d2;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 1.1rem;
  padding: 12px 0;
  cursor: pointer;
  margin-top: 7px;
}
.form-links {
  margin: 14px 0 0 0;
  text-align: center;
  font-size: 0.97rem;
}
.form-links a { color: #1976d2; text-decoration: none; }
.form-links a:hover { text-decoration: underline; }
.form-msg {
  min-height: 20px;
  margin-top: 10px;
  color: #b91c1c;
  text-align: center;
  font-size: 1rem;
}
