/* Modern Italian Villas - Improved Centered, Colorful, Modern CSS */

/* Background gradient for the whole page */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #ececec 0%, #bdbdbd 100%);
  color: #2d2d2d;
}

/* Header styles */
.modern-header {
  position: relative;
  background: linear-gradient(90deg, #6d4c41 0%, #a1887f 100%);
  padding: 56px 0 32px 0;
  box-shadow: 0 2px 24px rgba(80,60,20,0.10);
  overflow: hidden;
  text-align: center;
}
.header-bg {
  display: none;
}
.modern-header h1 {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.villa-icon {
  font-size: 2.2rem;
  color: #ffe082;
  filter: drop-shadow(0 2px 2px #fff8e1);
}

.byline {
  text-align: center;
  font-size: 1.2rem;
  color: #ffe082;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 0;
  letter-spacing: 1px;
}
.feature-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #bdbdbd;
  box-shadow: 0 2px 12px #ffe08299;
}
.caption {
  font-size: 0.95rem;
  color: #6d4c41;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Center nav */
nav ul {
  display: flex;
  justify-content: center;
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 32px 0 0 0;
  position: relative;
  z-index: 2;
}

nav ul li a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 10px 22px;
  border-radius: 12px;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  background: rgba(255,255,255,0.10);
  box-shadow: 0 2px 8px rgba(80,60,20,0.07);
}
nav ul li a:hover {
  color: #6d4c41;
  background: #ffe082;
  box-shadow: 0 4px 16px rgba(80,60,20,0.14);
}

/* Card sections */
main {
  max-width: 980px;
  margin: 40px auto 0 auto;
  padding: 0 16px;
  text-align: center;
}
.card {
  margin-bottom: 48px;
  background: linear-gradient(120deg, #fff 80%, #ffe082 100%);
  border-radius: 28px;
  box-shadow: 0 4px 32px rgba(80,60,20,0.13);
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, background 0.2s;
  text-align: center;
}
.card:hover {
  box-shadow: 0 12px 48px rgba(80,60,20,0.18);
  background: linear-gradient(120deg, #fff 60%, #ffe082 100%);
}
.card h2 {
  margin-top: 0;
  color: #6d4c41;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.card h3 {
  color: #4e342e;
  margin-bottom: 8px;
  font-size: 1.2rem;
  font-weight: 600;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
  margin: 32px 0 0 0;
  justify-items: center;
}
.feature {
  background: #f5f5f5;
  border-radius: 18px;
  box-shadow: 0 2px 12px rgba(80,60,20,0.09);
  padding: 32px 18px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}
.feature:hover {
  box-shadow: 0 8px 24px rgba(80,120,180,0.18);
  transform: scale(1.06) translateY(-2px);
  background: #ffe082;
}
.feature-icon {
  font-size: 2.2rem;
  color: #a1887f;
  margin-bottom: 8px;
  display: block;
}

/* Buttons */
.info-btn, .quiz-btn {
  margin-top: 28px;
  background: linear-gradient(90deg, #6d4c41 60%, #ffe082 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 38px;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
  box-shadow: 0 2px 8px rgba(80,60,20,0.09);
}
.info-btn:hover, .quiz-btn:hover {
  background: #ffe082;
  color: #6d4c41;
  box-shadow: 0 4px 16px rgba(80,60,20,0.18);
}

/* Gallery */
.villa-gallery-modern {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
}
.villa-thumb-modern {
  background: #6d4c41;
  border-radius: 22px;
  box-shadow: 0 2px 16px rgba(80,60,20,0.13);
  overflow: hidden;
  cursor: pointer;
  width: 240px;
  position: relative;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 4px solid #ffe082;
}
.villa-thumb-modern:hover {
  box-shadow: 0 12px 32px rgba(80,60,20,0.22);
  transform: scale(1.08) translateY(-6px);
  border-color: #a1887f;
}
.villa-thumb-modern img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #bdbdbd;
  transition: filter 0.2s;
}
.villa-thumb-modern:hover img {
  filter: brightness(0.92) saturate(1.2);
}
.villa-thumb-overlay {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  background: linear-gradient(0deg, #a1887f 90%, transparent 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 16px 0 10px 0;
  text-align: center;
  letter-spacing: 1px;
}

/* Quiz */
.quiz-row {
  margin-bottom: 22px;
}
#villaQuiz label {
  font-weight: 600;
  color: #6d4c41;
  font-size: 1.12rem;
}
#villaQuiz select {
  margin-left: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 2px solid #ffe082;
  font-size: 1.05rem;
  background: #f5f5f5;
  color: #6d4c41;
  transition: border 0.2s;
}
#villaQuiz select:focus {
  border: 2px solid #a1887f;
  outline: none;
}
#quizResult {
  margin-top: 22px;
  font-size: 1.18rem;
  font-weight: 700;
}

/* Sources */
.sources-list {
  margin-top: 28px;
  padding-left: 18px;
  text-align: left;
  display: inline-block;
}
.sources-list li {
  margin-bottom: 12px;
}
.sources-list a {
  color: #6d4c41;
  font-weight: 700;
  text-decoration: underline;
  transition: color 0.2s;
}
.sources-list a:hover {
  color: #ffe082;
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(77, 67, 61, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: linear-gradient(120deg, #fff 80%, #ffe082 100%);
  border-radius: 28px;
  box-shadow: 0 12px 48px rgba(80,60,20,0.22);
  padding: 48px 32px;
  max-width: 440px;
  width: 96vw;
  position: relative;
  text-align: center;
  animation: modalIn 0.3s cubic-bezier(.77,0,.18,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95);}
  to { opacity: 1; transform: scale(1);}
}
.close {
  position: absolute;
  top: 18px;
  right: 28px;
  font-size: 2.4rem;
  color: #a1887f;
  cursor: pointer;
  font-weight: bold;
  transition: color 0.2s;
}
.close:hover {
  color: #ffe082;
}

/* Footer */
.modern-footer {
  background: linear-gradient(90deg, #6d4c41 0%, #a1887f 100%);
  color: #fff;
  text-align: center;
  padding: 36px 0 18px 0;
  font-size: 1.18rem;
  margin-top: 72px;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  box-shadow: 0 -2px 24px rgba(80,60,20,0.10);
  letter-spacing: 1px;
}

/* Responsive */
@media (max-width: 900px) {
  main {
    max-width: 99vw;
    padding: 0 2vw;
  }
  .card {
    padding: 28px 8px;
  }
  .villa-gallery-modern {
    gap: 16px;
  }
  .villa-thumb-modern {
    width: 90vw;
    min-width: 120px;
  }
  .modal-content {
    padding: 28px 8px;
    max-width: 98vw;
  }
  .modern-header h1 {
    font-size: 2.1rem;
    padding-left: 0;
  }
  nav ul {
    gap: 12px;
  }
}