*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: #e0e0e0;
  background: #1a1a1e;
  min-height: 100vh;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 700px) {
  .columns {
    grid-template-columns: 1fr;
  }
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 2rem;
}

.col-right {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: #77B1E4;
}

.header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: #f0f0f0;
}

.subtext {
  margin: 0;
  font-size: 0.95rem;
  color: #9ca3af;
}

.tips {
  padding: 0 0 1rem;
  margin-bottom: 0;
  color: #b4b4bb;
}

.tips-main {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #e0e0e0;
}

.tips-sub {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

.tips strong {
  color: #e0e0e0;
}

.drop-zone {
  border: 1px solid #ffffff;
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  background: #77B1E4;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.drop-zone-prompt {
  margin: 0;
  font-weight: 700;
  color: #000;
  font-size: 0.95rem;
}

.drop-zone:hover,
.drop-zone.drag-over {
  background: #ffffff;
}

.file-list-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-list-section[hidden] {
  display: none !important;
}

.file-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.file-list-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #77B1E4;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-clear {
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: #3f3f46;
  color: #9ca3af;
  border: 1px solid #52525b;
  border-radius: 6px;
  cursor: not-allowed;
  transition: background 0.2s, color 0.2s, border-color 0.2s, cursor 0.2s;
}

.btn-clear.has-files {
  background: #991b1b;
  color: #fecaca;
  border-color: #b91c1c;
  cursor: pointer;
}

.btn-clear.has-files:hover {
  background: #b91c1c;
  color: #fff;
  border-color: #dc2626;
}

.file-list {
  margin-top: 0;
  min-height: 2rem;
  max-height: 50vh;
  overflow-y: auto;
}

.file-list:empty {
  display: none;
}

.file-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #25252a;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  padding: 0.5rem 0;
}

.file-list li {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  color: #d4d4d8;
  border-bottom: 1px solid #3f3f46;
}

.file-list li:last-child {
  border-bottom: none;
}

/* Output option toggles */
.options-section {
  margin-bottom: 0.5rem;
}

.options-label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.label-blue {
  color: #77B1E4;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.toggle-label {
  font-size: 0.95rem;
  color: #d4d4d8;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: #3f3f46;
  border-radius: 24px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #9ca3af;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-input:checked + .toggle-slider {
  background: #77B1E4;
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff;
}

.toggle-input:focus-visible + .toggle-slider {
  box-shadow: 0 0 0 2px rgba(119, 177, 228, 0.5);
}

.form-row {
  margin-top: 0;
}

.form-row label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #d4d4d8;
  margin-bottom: 0.35rem;
}

.form-row label.label-blue {
  color: #77B1E4;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-row input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  border: 1px solid #3f3f46;
  border-radius: 6px;
  background: #25252a;
  color: #e0e0e0;
}

.form-row input::placeholder {
  color: #6b7280;
}

.form-row input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  margin-top: 0;
  width: 100%;
  background: #77B1E4;
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  background: #5a9bd4;
}

.action-row {
  position: relative;
}

.action-row .btn-primary,
.action-row .btn-download-replace {
  width: 100%;
  margin-top: 0;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-primary.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-download-replace {
  padding: 0.65rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: #112664;
  color: #fff;
  transition: background 0.2s;
}

.btn-download-replace:hover {
  background: #1a3280;
}

.btn-download {
  margin-top: 0.5rem;
  background: #059669;
  color: #fff;
}

.btn-download:hover {
  background: #047857;
}

.feedback {
  margin-top: 0;
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.feedback.processing {
  background: #1e3a5f;
  border: 1px solid #3b82f6;
  color: #93c5fd;
}

.feedback.done {
  background: #052e16;
  border: 1px solid #059669;
  color: #6ee7b7;
}

.feedback.error {
  background: #450a0a;
  border: 1px solid #dc2626;
  color: #fca5a5;
}

.download-area {
  margin-top: 0;
  padding: 1.25rem;
  background: #4a4d52;
  border: 1px solid #5a5e63;
  border-radius: 8px;
  text-align: center;
}

.download-area .btn-download {
  margin-top: 0;
}

/* Footer */
.app-footer {
  max-width: 960px;
  margin: 2rem auto 0;
  padding: 1.5rem 1.5rem 2rem;
  border-top: 1px solid #3f3f46;
  font-size: 0.875rem;
  color: #9ca3af;
}

.footer-details-intro {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: #d4d4d8;
}

.footer-details-list {
  margin: 0;
  padding-left: 0;
  line-height: 1.7;
  text-align: center;
}

.footer-details-list a {
  color: #77B1E4;
  text-decoration: none;
}

.footer-details-list a:hover {
  text-decoration: underline;
}
