/* General Styles */
:root {
  --primary-color: #0088ff;
  --secondary-color: #00154c;
  --bg-dark: #0f172a;
  --glass-bg: rgba(15, 23, 42, 0.8);
  --glass-border: rgba(255, 255, 255, 0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #000;
  background-image: url('QRCODEBG.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: transparent;
  pointer-events: none;
}

/* Navigation Styles (Matching Main Site) */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--glass-border);
  height: 95px;
  display: flex;
  align-items: center;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 6%;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.logo img {
  height: 62px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  transition: var(--transition);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.project-name {
  color: white;
  font-weight: 700;
  letter-spacing: 3px;
  font-size: 1.15rem;
  padding-right: 2.5rem;
  border-right: 1px solid var(--glass-border);
  height: 30px;
  display: flex;
  align-items: center;
}

.back-home {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.back-home:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* Main Content Area */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 120px 20px 60px;
  position: relative;
  min-height: calc(100vh - 80px);
}

.qr-container {
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  padding: 50px 40px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  width: 100%;
  max-width: 650px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.qr-card-header {
  margin-bottom: 40px;
}

.qr-logo {
  width: 220px;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 25px;
}

.qr-container h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.info-divider {
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  margin: 0 auto;
  border-radius: 2px;
}

/* Form Organization */
.input-group {
  margin-bottom: 30px;
  text-align: left;
}

.input-group label {
  display: block;
  margin-bottom: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.input-group input {
  width: 100%;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  color: white;
  font-size: 1rem;
  transition: var(--transition);
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(0, 136, 255, 0.1);
}

.options-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 20px;
  margin-bottom: 35px;
  text-align: left;
}

.dropdown label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.dropdown select,
.color-input-wrapper {
  width: 100%;
  padding: 12px 15px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: white;
  appearance: none;
  font-size: 0.9rem;
}

.color-input-wrapper {
  padding: 4px 10px;
  display: flex;
  align-items: center;
}

#qr-color {
  width: 100%;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* Generation Sequence Area */
.generation-area {
  position: relative;
  min-height: 0;
  transition: min-height 0.4s ease;
  margin-bottom: 30px;
}

.generation-area:has(#qr-loader:not(.hidden)),
.generation-area:has(#qr-display:not(.hidden)) {
  min-height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.loader-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  width: 100%;
}

.circular-loader {
  width: 55px;
  height: 55px;
  border: 5px solid rgba(255, 255, 255, 0.1);
  border-top: 5px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loader-wrapper p {
  color: white;
  font-weight: 500;
  letter-spacing: 1px;
  font-size: 0.95rem;
  margin: 0;
}

/* Premium Primary Button */
.premium-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #00154c 0%, #0088ff 100%);
  border: none;
  border-radius: 16px;
  color: white;
  font-weight: 600;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.premium-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 136, 255, 0.4);
  filter: brightness(1.1);
}

#generate-btn.download {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

#generate-btn.download:hover {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
}

/* Result Reveal */
#qr-display {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#qr-code {
  background: white;
  padding: 20px;
  border-radius: 16px;
  display: inline-block;
  margin-bottom: 25px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

#qr-code img {
  max-width: 100%;
  height: auto;
}

#color-changer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

#color-changer label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
}

#color-slider {
  width: 65px;
  height: 35px;
  border: none;
  background: none;
  cursor: pointer;
}

/* Secondary Actions */
.clear-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  margin-top: 25px;
  padding: 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  font-weight: 500;
}

.clear-btn:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

/* Premium Footer */
footer.footer {
  background: rgba(15, 23, 42, 0.95);
  padding: 3rem 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
  backdrop-filter: blur(10px);
}

footer p {
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  font-size: 0.95rem;
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
  nav {
    padding: 0 4%;
  }
}

@media (max-width: 768px) {
  header {
    height: 70px;
  }

  .logo img {
    height: 38px;
  }

  .nav-right {
    gap: 1.5rem;
  }

  .project-name {
    font-size: 1rem;
    padding-right: 1.5rem;
    letter-spacing: 2px;
  }

  .back-home {
    font-size: 0.9rem;
  }

  main {
    padding-top: 100px;
  }

  .qr-container {
    padding: 40px 25px;
    width: 92%;
  }

  .qr-logo {
    width: 150px;
  }

  .qr-container h1 {
    font-size: 1.5rem;
  }

  .options-group {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .nav-right {
    gap: 1rem;
  }

  .project-name {
    display: none;
    /* Hide project name on very small screens for more space */
  }

  .back-home span {
    display: none;
    /* Hide label, keep icon */
  }

  .back-home::after {
    content: 'Home';
    font-size: 0.85rem;
  }

  .qr-container {
    padding: 30px 15px;
    width: 95%;
  }

  .qr-logo {
    width: 120px;
  }

  .qr-container h1 {
    font-size: 1.3rem;
    letter-spacing: 1px;
  }

  .options-group {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .premium-btn {
    padding: 15px;
    font-size: 1rem;
    letter-spacing: 1px;
  }
}