:root {
  --bg: #f5f7fa;
  --fg: #ffffff;
  --text: #111;
  --border: #ccc;
  --primary: #0078d4;
  --primary-hover: #005fa3;
  --stat-text-color: #333;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #1f1f1f;
    --text: #eee;
    --border: #444;
    --primary: #3896ff;
    --primary-hover: #2b7cd4;
    --stat-text-color: #ddd;
  }
}

#docCount {
  color: var(--stat-text-color);
}

body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 2rem;
}

img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100vw;
  margin: 0 auto;
}

.box {
  background: var(--fg);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 450px;
  text-align: center;
}

h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.file-label {
  display: block;
  border: 2px dashed var(--border);
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 1rem;
  background: var(--fg);
  transition: background 0.2s ease;
}

.file-label:hover {
  background: rgba(0, 0, 0, 0.05);
}

#filename {
  font-weight: bold;
}

input[type="file"] {
  display: none;
}

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.8rem 1.2rem;
  margin: 0.4rem 0.3rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

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

.danger {
  background: #d93a3a;
}

.danger:hover {
  background: #b92f2f;
}

#qrcode {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

#info {
  margin-top: 1rem;
  font-size: 1rem;
}

#error {
  color: red;
  margin-top: 1rem;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 0.9rem;
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 0.7rem 0;
  opacity: 0.7; /* 기본값은 다크 모드 기준 */
  color: var(--text); /* 텍스트 색상 변수 사용 권장 */
}

/* 라이트 모드에선 opacity를 높이기 */
@media (prefers-color-scheme: light) {
  .footer {
    opacity: 1;
  }
}


#uploadProgress {
  width: 100%;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: 9px;
  background-color: #e0e0e0;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
  margin-top: 10px;
}

.access-block {
  background-color: #fef3f2;
  border: 2px solid #f87171;
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-top: 20px;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.2);
  animation: fadeIn 0.5s ease-in-out;
}

.access-block h3 {
  color: #dc2626;
  margin-bottom: 10px;
}

.access-block p {
  font-size: 16px;
  color: #b91c1c;
  /* 선명한 붉은 톤 */
  font-weight: 600;
  line-height: 1.6;
}

.network-warning {
  margin-top: 10px;
  background-color: #fee2e2;
  padding: 10px;
  border-radius: 6px;
  color: #dc2626;
  font-size: 15px;
  font-weight: bold;
  border-left: 4px solid #f87171;
}

.suggestion {
  margin-top: 15px;
  font-size: 14px;
  color: #374151;
}

.highlight {
  color: #ef4444;
  font-weight: bold;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#uploadForm {
  display: none;
}

.access-block {
  background-color: #fef3f2;
  border: 2px solid #f87171;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-top: 20px;
  box-shadow: 0 0 5px rgba(220, 38, 38, 0.2);
}

.access-block h3 {
  color: #dc2626;
  font-size: 20px;
  margin-bottom: 10px;
}

.access-block p {
  font-size: 16px;
  color: #b91c1c;
  font-weight: 600;
  line-height: 1.6;
}

.network-warning {
  margin-top: 10px;
  background-color: #fee2e2;
  padding: 10px;
  border-radius: 6px;
  color: #dc2626;
  font-size: 15px;
  font-weight: bold;
  border-left: 4px solid #f87171;
}

.suggestion {
  margin-top: 15px;
  font-size: 14px;
  color: #374151;
}

/* 🎨 드롭 영역 스타일 */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 0.8rem 2rem; /* ✅ 이전보다 여유 줄임 */
  background: var(--fg);
  color: var(--text);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  line-height: 1.4;
}


.drop-zone:hover {
  background: rgba(0, 0, 0, 0.1); /* 기본 라이트 모드용 */
}

@media (prefers-color-scheme: dark) {
  .drop-zone:hover {
    background: rgba(255, 255, 255, 0.2); /* 다크 모드용 살짝 밝은 회색 */
  }
}


.drop-zone.dragover {
  background: #e6f1fc;
  border-color: var(--primary);
  color: #005fa3;
}


.doc-count {
  margin-top: 10px;
  font-size: 14px;
  color: #555;
}

body.dark-mode .doc-count {
  color: #ccc;
}