:root {
  --primary-green: #2f5c46; /* Eucalyptus / Sage Green */
  --secondary-green: #4a7056;
  --light-green: #8da993;
  --cream: #fdfdd0;
  --gold: #d4af37;
  --text-dark: #1a1a1a;
  --text-light: #f5f5f5;
  --taken-gray: #b0b0b0;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.9);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-image:
    radial-gradient(#2f5c46 0.5px, transparent 0.5px),
    radial-gradient(#2f5c46 0.5px, #fdfdd0 0.5px);
  background-size: 20px 20px;
  background-position:
    0 0,
    10px 10px;
}

header {
  background-color: transparent; /* Remove solid green */
  color: var(
    --primary-green
  ); /* Change text color since bg is now clear/image */
  text-align: center;
  padding: 0; /* Remove padding, let hero dictate size */
  box-shadow: none; /* Remove shadow from header container */
  margin-bottom: 0; /* Remove bottom margin to let hero handle it */
  position: relative;
  overflow: visible;
  height: auto;
}

header h1 {
  font-family: "Playfair Display", serif;
  font-size: 3rem; /* Larger */
  margin-bottom: 0.5rem;
  color: #fdfdd0; /* Cream text for dark background */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

header p {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 1.5rem;
  color: #fdfdd0;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.hero-details {
  margin-top: 10px;
  font-size: 1.1rem;
  color: #fdfdd0;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.gift-card {
  background: var(--glass-bg);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
}

.gift-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.gift-card.taken {
  background: #e0e0e0;
  color: var(--taken-gray);
  cursor: default;
  border: none;
}

.gift-card.taken:hover {
  transform: none;
  box-shadow: var(--shadow);
}

.gift-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-green);
}

.gift-card.taken .gift-name {
  color: var(--taken-gray);
  text-decoration: line-through;
}

.gift-status {
  font-size: 0.9rem;
  color: var(--secondary-green);
  font-weight: 500;
}

.gift-card.taken .gift-status {
  color: var(--taken-gray);
  font-style: italic;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h2 {
  color: var(--primary-green);
  font-family: "Playfair Display", serif;
  margin-bottom: 1rem;
}

.modal input {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--light-green);
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.modal input:focus {
  border-color: var(--primary-green);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-confirm {
  background-color: var(--primary-green);
  color: white;
}

.btn-confirm:hover {
  background-color: var(--secondary-green);
}

.btn-cancel {
  background-color: #f0f0f0;
  color: #666;
}

.btn-cancel:hover {
  background-color: #e0e0e0;
}

/* Loading/Error States */
.loading {
  text-align: center;
  padding: 2rem;
  font-size: 1.2rem;
  color: var(--secondary-green);
}

.unmark-text {
  color: #e57373; /* Pastel Red */
  font-size: 0.85rem;
  margin-top: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hero Section */
.hero-container {
  width: 100%;
  /* Remove max-width to allow full bleed as requested "cobrir toda a área" */
  margin: 0 0 2rem 0;
  position: relative;
  overflow: hidden;
  /* Maintain aspect ratio */
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image {
  width: 100%;
  max-width: 1000px;
  height: 512px;
  background-image: url("assets/pedido-noivado.svg");
  background-size: cover;
  background-position: center;

  /* Fade out effect (dissolving edges) - Only Left and Right */
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 10%,
    black 90%,
    transparent 100%
  );
}

/* Gradient overlay for text readability at the bottom */
.hero-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  pointer-events: none;
}

.hero-content {
  position: absolute;
  bottom: 2rem; /* Move to bottom as requested */
  left: 50%;
  transform: translateX(-50%); /* Center horizontally only */
  z-index: 2;
  text-align: center;
  width: 100%;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); /* Stronger shadow for bottom text */
}

.hero-details {
  margin-top: 10px;
  font-size: 1.1rem;
  color: #fdfdd0;
  font-weight: 500;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Global dark overlay for hero image */
.hero-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3); /* Requested "sombra por cima" */
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 600px) {
  header h1 {
    font-size: 2.2rem;
  }

  .container {
    padding: 0 0.5rem 2rem;
  }

  .hero-container {
    /* On mobile, standard behavior, maybe contain to prevent cutting off too much?
       User said "pode ser que fique desproporcional... faça de um jeito que fique proporcional"
       background-size: cover handles filling.
       aspect-ratio handles height.
    */
    width: 100%;
  }
}
