@charset "utf-8";

* {
  box-sizing: border-box;
}

.epc-actions {
  margin: 0.25rem 0 1rem;
}

.text-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #3498db;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
}

.text-link-btn:hover {
  color: #2980b9;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f9f9f9;
  color: #333;
}

header,
footer {
  text-align: center;
  background: #fff;
  padding: 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0.5rem 0;
}

footer p {
  margin: 0;
  font-size: 0.9rem;
}

nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f0f0f0;
}

.tab-button {
  padding: 0.6rem 1rem;
  border: none;
  background: #ddd;
  cursor: pointer;
  border-radius: 4px;
  font-weight: bold;
}

.tab-button.active {
  background: #3498db;
  color: #fff;
}

main {
  max-width: 1100px;
  margin: 1rem auto;
  background: #ffffff;
  padding: 1rem;
  border-radius: 5px;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem;
  align-items: start;
}

.left-column,
.right-column {
  min-width: 0;
}

.tab-content {
  display: none;
  margin-bottom: 1rem;
}

.tab-content.active {
  display: block;
}

.tab-content label {
  display: block;
  margin: 0.5rem 0 0.2rem;
  font-weight: bold;
  font-size: 13px;
}

.tab-content input,
.tab-content textarea,
.qr-options input,
.qr-options select,
#downloadOptionsForm input,
#downloadOptionsForm select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.tab-content textarea {
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.2rem;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.epc-hint,
.epc-note {
  background: #f7f7f7;
  border-left: 4px solid #3498db;
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.qr-options {
  margin-top: 1rem;
  background: #f7f7f7;
  padding: 1rem;
  border-radius: 5px;
}

.qr-options h2 {
  margin: 1rem 0 0.75rem;
  font-size: 1rem;
}

.option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.option label {
  min-width: 145px;
  font-weight: bold;
  font-size: 13px;
}

#generateBtn,
#openDownloadModalBtn,
#downloadModalBtn {
  padding: 0.7rem 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

#generateBtn {
  background: #3498db;
  color: #fff;
  width: 100%;
}

#generateBtn:hover,
#downloadModalBtn:hover {
  background: #2980b9;
}

#openDownloadModalBtn {
  background: #2ecc71;
  color: #fff;
  width: 100%;
}

#openDownloadModalBtn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
}

.qr-result {
  position: sticky;
  top: 1rem;
  text-align: center;
  background: #f7f7f7;
  border-radius: 5px;
  padding: 1rem;
}

#qrPreview {
  min-height: 232px;
  margin-bottom: 1rem;
  background: #fff;
  border: 1px solid #ccc;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qrPreview img {
  max-width: 100%;
  height: auto;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: #fff;
  max-width: 520px;
  width: 90%;
  padding: 1rem 1.5rem;
  border-radius: 5px;
  position: relative;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  font-weight: bold;
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  cursor: pointer;
}

.qr-modal-preview {
  text-align: center;
  margin: 1rem 0;
}

.qr-modal-preview img {
  max-width: 100%;
  border: 1px solid #ccc;
  background: #fff;
}

#downloadOptionsForm .form-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

#downloadOptionsForm label {
  flex: 0 0 180px;
  font-weight: bold;
  font-size: 13px;
}

#downloadModalBtn {
  background: #3498db;
  color: #fff;
  width: 100%;
  margin-top: 0.5rem;
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .qr-result {
    position: static;
  }
}

@media (max-width: 640px) {
  .form-row,
  #downloadOptionsForm .form-row,
  .option {
    flex-direction: column;
    align-items: stretch;
  }

  #downloadOptionsForm label,
  .option label {
    min-width: 0;
    flex-basis: auto;
  }
}
.input-error {
  border: 2px solid #e74c3c !important;
  background: #fff6f6;
}

.error-message {
  color: #e74c3c;
  font-size: 12px;
  margin-top: 4px;
}