* { box-sizing: border-box; }

/* ══════════════════
   LAYOUT
══════════════════ */
#main-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.url-right-col { display: flex; flex-direction: column; gap: 16px; }
.url-examples-outer { display: none; }
.url-examples-inner { display: block; }

.url-input-section,
.url-output-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(99,102,241,0.07);
  display: flex;
  flex-direction: column;
}

/* ══════════════════
   SECTION TITLE
══════════════════ */
label.url-section-title,
.url-section-title {
  font-size: 1.05rem; font-weight: 700; color: #1e293b;
  margin: 0 0 14px 0; display: flex; align-items: center;
  gap: 8px; cursor: default;
}
label.url-section-title svg,
.url-section-title svg { stroke: #6366f1; flex-shrink: 0; }

/* ══════════════════
   MODE TOGGLE
══════════════════ */
.url-mode-toggle {
  display: flex; background: #f1f5f9;
  border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 14px;
}
.url-mode-btn {
  flex: 1; padding: 8px 10px; border: none; border-radius: 7px;
  font-size: 0.82rem; font-weight: 700; cursor: pointer;
  background: transparent; color: #64748b; transition: all 0.18s;
}
.url-mode-btn.active {
  background: #ffffff; color: #4338ca;
  box-shadow: 0 1px 4px rgba(99,102,241,0.15);
}

/* ══════════════════
   TEXTAREA
══════════════════ */
.url-input-wrap { position: relative; margin-bottom: 14px; }
.url-textarea {
  width: 100%; resize: none; padding: 12px 14px;
  border: 1.5px solid #e2e8f0; border-radius: 10px;
  font-size: 0.92rem; outline: none;
  font-family: 'Courier New', monospace;
  color: #1e293b; background: #ffffff;
  line-height: 1.7; transition: border-color 0.18s; min-height: 130px;
}
.url-textarea:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}
.url-clear-btn {
  position: absolute; top: 10px; right: 10px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 7px; padding: 4px 12px;
  font-size: 0.78rem; font-weight: 600; color: #64748b;
  cursor: pointer; transition: background 0.15s;
}
.url-clear-btn:hover { background: #e2e8f0; color: #ef4444; }

/* ══════════════════
   FIELD GROUP
══════════════════ */
.url-field-group { margin-bottom: 14px; }
.url-label {
  display: block; font-size: 0.78rem; font-weight: 700;
  color: #64748b; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 8px;
}

/* Radio */
.url-mode-options { display: flex; flex-direction: column; gap: 10px; }
.url-radio-label {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.87rem; font-weight: 500; color: #475569;
  cursor: pointer; user-select: none; line-height: 1.4;
}
.url-radio-label input[type="radio"] { display: none; }
.url-radio-mark {
  width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px;
  border: 2px solid #c7d2fe; border-radius: 50%;
  background: #f8f9ff;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.url-radio-label input:checked + .url-radio-mark {
  border-color: #6366f1; background: #6366f1;
}
.url-radio-label input:checked + .url-radio-mark::after {
  content: ''; width: 6px; height: 6px;
  background: #fff; border-radius: 50%; display: block;
}
.url-radio-label strong { display: block; font-size: 0.87rem; color: #1e293b; }
.url-radio-label small { font-size: 0.77rem; color: #94a3b8; font-weight: 400; }

/* ══════════════════
   CONVERT BTN
══════════════════ */
.url-convert-btn {
  width: 100%; background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border: none; border-radius: 11px; padding: 13px;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; transition: opacity 0.18s, transform 0.15s; margin-top: auto;
}
.url-convert-btn:hover { opacity: 0.88; transform: scale(1.02); }
.url-convert-btn:active { transform: scale(0.98); }

/* ══════════════════
   OUTPUT
══════════════════ */
.url-output-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.url-copy-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff; border: none; border-radius: 8px;
  padding: 7px 18px; font-size: 0.84rem; font-weight: 700;
  cursor: pointer; transition: opacity 0.18s;
}
.url-copy-btn:hover { opacity: 0.85; }
.url-copy-btn.copied { background: linear-gradient(135deg, #22c55e, #16a34a); }

.url-result-wrap { margin-bottom: 14px; }
.url-result-placeholder {
  background: linear-gradient(135deg, #f8f9ff, #ede9fe22);
  border: 2px dashed #c7d2fe; border-radius: 12px;
  padding: 32px 20px; text-align: center;
  color: #cbd5e1; font-size: 0.92rem; font-weight: 500;
}
.url-output-textarea {
  width: 100%; min-height: 140px; resize: none;
  padding: 12px 14px; border: 1.5px solid #e2e8f0;
  border-radius: 10px; font-size: 0.88rem;
  font-family: 'Courier New', monospace; color: #1e293b;
  background: #f8faff; outline: none; line-height: 1.8;
  font-weight: 600; word-break: break-all;
}

/* Error */
.url-error {
  background: #fef2f2; border: 1.5px solid #fecaca;
  border-radius: 10px; padding: 10px 14px;
  font-size: 0.84rem; font-weight: 600; color: #dc2626;
  margin-bottom: 14px;
}

/* ── Diff View ── */
.url-diff-wrap { margin-bottom: 14px; }
.url-diff-label {
  font-size: 0.78rem; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px;
}
.url-diff-box {
  background: #f8f9ff; border: 1.5px solid #e2e8f0;
  border-radius: 10px; padding: 12px 14px;
  font-family: 'Courier New', monospace; font-size: 0.85rem;
  line-height: 1.9; word-break: break-all; max-height: 160px;
  overflow-y: auto; color: #1e293b;
}
.url-diff-box .enc { color: #6366f1; font-weight: 700; }
.url-diff-box .plain { color: #64748b; }

/* Stats */
.url-stats-row { display: flex; gap: 7px; flex-wrap: wrap; }
.url-stat-chip {
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 20px; padding: 5px 13px;
  font-size: 0.76rem; font-weight: 600; color: #475569;
}

/* ══════════════════
   EXAMPLES
══════════════════ */
.url-examples-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.url-example-btn {
  background: #f8f9ff; border: 1.5px solid #e2e8f0;
  border-radius: 20px; padding: 6px 16px;
  font-size: 0.82rem; font-weight: 600; color: #4338ca;
  cursor: pointer; transition: all 0.15s;
}
.url-example-btn:hover {
  background: #ede9fe; border-color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(99,102,241,0.12);
}

/* ══════════════════
   DARK MODE
══════════════════ */
body.dark-mode .url-input-section,
body.dark-mode .url-output-section { background: #0f172a; border-color: #1e293b; }
body.dark-mode label.url-section-title,
body.dark-mode .url-section-title { color: #e2e8f0; }
body.dark-mode label.url-section-title svg,
body.dark-mode .url-section-title svg { stroke: #a5b4fc; }
body.dark-mode .url-mode-toggle { background: #1e293b; }
body.dark-mode .url-mode-btn { color: #475569; }
body.dark-mode .url-mode-btn.active { background: #1e1b4b; color: #a5b4fc; }
body.dark-mode .url-textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .url-textarea:focus { border-color: #818cf8; }
body.dark-mode .url-clear-btn { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-mode .url-label { color: #475569; }
body.dark-mode .url-radio-label { color: #94a3b8; }
body.dark-mode .url-radio-label strong { color: #e2e8f0; }
body.dark-mode .url-radio-mark { background: #1e1b4b; border-color: #312e81; }
body.dark-mode .url-result-placeholder { background: #1e1b4b; border-color: #312e81; color: #475569; }
body.dark-mode .url-output-textarea { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .url-error { background: #2d1515; border-color: #7f1d1d; color: #fca5a5; }
body.dark-mode .url-diff-box { background: #1e293b; border-color: #334155; color: #e2e8f0; }
body.dark-mode .url-diff-box .enc { color: #a5b4fc; }
body.dark-mode .url-diff-box .plain { color: #64748b; }
body.dark-mode .url-stat-chip { background: #1e293b; border-color: #334155; color: #94a3b8; }
body.dark-mode .url-example-btn { background: #1e1b4b; border-color: #312e81; color: #a5b4fc; }
body.dark-mode .url-example-btn:hover { background: #2e1b6b; border-color: #6366f1; }

/* ══════════════════
   RESPONSIVE
══════════════════ */
@media (max-width: 768px) {
  #main-section { grid-template-columns: 1fr; }
  .url-examples-inner { display: none !important; }
  .url-examples-outer { display: block; }
}