/* QR Generator — golden luxury */
.tool-page-shell .qr-container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0 0;
}

.qr-tool {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.97), rgba(248, 238, 222, 0.97));
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 14px 36px -24px rgba(94, 65, 30, 0.35);
  border: 1px solid rgba(145, 103, 48, 0.2);
  margin-bottom: 0;
}

.tool-page-shell .qr-container > *:last-child {
  margin-bottom: 0 !important;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  color: #5e4329;
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#qr-input {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 8px;
  background: #fffaf2;
  color: #4a351f;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  resize: vertical;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

#qr-input:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.16);
}

#qr-input::placeholder {
  color: #8c7558;
}

.char-counter {
  display: flex;
  justify-content: flex-end;
  margin-top: 5px;
  font-size: 0.85rem;
  color: rgba(88, 64, 38, 0.65);
  font-weight: 500;
}

#char-count {
  color: #7a5526;
  font-weight: 600;
  transition: color 0.3s ease;
}

.char-counter.warning #char-count {
  color: #c9a04a;
}

.char-counter.danger #char-count {
  color: #b84a3d;
}

.options-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.size-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.size-selector label {
  color: #5e4329;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
}

#qr-size {
  padding: 12px 16px;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 8px;
  background: #fffaf2;
  color: #4a351f;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

#qr-size:focus {
  outline: none;
  border-color: #ab7c34;
  box-shadow: 0 0 0 3px rgba(171, 124, 52, 0.14);
}

.color-options {
  display: flex;
  gap: 15px;
  flex: 1;
}

.color-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.color-group label {
  color: #5e4329;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.color-group input[type="color"] {
  width: 100%;
  height: 45px;
  border: 1px solid rgba(145, 103, 48, 0.26);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.color-group input[type="color"]:hover {
  border-color: #ab7c34;
}

#generate-btn i {
  font-size: 1.2rem;
  margin-right: 10px;
}

.output-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
}

.qr-display {
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1;
  border: 2px dashed rgba(145, 103, 48, 0.28);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fffaf2;
  transition: all 0.3s ease;
}

.qr-display.has-qr {
  border: 3px solid rgba(182, 138, 58, 0.55);
  background: #ffffff;
  box-shadow: 0 12px 32px -16px rgba(94, 65, 30, 0.35);
  position: relative;
}

.qr-display.has-qr::before {
  content: '';
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  background: linear-gradient(45deg, #d4a84b, #bc8e3d, #c9a04a, #9f742f);
  border-radius: 20px;
  z-index: -1;
  opacity: 0.22;
  animation: borderGlow 3s ease-in-out infinite alternate;
}

@keyframes borderGlow {
  0% { opacity: 0.2; transform: scale(1); }
  100% { opacity: 0.35; transform: scale(1.02); }
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(88, 64, 38, 0.55);
  text-align: center;
}

.qr-placeholder i {
  font-size: 3rem;
  color: rgba(182, 138, 58, 0.35);
}

.qr-placeholder p {
  margin: 0;
  font-size: 1rem;
  color: rgba(88, 64, 38, 0.65);
}

#qr-display img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  border: 20px solid;
  border-color: #ffffff;
  box-sizing: border-box;
  display: block;
}

.download-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#download-btn i {
  font-size: 1.1rem;
  margin-right: 10px;
}

.download-info {
  color: rgba(88, 64, 38, 0.65);
  font-size: 0.9rem;
  margin: 0;
  text-align: center;
}

.generating {
  opacity: 0.7;
  pointer-events: none;
}

.generating .btn {
  position: relative;
}

.generating .btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.error-message {
  color: #9a3f2b;
  background: rgba(173, 82, 47, 0.1);
  border: 1px solid rgba(154, 63, 43, 0.28);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  font-size: 0.9rem;
  text-align: center;
}

.success-animation {
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 768px) {
  .qr-container {
    padding: 0;
  }

  .qr-tool {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 25px;
  }

  .options-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .color-options {
    flex-direction: row;
    gap: 15px;
    justify-content: space-between;
  }

  .qr-display {
    max-width: 280px;
  }

  #generate-btn {
    width: 100%;
    justify-content: center;
    padding: 18px 32px;
    font-size: 1rem;
  }

  #download-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .qr-tool {
    padding: 20px;
  }

  .qr-display {
    max-width: 240px;
  }
}

@media (prefers-contrast: high) {
  .qr-display {
    border-color: #ab7c34;
  }

  #qr-input,
  #qr-size {
    border-color: #ab7c34;
  }
}
