/* =============================================
   URL CHECKER — Industrial Monospace Theme
   ============================================= */

:root {
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1c1c1c;
  --border: #2a2a2a;
  --border-lit: #3d3d3d;
  --text: #e8e8e8;
  --text-dim: #888;
  --text-dimmer: #555;
  --accent: #d4f53c;        /* neon lime */
  --accent-dim: #a8c230;
  --ok: #4ade80;
  --ok-bg: rgba(74,222,128,0.08);
  --redirect: #60a5fa;
  --redirect-bg: rgba(96,165,250,0.08);
  --err: #f87171;
  --err-bg: rgba(248,113,113,0.08);
  --timeout: #fbbf24;
  --timeout-bg: rgba(251,191,36,0.08);
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
  --font-sans: 'IBM Plex Sans KR', sans-serif;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── HEADER ───────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 20px 0 18px;
  background: var(--bg2);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.logo {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.logo-bracket { color: var(--text-dimmer); }
.logo-accent  { color: var(--accent); }

.header-sub {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

/* ── AD ZONES ─────────────────────────────── */
.ad-zone {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0;
  position: relative;
}

.ad-top, .ad-bottom {
  min-height: 58px;
}

.ad-mid {
  margin: 24px 0 0;
  border-radius: var(--radius);
  border: 1px dashed var(--border-lit);
  min-height: 48px;
}

.ad-label {
  position: absolute;
  left: 8px;
  top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dimmer);
  letter-spacing: 0.1em;
}

.ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ad-mock {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
  border: 1px dashed #2a2a2a;
  padding: 6px 24px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

/* ── MAIN LAYOUT ──────────────────────────── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 36px 24px 60px;
  flex: 1;
  width: 100%;
}

/* ── LABELS ───────────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.step-num {
  background: var(--accent);
  color: #0d0d0d;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}

.label-hint {
  color: var(--text-dimmer);
  font-weight: 400;
}

/* ── TEXTAREA ─────────────────────────────── */
.input-section { margin-bottom: 20px; }

textarea {
  width: 100%;
  height: 200px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  padding: 16px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  caret-color: var(--accent);
}

textarea::placeholder { color: var(--text-dimmer); }

textarea:focus {
  border-color: var(--border-lit);
  background: #161616;
}

/* ── INPUT META ───────────────────────────── */
.input-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.url-count-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.url-count-badge.has-urls {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ── BUTTONS ──────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #0d0d0d;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 12px 32px;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover:not(:disabled) { background: #c5e634; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-icon { font-size: 16px; transition: transform 0.15s; }
.btn-primary:hover:not(:disabled) .btn-icon { transform: translateX(3px); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, color 0.15s;
}

.btn-ghost:hover { border-color: var(--border-lit); color: var(--text); }

.btn-export { font-size: 11px; padding: 4px 10px; }

/* ── ACTION SECTION ───────────────────────── */
.action-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 8px;
}

/* ── SPINNER ──────────────────────────────── */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-lit);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

.progress-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── RESULT SECTION ───────────────────────── */
.result-section { margin-top: 36px; }

.result-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.result-header .section-label { margin-bottom: 0; }

.result-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── TABLE ────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dimmer);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.col-num   { width: 44px; }
.col-status{ width: 110px; }
.col-code  { width: 68px; }
.col-url   { word-break: break-all; }

.td-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
  text-align: right;
}

.td-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.td-url {
  font-family: var(--font-mono);
  font-size: 12px;
}

.td-url a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s;
}

.td-url a:hover { color: var(--accent); text-decoration: underline; }

/* ── STATUS CELLS ─────────────────────────── */
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 3px;
}

.status-ok       { color: var(--ok);      background: var(--ok-bg); }
.status-redirect { color: var(--redirect); background: var(--redirect-bg); }
.status-error    { color: var(--err);     background: var(--err-bg); }
.status-timeout  { color: var(--timeout); background: var(--timeout-bg); }
.status-invalid  { color: var(--text-dim); background: var(--bg3); }

/* ── FOOTER ───────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
  letter-spacing: 0.04em;
  background: var(--bg2);
}

/* ── UTILITIES ────────────────────────────── */
.hidden { display: none !important; }

/* ── RESPONSIVE ───────────────────────────── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; gap: 4px; }
  .result-header { flex-direction: column; align-items: flex-start; }
  .result-summary { margin-left: 0; }
  .col-code { display: none; }
  th.col-code { display: none; }
}

/* ── 30개 초과 알림 ─────────────────────────── */
.truncate-notice {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--timeout);
  text-align: center;
  padding: 12px;
  background: var(--timeout-bg);
}

.url-count-badge.over-limit {
  color: var(--timeout);
  border-color: var(--timeout);
}

/* ── 중복 뱃지 ───────────────────────────────── */
.dup-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── FILE DROP ZONE ────────────────────────── */
.drop-zone {
  position: relative;
  background: var(--bg3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
  transition: border-color 0.15s, background-color 0.15s;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(212, 245, 60, 0.03);
}

.file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

.drop-icon {
  font-size: 20px;
  transition: transform 0.15s;
}

.drop-zone:hover .drop-icon, .drop-zone.dragover .drop-icon {
  transform: translateY(-2px);
}

.drop-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.drop-zone.loading {
  pointer-events: none;
  border-color: var(--timeout);
}

.drop-zone.loading .drop-icon {
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ── LANGUAGE SWITCHER ────────────────────── */
.lang-switcher {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: #0d0d0d;
  background: var(--accent);
}

/* ── LOGO ROW ──────────────────────────────── */
.logo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* ── FAQ & INFO SECTION ────────────────────── */
.info-section {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

.info-card, .faq-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.info-card h3, .faq-card h3 {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

.info-intro {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.info-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-bullets li {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  position: relative;
  padding-left: 12px;
}

.info-bullets li::before {
  content: "•";
  color: var(--accent);
  position: absolute;
  left: 0;
  top: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg3);
}

.faq-question {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: background 0.15s;
}

.faq-question:hover {
  background: rgba(255, 255, 255, 0.02);
}

.faq-arrow {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dimmer);
  transition: transform 0.2s;
}

.faq-answer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ── FOOTER LINKS ───────────────────────────── */
.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.footer-link-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s;
}

.footer-link-btn:hover {
  color: var(--text);
  text-decoration: underline;
}

.footer-sep {
  color: var(--text-dimmer);
  font-size: 10px;
}

.site-footer-copyright {
  margin-top: 4px;
}

/* ── MODAL DIALOG (Glassmorphism) ───────────── */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 13, 13, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  background: #141414;
  border: 1px solid var(--border-lit);
  border-radius: 6px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s;
}

.modal-close-btn:hover {
  color: var(--text);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.modal-body h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  margin: 16px 0 6px;
}

.modal-body h4:first-of-type {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 12px;
}

.modal-body a {
  color: var(--accent);
  text-decoration: none;
}

.modal-body a:hover {
  text-decoration: underline;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ── 3-COLUMN APP LAYOUT ───────────────────────── */
.app-layout {
  display: flex;
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  flex: 1;
}

/* 중앙 메인 콘텐츠 컨테이너 */
.app-layout .container {
  flex: 1;
  max-width: 860px;
  min-width: 0;
  padding: 36px 24px 60px;
  margin: 0 auto;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* 사이드바 광고 영역 */
.sidebar-ad {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg2);
  padding: 40px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
}

.sidebar-left {
  border-right: none;
}

.sidebar-right {
  border-left: none;
}

.ad-placeholder-sidebar {
  width: 100%;
  height: 250px;
  background: var(--bg3);
  border: 1px dashed var(--border-lit);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ad-mock-sidebar {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
  text-align: center;
  line-height: 1.5;
}

.ad-support-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmer);
  text-align: center;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: 12px;
  width: 100%;
}

/* 하단 스티키 고정 광고 (모바일/태블릿용) */
.ad-bottom-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  min-height: 50px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 4px 0;
}

/* 데스크톱 모드: 하단 스티키 광고 숨김, 사이드바 노출 */
@media (min-width: 1200px) {
  .ad-bottom-sticky {
    display: none !important;
  }
}

/* 태블릿 및 모바일 모드: 사이드바 광고 숨김, 하단 스티키 광고 노출 */
@media (max-width: 1199px) {
  .sidebar-ad {
    display: none !important;
  }
  .app-layout .container {
    border-left: none;
    border-right: none;
    padding-bottom: 100px; /* 하단 스티키 겹침 방지 여백 */
  }
}

/* ── DOI ALTERNATIVE SEARCH UI ─────────────────── */
.btn-alt-search {
  display: block;
  margin-top: 6px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
}

.btn-alt-search:hover:not(:disabled) {
  background: var(--accent);
  color: #0d0d0d;
}

.btn-alt-search:disabled {
  border-color: var(--border-lit);
  color: var(--text-dimmer);
  cursor: not-allowed;
}

.alt-link-result {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(212, 245, 60, 0.04);
  border: 1px solid rgba(212, 245, 60, 0.15);
  border-radius: var(--radius);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.alt-link-result.no-alt {
  background: rgba(248, 113, 113, 0.04);
  border-color: rgba(248, 113, 113, 0.15);
  color: var(--err);
}

.alt-label {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
}

.alt-link-a {
  color: var(--accent) !important;
  word-break: break-all;
  text-decoration: underline;
}

.alt-link-a:hover {
  color: #fff !important;
}

.oa-badge {
  display: inline-block;
  background: rgba(74, 222, 128, 0.15);
  color: var(--ok);
  padding: 1px 6px;
  border-radius: 2px;
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  width: fit-content;
}
