/* Wizarding Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative&family=MedievalSharp&family=Uncial+Antiqua&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  scroll-behavior: smooth;
}

:root {
  --bg-color: #714e33;
  --snd-bf-color: #7c2518;
  --text-color: #1c1b26;
  --main-color: #3c231b;
  --accent-color: #ffcc00;
}

html {
  font-size: 62.5%;
  overflow-x: hidden;
}

body {
  font-family: 'Uncial Antiqua', cursive;
}

section {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
}

.header a {
  font-size: 2.5rem;
  color: #fff;
  margin-left: 4rem;
  font-weight: 700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  font-family: 'MedievalSharp', cursive;
  transition: color 0.3s ease;
}

nav {
  width: 100%;
  background-color: rgba(124, 37, 24, 0.8);
  padding: 1rem 5%;
  display: flex;
  flex-direction: row;
}

.navbar {
  width: 100%;
  display: flex;
  justify-content: center;
}

.navbar a:hover {
  color: var(--accent-color);
}

.navbar a.active {
  color: #ffcc00;
  position: relative;
}

.navbar a.active::after {
  content: '';
  position: absolute;
  width: 60%;
  height: 3px;
  background-color: #ffcc00;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 5px;
}

/* Background and content positioning */
.section-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  z-index: -1;
}

.section-background::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent overlay */
  z-index: 1;
}

.section-content {
  position: relative;
  z-index: 10;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* First section - WizzArtChamber */
.WizzArtChamber .section-background {
  background-image: url('img/hgs1.jpg');
}

/* Second section - Magic Forge */
.magic_forge .section-background {
  background-image: url('img/mgk.jpg');
}

/* Third section - Spellbook */
.spellbook-section {
  background-color: var(--main-color);
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 100vh;
  padding: 8rem 2rem 4rem;
}

.spellbook-section .section-content {
  height: auto;
  margin-bottom: 4rem;
}

span {
  color: #ffcc00;
}

h2.heading {
  font-size: 4.8rem;
  margin-bottom: 2rem;
  font-family: 'Cinzel Decorative', serif;
}

.section-content h3 {
  font-size: 3.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-family: 'Cinzel Decorative', serif;
}

.section-content p {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  max-width: 600px;
  font-family: 'Uncial Antiqua', cursive;
}

.btn {
  display: inline-block;
  padding: 1.2rem 2.8rem;
  background: var(--main-color);
  border-radius: 4rem;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
  font-size: 1.8rem;
  color: #fff;
  letter-spacing: 0.1rem;
  font-weight: 600;
  transition: 0.5s ease;
  margin-top: 2rem;
  font-family: 'MedievalSharp', cursive;
}

.btn:hover {
  background: #ffcc00;
  color: var(--main-color);
}

.section-content .generate-form{
  height: 56px;
  width: 100%;
  display: flex;
  padding: 6px 12px;
  margin: 45px 0 15px;
  align-items: center;
  justify-content: space-between;
  background: wheat;
  border-radius: 30px;
}

.section-content .generate-form:hover{
   box-shadow: 0 10px 20px #ffcc00;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.section-content .prompt-input{
  flex-grow: 1; /* This tells it to fill the available space */
  min-width: 0; /* Prevents overflow in some flexbox cases */
  height: 100%;
  border: none;
  outline: none;
  background: none;
  font-size: 1.8rem;
  font-family: 'Uncial Antiqua', cursive;
  color: var(--snd-bf-color);
  padding: 0 20px;
}

.section-content .controls{
  display: flex;
  height: 100%;
  gap: 15px;
}

.section-content .img-quantity{
  border: none;
  outline: none;
  background: none;
  font-size: 1.8rem;
  font-family: 'Uncial Antiqua', cursive;
  color: var(--snd-bf-color);
}

.section-content .generate-btn{
  font-size: 2rem;
  outline: none;
  border: none;
  background: var(--main-color);
  color: #fff;
  font-family: 'Uncial Antiqua', cursive;
  cursor: pointer;
  border-radius: 20px;
  font-weight: 500;
  padding: 10px 20px;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
}

.section-content .generate-btn:hover {
  background: #ffcc00;
  color: var(--main-color);
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
}

/* Gallery styles for third section */
.image-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
}

.image-gallery .img-card {
  width: 450px;
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-gallery .img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.image-gallery .img-card:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 25px rgba(255, 204, 0, 0.4);
}

.image-gallery .img-card .download-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-size: cover;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
  border-radius: 50%;
}

.image-gallery .img-card .download-btn:hover {
  opacity: 1;
  width: 40px;
  height: 40px;
  display: flex;
  box-shadow: 0 10px 20px #ffcc00;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.img-card.loading {
  background-color: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-card.loading img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.img-card.error {
  background-color: rgba(0, 0, 0, 0.2);
  border: 2px solid #ff6b6b;
}

.img-card.error img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.download-btn svg {
  width: 40px;
  height: 40px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 8px;
}

/* Footer styles */
.footer {
  background-color: var(--text-color);
  color: #fff;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  font-family: 'MedievalSharp', cursive;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-icon {
  font-size: 1.6rem;
  line-height: 1.8;
}

.footer-icon .linkedin {
  color: var(--accent-color);
  font-weight: 700;
  transition: all 0.3s ease;
  position: relative;
}

.footer-icon .linkedin:hover {
  color: #fff;
}

.footer-icon .linkedin::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #fff;
  transition: width 0.3s ease;
}

.footer-icon .linkedin:hover::after {
  width: 100%;
}

.tagline {
  font-size: 1.4rem;
  margin-top: 1rem;
  opacity: 0.8;
}

.heart {
  color: #e25555;
  font-size: 1.8rem;
  animation: heartbeat 1.2s infinite;
  display: inline-block;
}

@keyframes heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
}

/* Media queries for responsive design */
@media (max-width: 768px) {
  .image-gallery .img-card {
    width: calc(50% - 10px);
  }
  .navbar a {
    font-size: 2rem;
    margin-left: 2rem;
  }
  
  .spellbook-section {
    padding-top: 6rem;
  }
  
  h2.heading {
    font-size: 3.6rem;
  }
  
  .section-content h3 {
    font-size: 2.8rem;
  }
  
  .footer-icon {
    font-size: 1.4rem;
  }
  
  .navbar a.active::after {
    bottom: -6px;
    height: 2px;
  }
}

@media (max-width: 480px) {
  .image-gallery .img-card {
    width: 100%;
    max-width: 300px;
  }
  
  .header a {
    font-size: 1.8rem;
    margin-left: 2rem;
  }
  
  .footer-icon {
    font-size: 1.2rem;
  }
  .navbar a {
    font-size: 1.6rem;
    margin-left: 1rem;
  }

  /* NEW: Media query for the generate form on small screens */
  .section-content .generate-form {
    flex-direction: column; /* Stack elements vertically */
    height: auto; /* Allow the height to adjust */
    padding: 15px;
    gap: 15px; /* Add space between the stacked items */
  }

  .section-content .prompt-input {
    height: 40px; /* Give the input a fixed height */
    text-align: center;
  }

  .section-content .controls {
    width: 100%;
    justify-content: space-between; /* Space out the dropdown and button */
  }
}

