/*=============== QR GENERATOR ===============*/
.qr-generator__container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem 2rem 1rem;
}

.qr-generator__grid {
  display: grid;
  gap: 2rem;
}

/*=============== CONTENT CARDS ===============*/
.qr-generator__content {
  background-color: var(--container-color);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 4px 12px hsla(207, 24%, 35%, 0.1);
  transition: background 0.4s, box-shadow 0.4s;
}

.qr-generator__title-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.qr-generator__title {
  font-size: var(--h2-font-size);
  color: var(--title-color);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: var(--font-semi-bold);
  transition: color 0.4s;
}

.qr-generator__title-header .qr-generator__title {
  margin-bottom: 0;
}

.qr-generator__title i {
  font-size: 1.5rem;
  color: var(--first-color);
}

.qr-generator__share-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
}

.qr-generator__share-btn i {
  font-size: 1.5rem;
  color: var(--first-color);
}

.qr-generator__share-btn:hover {
  transform: scale(1.1);
}

.qr-generator__share-btn:active {
  transform: scale(0.95);
}

/*=============== INPUT SECTION ===============*/
.qr-generator__input-group {
  margin-bottom: 1rem;
}

.qr-generator__label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: var(--small-font-size);
  color: var(--text-color);
  font-weight: var(--font-medium);
  transition: color 0.4s;
}

.qr-generator__input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--body-color);
  border-radius: 0.5rem;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--text-color);
  background-color: var(--body-color);
  transition: all 0.3s;
}

.qr-generator__input:focus {
  outline: none;
  border-color: var(--first-color);
  box-shadow: 0 0 0 3px hsla(207, 65%, 65%, 0.1);
}

/*=============== OPTIONS GRID ===============*/
.qr-generator__options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.qr-generator__option {
  display: flex;
  flex-direction: column;
}

.qr-generator__select {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 0.75rem;
  border: 2px solid var(--body-color);
  border-radius: 0.5rem;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  color: var(--text-color);
  background-color: var(--body-color);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: calc(100% - 0.5rem) center;
  background-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.qr-generator__select:focus {
  outline: none;
  border-color: var(--body-color);
  box-shadow: none;
}

/*=============== CHECKBOX ===============*/
.qr-generator__checkbox-group {
  margin-bottom: 1rem;
}

.qr-generator__checkbox-group:last-of-type {
  margin-bottom: 1.5rem;
}

.qr-generator__checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  position: relative;
}

.qr-generator__checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.qr-generator__checkbox-label span {
  font-size: var(--normal-font-size);
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.4s;
  position: relative;
  padding-left: 28px;
}

/* Custom checkbox box */
.qr-generator__checkbox-label span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-color-light);
  border-radius: 0.25rem;
  background-color: transparent;
  transition: all 0.3s;
}

/* Checkbox checked state - box */
.qr-generator__checkbox:checked ~ span::before {
  border-color: var(--first-color);
  background-color: var(--first-color);
}

/* Checkmark */
.qr-generator__checkbox:checked ~ span::after {
  content: '';
  position: absolute;
  left: 8.5px;
  top: 4.5px;
  width: 3.5px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* Hover effect */
.qr-generator__checkbox-label:hover span::before {
  border-color: var(--first-color);
}

/*=============== BUTTONS ===============*/
.qr-generator__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background-color: var(--first-color);
  color: #fff;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
  font-family: var(--body-font);
  transition: all 0.3s;
  box-shadow: 0 4px 8px hsla(207, 24%, 35%, 0.1);
  width: 100%;
}

.qr-generator__button:hover {
  background-color: hsl(207, 65%, 55%);
  box-shadow: 0 6px 12px hsla(207, 24%, 35%, 0.15);
  transform: translateY(-2px);
}

.qr-generator__button:active {
  transform: translateY(-1px);
}

.qr-generator__button i {
  font-size: 1.25rem;
}

.qr-generator__button--secondary {
  background-color: var(--first-color);
}

.qr-generator__button--secondary:hover {
  background-color: hsl(207, 65%, 55%);
}

.qr-generator__button--outline {
  background-color: var(--container-color);
  color: var(--text-color);
  border: 2px solid transparent;
  transition: all 0.3s;
}

.qr-generator__button--outline:hover {
  background-color: hsl(207, 4%, 85%);
  transform: translateY(-2px);
}

/*=============== PREVIEW SECTION ===============*/
.qr-generator__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 350px;
  background-color: var(--body-color);
  border-radius: 0.75rem;
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: background 0.4s;
}

.qr-generator__preview--active {
  background-color: #fff;
}

.qr-generator__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--text-color-light);
  text-align: center;
}

.qr-generator__placeholder i {
  font-size: 4rem;
  color: var(--text-color-light);
}

.qr-generator__placeholder p {
  font-size: var(--normal-font-size);
}

.qr-generator__qr-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#qr-code {
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

#qr-code canvas {
  display: block;
}

.qr-generator__link-text {
  word-break: break-all;
  text-align: center;
  color: var(--title-color);
  font-size: var(--normal-font-size);
  font-weight: var(--font-semi-bold);
  padding: 0.75rem 1rem;
  background-color: transparent;
  border-radius: 0.5rem;
  max-width: 400px;
  line-height: 1.6;
  transition: background 0.4s, color 0.4s;
}

/*=============== ACTION BUTTONS ===============*/
.qr-generator__actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.qr-generator__actions .qr-generator__button:last-child {
  grid-column: 1 / -1;
}

/*=============== INFO SECTION ===============*/
.qr-generator__info {
  grid-column: 1 / -1;
}

.qr-generator__info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.qr-generator__info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.qr-generator__info-item i {
  font-size: 1.5rem;
  color: var(--first-color);
  flex-shrink: 0;
  margin-top: 0;
}

.qr-generator__info-item h4 {
  font-size: var(--normal-font-size);
  color: var(--title-color);
  margin-bottom: 0.25rem;
  font-weight: var(--font-semi-bold);
  transition: color 0.4s;
}

.qr-generator__info-item p {
  font-size: var(--small-font-size);
  color: var(--text-color);
  line-height: 1.6;
  transition: color 0.4s;
}

/*=============== RESPONSIVE ===============*/
/* For small devices */
@media screen and (max-width: 576px) {
  .qr-generator__container {
    padding-top: 2rem;
  }

  .qr-generator__grid {
    gap: 1.5rem;
  }

  .qr-generator__options-grid {
    grid-template-columns: 1fr;
  }

  .qr-generator__info-grid {
    grid-template-columns: 1fr;
  }

  .qr-generator__actions {
    grid-template-columns: 1fr;
  }

  .qr-generator__actions .qr-generator__button:last-child {
    grid-column: 1;
  }

  .qr-generator__content {
    padding: 1.5rem;
  }

  .qr-generator__preview {
    min-height: 280px;
    padding: 1.5rem;
  }

  .qr-generator__placeholder i {
    font-size: 3rem;
  }
}

/* For very small devices */
@media screen and (max-width: 340px) {
  .qr-generator__grid {
    gap: 1.25rem;
  }

  .qr-generator__content {
    padding: 1.25rem;
  }

  .qr-generator__preview {
    min-height: 250px;
    padding: 1.25rem;
  }

  .qr-generator__button {
    padding: 0.75rem 1.25rem;
    font-size: var(--small-font-size);
  }
}

/*=============== DARK THEME ===============*/
body.dark-theme .qr-generator__content {
  box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.3);
}

body.dark-theme #qr-code {
  box-shadow: none;
}

body.dark-theme .qr-generator__button--outline {
  background-color: hsl(207, 4%, 15%);
  color: var(--text-color);
}

body.dark-theme .qr-generator__button--outline:hover {
  background-color: hsl(207, 4%, 20%);
}

body.dark-theme .qr-generator__input {
  border-color: hsl(207, 4%, 15%);
  background-color: hsl(207, 4%, 10%);
}

body.dark-theme .qr-generator__select {
  border-color: hsl(207, 4%, 15%);
  background-color: hsl(207, 4%, 10%);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

body.dark-theme .qr-generator__preview {
  background-color: hsl(207, 4%, 10%);
}

body.dark-theme .qr-generator__preview--active {
  background-color: #fff;
}

body.dark-theme .qr-generator__link-text {
  background-color: transparent;
}
