/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #fff8f0;
  color: #333;
  line-height: 1.6;
  padding: 0 1rem;
}

/* Header and Navigation */
header {
  background: #ffb347;
  padding: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Add subtle slide-in from top on page load */
  animation: slideDown 0.7s ease forwards;
}

header img {
  margin-left: 1rem;
  width: 120px;
  /* Logo bounce effect on hover */
  transition: transform 0.3s ease;
}

header img:hover {
  animation: bounce 0.6s;
  animation-fill-mode: forwards;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin-right: 1rem;
}

nav a {
  text-decoration: none;
  padding: 0.5rem 1rem;
  color: #333;
  font-weight: bold;
  border-radius: 8px;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
  overflow: hidden;
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

nav a:hover,
nav a.active {
  background-color: #fff3e0;
}

/* Main Content */
main {
  max-width: 960px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  /* Fade in content */
  animation: fadeIn 1.2s ease forwards;
}

/* Animate main heading */
main h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #e65100;
  animation: colorPulse 3s ease-in-out infinite;
}

/* Ice Cream Gallery */
.ice-cream-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.ice-cream-gallery article {
  background: #fff7ec;
  padding: 1rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  cursor: pointer;
  /* Slight scale up on hover */
}

.ice-cream-gallery article:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 16px rgba(230, 81, 0, 0.3);
}

.ice-cream-gallery img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  /* Fade in with slide from bottom */
  animation: fadeUp 0.8s ease forwards;
}

/* Form Styles - Enhanced */
form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2rem;
}

form > div,
fieldset {
  background: #fffaf3;
  padding: 1rem;
  border-radius: 12px;
  border: 2px solid #ffe0b2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

form > div {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

fieldset {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

legend {
  font-weight: bold;
  color: #e65100;
  padding: 0 0.5rem;
}

form label {
  font-weight: 600;
  color: #5d4037;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

form input[type="text"],
form input[type="password"],
form input[type="email"],
form select,
form textarea {
  padding: 0.75rem 1rem;
  border: 2px solid #ffe0b2;
  border-radius: 10px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: #fffaf3;
}

form input[type="text"]:focus,
form input[type="password"]:focus,
form input[type="email"]:focus,
form select:focus,
form textarea:focus {
  border-color: #ff9800;
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.2);
}

form input[type="radio"],
form input[type="checkbox"] {
  margin-right: 0.4rem;
  accent-color: #ff9800;
  transform: scale(1.1);
}

form input[type="submit"] {
  padding: 0.75rem 1rem;
  background-color: #ff9800;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  width: fit-content;
  align-self: start;
}

form input[type="submit"]:hover {
  background-color: #e65100;
  transform: translateY(-2px);
}

.error-message {
  font-size: 0.9em;
  color: red;
  margin-top: 4px;
}

#genderGroup {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 2rem;
  padding: 1rem;
  color: #888;
  font-size: 0.9rem;
  /* Fade in footer */
  animation: fadeIn 1.5s ease forwards;
}

/* Responsive Navigation (Mobile) */
@media (max-width: 600px) {
  nav ul {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 1rem;
  }
}

/* Image Size */
img {
  height: 100px;
}

/* Animations */

/* Slide down from top for header */
@keyframes slideDown {
  0% {
    transform: translateY(-100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Bounce effect for logo hover */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-15px);
  }
}

/* Fade in */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Color pulse effect for main heading */
@keyframes colorPulse {
  0%, 100% {
    color: #e65100;
  }
  50% {
    color: #ffb347;
  }
}

/* Fade in and slide up */
@keyframes fadeUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
