/* assets/styles.css */

/* =========================
   基本レイアウト / テーマ
   ========================= */

:root {
  --bg: #f3f5fb;
  --bg-soft: #e4ecff;
  --card-bg: #ffffff;
  --card-border: rgba(15, 23, 42, 0.06);
  --text-main: #1f2933;
  --text-sub: #6b7280;
  --accent: #2563eb;
  --accent-soft: #e0edff;
  --accent-strong: #1d4ed8;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.07);
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.08);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: radial-gradient(circle at top left, #e5ecff 0, #f7f7fb 40%, #f9fafb 100%);
  color: var(--text-main);
}

/* =========================
   共通コンテナ / カード
   ========================= */

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  max-width: 1040px;
  width: 100%;
  margin: auto;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), #ffffff);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--card-border);
}

.card-inner {
  padding: 24px 24px 28px;
}

@media (min-width: 768px) {
  .card-inner {
    padding: 28px 32px 32px;
  }
}

/* =========================
   ヘッダー
   ========================= */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.app-logo {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: conic-gradient(
    from 180deg,
    #2563eb,
    #4f46e5,
    #22c55e,
    #0ea5e9,
    #2563eb
  );
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.45);
  position: relative;
}

.app-logo::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 20%, #ffffff, #dbeafe);
}

.app-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-link {
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: var(--accent-strong);
  background: rgba(219, 234, 254, 0.8);
  text-decoration: none;
  font-weight: 600;
  box-shadow: var(--shadow-subtle);
}
.admin-link:hover {
  background: #dbeafe;
}

/* =========================
   バッジ
   ========================= */

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1e3a8a;
  font-size: 0.78rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
}

/* =========================
   アップロードセクション
   ========================= */

.upload-section {
  margin-top: 4px;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 22px;
}

@media (max-width: 768px) {
  .upload-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ドロップゾーン */

.dropzone {
  border-radius: var(--radius-lg);
  border: 1.5px dashed rgba(148, 163, 184, 0.9);
  background: #f8fafc;
  padding: 32px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dropzone:hover {
  border-color: var(--accent);
  background: #eff6ff;
  box-shadow: 0 10px 30px rgba(148, 163, 184, 0.35);
  transform: translateY(-1px);
}

.dropzone.is-dragover {
  border-style: solid;
  border-color: var(--accent-strong);
  background: #e0edff;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0edff;
  color: var(--accent-strong);
  font-size: 1.3rem;
  box-shadow: var(--shadow-subtle);
}

.dropzone-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.dropzone-subtitle {
  font-size: 0.8rem;
  color: var(--text-sub);
}

.dropzone-filename {
  margin-top: 4px;
  font-size: 0.8rem;
  color: #4b5563;
}

.hidden-input {
  display: none;
}

/* 右側フォーム */

.upload-side {
  display: flex;
  flex-direction: column;
}

.upload-form {
  padding: 16px 16px 14px;
  border-radius: var(--radius-lg);
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* フォーム要素 */

.form-group {
  margin-bottom: 12px;
}

.label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 4px;
}

.text-input,
.password-input {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.9);
  font-size: 0.9rem;
  outline: none;
  background: #ffffff;
}

.text-input:focus,
.password-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.static-field {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  font-size: 0.86rem;
  color: var(--text-sub);
  background: #f8fafc;
}

/* =========================
   ボタン
   ========================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  transition: all 0.15s ease-out;
  font-family: inherit;
  white-space: nowrap;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
}

.btn-outline {
  background: #ffffff;
  color: #1e3a8a;
  border: 1px solid rgba(37, 99, 235, 0.4);
}

.btn-outline:hover {
  background: #e0edff;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-small {
  font-size: 0.78rem;
  padding: 6px 10px;
}

/* =========================
   ステータス表示
   ========================= */

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.78rem;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-weight: 600;
}

.status-pill.idle {
  background: #e5e7eb;
  color: #374151;
}

.status-pill.loading {
  background: #facc15;
  color: #78350f;
}

.status-pill.ok {
  background: #bbf7d0;
  color: #166534;
}

.status-pill.error {
  background: #fee2e2;
  color: #b91c1c;
}

/* =========================
   結果表示
   ========================= */

.result-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed rgba(148, 163, 184, 0.7);
}

.result-heading {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.result-grid {
  display: grid;
  gap: 12px;
}

@media (min-width: 768px) {
  .result-grid {
    grid-template-columns: 2.1fr 1.4fr 1.2fr;
  }
}

.result-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.result-label {
  font-size: 0.75rem;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.result-value {
  font-size: 0.86rem;
  word-break: break-all;
}

.result-value.mono {
  font-family: var(--font-mono);
}

/* =========================
   テーブル（管理画面）
   ========================= */

.table-wrapper {
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.4);
  overflow: hidden;
  background: #ffffff;
}

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

.table thead {
  background: #eff6ff;
}

.table th,
.table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
}

.table th {
  text-align: left;
  font-weight: 600;
  color: #4b5563;
}

.table tbody tr:nth-child(odd) {
  background: #ffffff;
}

.table tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* =========================
   管理画面 固有
   ========================= */

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

#admin-login {
  margin-top: 10px;
  padding: 14px 14px 16px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: #f9fafb;
}

#admin-panel {
  margin-top: 14px;
}

.status-pill.ok {
  /* 管理画面で使う「ログイン中」もこのクラス */
}

/* =========================
   汎用
   ========================= */

.mono {
  font-family: var(--font-mono);
}


/* =========================
   アップロード進捗バー
   ========================= */

.progress-wrapper {
  margin-top: 6px;
}

.progress-label {
  font-size: 0.78rem;
  color: #4b5563;
  margin-bottom: 4px;
}

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.15s ease-out;
}
