/* URL Encoder/Decoder Styles */

/* Full-width layout */
.formatter-container {
  padding: 1rem 1.5rem;
  max-width: 100%;
}

.formatter-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  height: calc((100vh - 140px) * 0.45);
  min-height: 200px;
}

/* Panels */
.formatter-panel {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.btn-small {
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  background: white;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-small:hover {
  background: #f1f5f9;
}

.btn-small.btn-copy {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn-small.btn-copy:hover {
  background-color: var(--primary-hover);
}

/* Textarea */
.panel-textarea {
  flex: 1;
  width: 100%;
  padding: 1rem;
  border: none;
  font-size: 0.875rem;
  font-family: 'Courier New', monospace;
  resize: none;
  line-height: 1.6;
  outline: none;
}

.panel-textarea[readonly] {
  background: #fafbfc;
}

/* Center action buttons */
.formatter-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
}

.formatter-actions .btn {
  width: 90px;
  text-align: center;
  font-size: 0.8125rem;
  padding: 0.5rem 0;
}

/* Query String Parser */
.qs-section {
  margin-top: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
}

.qs-empty {
  padding: 2rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

.qs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.qs-table th,
.qs-table td {
  padding: 0.625rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.qs-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
}

.qs-table th:first-child,
.qs-table td:first-child {
  width: 40px;
  text-align: center;
}

.qs-table td:first-child {
  color: #94a3b8;
}

.qs-table .qs-key {
  width: 1%;
}

.qs-table td.qs-key {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: #881391;
  white-space: nowrap;
}

.qs-table .qs-value {
  font-family: 'Courier New', monospace;
  color: #0b7285;
  word-break: break-all;
}

.qs-table tr:last-child th,
.qs-table tr:last-child td {
  border-bottom: none;
}

.qs-base-url {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.8125rem;
  background: #f8fafc;
}

.qs-base-url span {
  font-weight: 600;
  color: var(--text-color);
  margin-right: 0.5rem;
}

.qs-base-url code {
  font-family: 'Courier New', monospace;
  color: #475569;
  word-break: break-all;
}

/* Responsive */
@media (max-width: 768px) {
  .formatter-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .formatter-actions {
    flex-direction: row;
    padding: 0.75rem 0;
  }

  .panel-textarea {
    min-height: 150px;
  }
}
