* { box-sizing: border-box; margin: 0; padding: 0; } 
body {
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.page-grid {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  background: #402352;
}

/* Areas */
.header { grid-area: header; }
.sidebar { grid-area: sidebar; }
.main { grid-area: main; }
.footer { grid-area: footer; }

/* header*/
.header {
  background: #402352;
  color: white;
  padding: 15px 30px;
  border-bottom: 4px solid #ffd43b;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav {
  display: flex;
  gap: 15px;
}
.nav-link {
  padding: 8px 14px;
  background: #ffd43b;
  color: #571979;
  text-decoration: none;
  border-radius: 8px;
  transition: 0.3s;
}
.nav-link:hover {
  background: #9c67ba;
  color:white;
}

/*sidebar*/
.sidebar {
  background: #ffd43b;
  padding: 20px;
  border-right: 4px solid #402352;
}

.sidebar h2 {
  margin:15px;
}

.popup-form .error-text {
  color: #000000;
}

.sidebar a {
  text-decoration: none;
  color: #402352;
}

.sidebar-datetime {
  background: #ffd43b;
  border-radius: 8px;
  padding: 8px;
  color: #000000;
  font-size: 14px;
  text-align: center;
}

.sidebar .btn {
  display: block;
  width: 100%;
  color: #ffffff;
  text-align: center;
  margin-top: 10px;
}

/*main content*/
.main {
  padding: 20px;
  color: #ffffff;
}

/* Titles */
.section-title {
  color: white;
  text-align: center;
  margin-bottom: 15px;
}
.section-title::before { content: "✨ "; }
.section-title::after { content: " ✨"; }

/* About */
.about-box {
  background: rgba(0,0,0,0.2);
  margin: 20px auto;
  padding: 20px;
  border: 3px solid #00000045;
  border-radius: 12px;
  width: 90%;
}
.who-grid {
  display: flex;
  gap: 20px;
}
.profile-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid #00000045;
}

/* Factory */
.factory-media {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}
.factory-img {
  width: 60%;
  border-radius: 10px;
  object-fit: cover;
}

/* FAQ */
.faq {
  margin-top: 10px;
}
.faq-item {
  margin-bottom: 10px;
}
.faq-question {
  background: #ffd43b;
  color: #402352;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0;
  transition: background 0.3s;
  user-select: none;
}
.faq-question:hover {
  background: #ffb84d;
}
.faq-question.active {
  background: #ff9f3c;
  color: white;
}

.faq-answer {
  background: rgba(0, 0, 0, 0.178);
  color: rgb(255, 255, 255);
  padding: 0 12px;
  margin-bottom: 5px;
  overflow: hidden;
  border-radius: 8px;
  transition: max-height 0.35s ease, padding 0.35s ease;
  max-height: 0; 
}

/* Cards */
.card-row {
  color: #ffffff;
  display: flex;
  gap: 20px;
  margin: 30px auto;
  justify-content: center;
  flex-wrap: wrap;
}
.card {
  background: #402352;
  border-radius: 10px;
  padding: 15px;
  max-width: 280px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 2px solid #ffd94d;              
  box-shadow: 0 2px 8px rgba(0,0,0,0.15); 
}
.card img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}
.card:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px; 
  margin: 40px auto;
  width: 90%;
}
.gallery figure {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  margin: 0;
  text-align: center;
  border: 2px solid #ffd94d;             
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.gallery img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.gallery figure:hover img {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #ffffff;
  padding: 8px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery figure:hover figcaption {
  opacity: 1;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px; 
}
.contact-form input,
.contact-form textarea {
  padding: 10px;
  border-radius: 8px;
  border: none;
}
.btn {
  background: #402352;
  color:white;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.btn:hover {
  background: #9c67ba;
  color: white;
}

.multi-form input {
  padding: 10px;         
  border-radius: 8px;   
  border: none;          
  background-color: #f9f9f9;      
}

.card-btn,
.copy-btn,
.fact-btn,
.form-btn,
.next-btn,
.back-btn,
.submit-btn{
  background: #ffd94d;
  color:#000;
}


/* Footer */
.footer {
  background: #402352;
  color: #ffffff;
  text-align: center;
  padding: 15px;
  border-top: 4px solid #ffd94d;
}

/* Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(64, 35, 82, 0.8);
  z-index: 1000;
}
.popup {
  background: #ffd94d;
  padding: 20px;
  border-radius: 12px;
  color: #402352;
  text-align: center;
  width: 320px;
}
.popup input {
  width: 100%;
  padding: 8px;
  margin: 10px 0;
  border-radius: 8px;
  border: none;
}

.hidden {
  display: none;
}

.error-text {
  color: #ffb84d;
  font-size: 14px;
  margin-top: 6px;
}

/* Rating star */
.star {
  cursor: pointer;
  transition: color 0.3s, transform 0.2s;
}
.star:hover {
  transform: scale(1.2);
}
.star.selected {
  color: #ffd43b;
}
.star.highlight {
  color: #ffb84d;
}

/* --- Random Fact Section --- */
.quote-section{
  text-align: center;
}

.quote-section h2 {
  margin-bottom: 12px;
  color: #ffffff;
}

.quote-section p {
  font-size: 1.1em;
  margin-bottom: 16px;
  color: #ffffff;
}

/* time */
.time-box {
  padding: 10px;
  text-align: center;
}

.time-box h2 {
  color: #000000;
}

#timeDisplay {
  font-size: 1.5rem;
  color: #000000;
  margin-top: 10px;
  transition: opacity 0.3s ease;
}


/* --- Keyboard Navigation Highlight --- */
.nav-item:focus {
  outline: none;
  box-shadow: 0 0 8px 2px #a36fffaa;
  background: linear-gradient(135deg, #b47cff, #7b42f6);
  color: white !important;
  transform: scale(1.03);
  transition: all 0.2s;
}

/* --- Multi-Step Form --- */
.form-step {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.active-step {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.night-mode .review-box {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid #a97cff4d;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Greeting Message --- */
.greeting-message {
  font-size: 1.4rem;
  font-weight: 500;
  text-align: center;
  color: #ffffff;
  margin-top: 10px;
  transition: color 0.3s ease, opacity 0.5s ease;
}

/*Search */
.gallery-search {
  text-align: center;
  margin-bottom: 20px;
}

#wonkaSearch {
  width: 60%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  outline: none;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

#wonkaSearch:focus {
  border-color: #a67c52;
  box-shadow: 0 0 5px #a67c52;
}

.gallery figure {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery figure[style*="display: none"] {
  opacity: 0;
  transform: scale(0.95);
}

/*Autoearch */
.suggestions-list {
  position: absolute;
  width: 60%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  list-style: none;
  padding: 0;
  margin: 5px 0 15px 0;
  z-index: 10;
  max-height: 200px;
  overflow-y: auto;
}

.suggestions-list li {
  padding: 10px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.suggestions-list li:hover {
  background: #f0e6d2;
}

/*Search highlighting FAQ*/
.faq-search {
  text-align: center;
  margin-bottom: 15px;
}

#faqSearch {
  width: 60%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

#faqSearch:focus {
  border-color: #a67c52;
  box-shadow: 0 0 5px #a67c52;
}

mark {
  background-color: #5f3bff49;
  color: #000;
  padding: 0 2px;
  border-radius: 3px;
}


/* Scroll Progress Bar */
#scrollBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 8px;
  width: 0%;
  background: linear-gradient(90deg, #ff8c00, #ff4d4d, #ff66cc, #cc66ff, #66ccff);
  background-size: 400% 100%;
  animation: gradientMove 4s infinite linear;
  border-radius: 0 10px 10px 0;
  z-index: 9999;
  transition: width 0.2s ease;
}

/* Moving gradient effect */
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Counter */
.counter-item {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.counter-item .count {
  color: #000000;
  transition: color 0.3s ease;
}

.counter-item p {
  margin: 5px 0 0;
  font-size: 15px;
  color: #000000;
}

/* Loading Spinner */
.spinner {
  border: 3px solid rgba(0, 0, 0, 0);
  border-top: 3px solid #fdd835;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Notification System */
#notification-container {
  position: fixed;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: auto;
  max-width: 90%;
  text-align: center;
}

.notification {
  background-color: #2e1a47;
  color: #fdd835;
  padding: 15px 25px;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(253, 216, 53, 0.5);
  opacity: 0;
  transform: translateY(-10px);
  animation: fadeIn 0.4s forwards, fadeOut 0.4s ease 3s forwards;
  font-size: 15px;
  letter-spacing: 0.5px;
  text-align: center;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(-15px);
  }
}

.copy-btn {
  margin-top: 8px;
}

/* Copy tooltip */
#copy-tooltip {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#copy-tooltip.show {
  opacity: 1;
}

.lazy-img {
  filter: blur(6px);
  transition: filter 0.4s ease;
}

.lazy-img[src] {
  filter: blur(0);
}


/* Hide sidebar on mobile by default */
@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%); 
    z-index: 1000;
  }

  /* Show sidebar when active */
  .sidebar.active {
    transform: translateX(0);
  }

  /* Hamburger button */
  .sidebar-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #fff;
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1100;
  }
}

/* Hide button on desktop */
@media (min-width: 993px) {
  .sidebar-toggle {
    display: none;
  }

  .sidebar {
    transform: translateX(0); 
    position: static;
    height: auto;
  }
}

@media (max-width: 992px) {
  .page-grid {
    grid-template-areas:
      "header header"
      "main main"
      "sidebar sidebar"
      "footer footer";
    grid-template-columns: 1fr;
  }

  .who-grid, .factory-media {
    flex-direction: column;
    align-items: center;
  }

  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .profile-img {
    width: 150px;
    height: 150px;
  }

  .card {
    max-width: 90%;
  }

  #wonkaSearch, #faqSearch {
    width: 90%;
  }
}

/* theme */
body.light-mode .header,
body.light-mode .footer {
  background-color: #C794A2;
}
body.light-mode .sidebar{
  background-color:#EAD7DC;
}

body.light-mode .main,
body.light-mode .card{
  background-color:  #EAD7DC;
}

body.light-mode a {
  color: #000000;
}

body.light-mode .btn {
  background-color: #C794A2;
  color: #000000;
}

body.light-mode .btn:hover {
  background-color: #B26C7F;
  color: #000000;
}

body.light-mode .site-title,
body.light-mode .sidebar,
body.light-mode .greeting-message,
body.light-mode .section-title,
body.light-mode .who-text,
body.light-mode .img-text,
body.light-mode .factory-list,
body.light-mode .fun-facts,
body.light-mode .card,
body.light-mode .quote-section .faq-answer,
body.light-mode #ratingMessage,
body.light-mode .footer {
  color:#441c1c;
}

body.light-mode .quote-section p {
  color:rgb(37, 37, 37);
}
body.light-mode input,
body.light-mode textarea {
  background-color: #ffffff;
  color: #000000;
  border: 1px solid #b8b8b8;
}

body.light-mode .sidebar-counter .text-count {
  color:rgb(0, 0, 0)
}

body.light-mode .time-box #timeDisplay {
  color:rgb(0, 0, 0)
}

.theme-toggle {
  position: fixed;
  top: 400px;
  right: 0px;
  z-index: 1000;
}

.toggle-label {
  display: inline-block;
  width: 60px;
  height: 30px;
  background-color: #222;
  border-radius: 30px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s;
}

.toggle-label::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  left: 2px;
  top: 2px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform 0.4s;
}

#themeToggle {
  display: none;
}

#themeToggle:checked + .toggle-label {
  background-color: #f1c40f; 
}

#themeToggle:checked + .toggle-label::before {
  transform: translateX(30px);
}

input.invalid {
  border: 2px solid red;
}
