/* ============================================
   amamriBoard - 게시판 스타일시트
   ============================================ */

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

:root {
  --primary:    #2563eb;
  --primary-dk: #1d4ed8;
  --danger:     #dc2626;
  --success:    #16a34a;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-400:   #9ca3af;
  --gray-600:   #4b5563;
  --gray-800:   #1f2937;
  --white:      #ffffff;
  --radius:     8px;
  --shadow-lg:  0 10px 25px rgba(0,0,0,.15);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, '맑은 고딕', sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

/* ── Alert ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 16px; font-size: .875rem;
}
.alert-success { background: #dcfce7; color: #166534; border-left: 4px solid var(--success); }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info    { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--primary); }

/* ── Board Container ── */
.board-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}

.board-box {
  background: var(--white);
  border-radius: 16px;
  padding: 32px 40px;
  width: 100%;
  max-width: 900px;
  box-shadow: var(--shadow-lg);
}

/* ── Board Header ── */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  position: relative;
}

.board-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gray-800);
}

/* ── Board Table ── */
.board-table {
  width: 100%;
  border-collapse: collapse;
}

.board-table th {
  background: var(--gray-100);
  padding: 12px 16px;
  text-align: left;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
}

.board-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: .9rem;
  color: var(--gray-800);
}

.board-table tr:hover td {
  background: var(--gray-50);
}

.board-table td.subject a {
  color: var(--gray-800);
  text-decoration: none;
  font-weight: 500;
}

.board-table td.subject a:hover {
  color: var(--primary);
}

/* ── Board Form ── */
.board-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Form Group ── */
.form-group { margin-bottom: 4px; }

.form-group label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
  background: var(--white);
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-group.has-error input,
.form-group.has-error textarea {
  border-color: var(--danger);
}

.form-group textarea {
  resize: vertical;
  min-height: 300px;
  line-height: 1.6;
}

.field-error {
  display: block;
  color: var(--danger);
  font-size: .8rem;
  margin-top: 4px;
}

.required { color: var(--danger); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: .2s;
  white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-1px); }

.btn-secondary { background: #6b7280; color: #fff; }
.btn-secondary:hover { background: #4b5563; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; transform: translateY(-1px); }

.btn-sm { padding: 7px 14px; font-size: .85rem; }

/* ── Action Buttons ── */
.action-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Search Form ── */
.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-form input {
  flex: 1;
  padding: 9px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

.search-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  padding: 6px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  font-size: .875rem;
  text-decoration: none;
  color: var(--gray-600);
  transition: .15s;
}

.pagination a:hover {
  background: var(--gray-100);
  border-color: var(--gray-400);
}

.pagination .active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── View Meta ── */
.view-meta {
  display: flex;
  gap: 16px;
  color: var(--gray-600);
  font-size: .875rem;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── View Content ── */
.view-content {
  padding: 24px 0;
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
  min-height: 200px;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: .95rem;
  color: var(--gray-800);
}

/* ── Back Link ── */
.back-link {
  color: var(--gray-400);
  font-size: .875rem;
  text-decoration: none;
}

.back-link:hover { color: var(--primary); }
