/*
  ファイル名: public/css/style.css
  フォルダ: public/css
  内容: アプリ全体のデザイン。スマホ・PC対応のレスポンシブCSS。
*/

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #14213d;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Yu Gothic",
    Meiryo,
    sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 34rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-auth {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(100%, 460px);
}

.auth-card,
.panel,
.kanban-column {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
}

.auth-card {
  padding: 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: white;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border-radius: 18px;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.3);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 5vw, 42px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.lead {
  color: var(--muted);
  line-height: 1.8;
}

.form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  color: var(--text);
  background: #fff;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.7);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.25);
}

.primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), #6d28d9);
}

.secondary {
  color: #fff;
  background: #0f172a;
}

.ghost {
  color: #1e293b;
  background: #eef2ff;
}

.danger {
  color: #fff;
  background: var(--danger);
}

.danger:hover {
  background: var(--danger-dark);
}

.message {
  min-height: 1.4em;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.message.success {
  color: var(--success);
}

.hint-box {
  margin-top: 22px;
  padding: 16px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  line-height: 1.7;
}

.hint-box p {
  margin-bottom: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 44px);
  background: rgba(248, 250, 252, 0.82);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  backdrop-filter: blur(18px);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.container {
  width: min(1480px, calc(100% - 32px));
  margin: 28px auto 60px;
}

.toolbar,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.toolbar p,
.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.kanban.compact {
  align-items: start;
}

.kanban-column {
  min-height: 420px;
  padding: 18px;
}

.kanban-column.muted {
  background: rgba(248, 250, 252, 0.86);
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  color: var(--primary);
  background: #dbeafe;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.task-card.inactive {
  opacity: 0.72;
}

.task-title {
  margin-bottom: 0;
  font-size: 17px;
  font-weight: 900;
  line-height: 1.5;
}

.task-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-pill {
  width: fit-content;
  padding: 5px 10px;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.status-active {
  background: var(--success);
}

.status-inactive {
  background: #64748b;
}

.task-note {
  margin: 0;
  color: #475569;
  line-height: 1.7;
  white-space: pre-wrap;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-actions .button {
  min-height: 36px;
  padding: 8px 13px;
  font-size: 13px;
}

.empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: rgba(241, 245, 249, 0.8);
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.form-panel .form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-panel .field:nth-of-type(3) {
  grid-column: 1 / -1;
}

.form-panel .primary,
.form-panel .message {
  grid-column: 1 / -1;
}

.form-panel .message {
  margin-bottom: 0;
}

.panel {
  padding: 22px;
}

.panel.wide {
  min-width: 0;
}

@media (max-width: 900px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    justify-content: flex-start;
  }

  .admin-grid,
  .kanban {
    grid-template-columns: 1fr;
  }

  .kanban-column {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .auth-card,
  .panel,
  .kanban-column {
    border-radius: 18px;
  }

  .auth-card {
    padding: 24px;
  }

  .toolbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .header-actions,
  .task-actions {
    width: 100%;
  }

  .task-actions .button {
    width: auto;
    flex: 1;
  }
}

/* 追加: 5ステータス看板・サブタスク・管理画面フォーム対応 */
.form-context {
  margin: 6px 0 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.five-columns {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow-x: visible;
  padding-bottom: 0;
}

.five-columns .kanban-column {
  min-width: 0;
}

.task-card[data-card-action="create-subtask"] {
  cursor: pointer;
}

.task-card[data-card-action="create-subtask"]:hover {
  border-color: rgba(37, 99, 235, 0.5);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.13);
}

.task-card.selected {
  border-color: rgba(37, 99, 235, 0.85);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 16px 34px rgba(15, 23, 42, 0.08);
}

.task-assignee,
.task-due-date {
  color: #334155;
  font-size: 15px;
  font-weight: 900;
}

.status-working {
  background: var(--warning);
}

.status-review {
  background: #7c3aed;
}

.status-complete {
  background: #0f766e;
}

.task-url {
  margin: 0;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  word-break: break-all;
}

.task-url a:hover {
  text-decoration: underline;
}

.subtask-summary {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.subtask-summary-title {
  margin-bottom: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.subtask-summary ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.subtask-summary li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #475569;
  font-size: 13px;
  line-height: 1.5;
}

.subtask-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtask-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.subtask-panel {
  grid-column: 1 / -1;
}

.task-card,
.task-card * {
  min-width: 0;
}

.task-title,
.task-meta,
.task-note,
.task-url,
.subtask-summary {
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  .five-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .form-panel .form,
  .five-columns {
    grid-template-columns: 1fr;
  }

  .form-panel .field:nth-of-type(3),
  .form-panel .primary,
  .form-panel .message {
    grid-column: auto;
  }

  .task-card {
    width: 100%;
  }
}

/* 追加: 期日を日付・時・分の3項目に分け、分は5分単位の選択肢に固定 */
.datetime-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 120px;
  gap: 10px;
}

@media (max-width: 560px) {
  .datetime-fields {
    grid-template-columns: 1fr;
  }
}
