/* ===== 기본 리셋 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
}

/* ===== 헤더 ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: #1a1a2e;
  color: #fff;
}

header h1 a {
  color: #fff;
  text-decoration: none;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header nav a {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}

header nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

#lang-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

#lang-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

/* ===== 갤러리 그리드 ===== */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

/* ===== 상태 박스 (로딩 / 에러 / 빈 상태) ===== */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 4rem 2rem;
  color: #555;
  text-align: center;
}

.state-icon { font-size: 2.5rem; }

.state-box button,
.state-box a {
  margin-top: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
}

/* 로딩 스피너 */
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #ddd;
  border-top-color: #1a1a2e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== 데모 카드 ===== */
.card {
  background: #fff;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-name {
  font-size: 1rem;
  font-weight: 600;
  word-break: break-word;
}

.card-desc {
  font-size: 0.875rem;
  color: #555;
  flex: 1;
  word-break: break-word;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.card-date {
  font-size: 0.75rem;
  color: #999;
}

.card-visit-btn {
  padding: 0.35rem 0.9rem;
  background: #1a1a2e;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.8rem;
  white-space: nowrap;
}

.card-visit-btn:hover { background: #2e2e5e; }

.card .badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* 배지 오른쪽에 화살표 (CSS로 렌더링) */
.card .badge::after          { content: ' ▾'; font-size: 0.65rem; }
.card .badge[data-open="true"]::after { content: ' ▴'; font-size: 0.65rem; }

.badge.safe    { background: #d4edda; color: #155724; }
.badge.unsafe  { background: #f8d7da; color: #721c24; }
.badge.pending { background: #fff3cd; color: #856404; }

/* ===== 3종 검사 상세 패널 ===== */
.scan-detail {
  display: none; /* 기본 숨김 */
  flex-direction: column;
  gap: 0.4rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
}

.scan-detail.open {
  display: flex; /* 클릭 시 표시 */
}

.scan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scan-label {
  font-size: 0.78rem;
  color: #555;
}

/* 검사 결과 아이콘 (✓ / ✗ / ⏳) */
.scan-icon {
  font-size: 0.85rem;
  font-weight: bold;
  min-width: 1.2rem;
  text-align: center;
}
.scan-icon.safe    { color: #155724; }
.scan-icon.unsafe  { color: #721c24; }
.scan-icon.pending { color: #856404; }

/* ===== 폼 ===== */
form {
  max-width: 560px;
  margin: 2rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

button[type="submit"] {
  padding: 0.75rem;
  background: #1a1a2e;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

button[type="submit"]:hover {
  background: #2e2e5e;
}

button[type="submit"]:disabled {
  background: #999;
  cursor: not-allowed;
}

/* ===== 폼 제출 결과 메시지 ===== */
.result-box {
  max-width: 560px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.95rem;
  text-align: center;
}

.result-box.success { background: #d4edda; color: #155724; }
.result-box.error   { background: #f8d7da; color: #721c24; }
