/* static/style.css - Book Club Theme */

:root {
  --primary: #5D4037; 
  --secondary: #8D6E63; 
  --bg-color: #F5F5DC; 
  --card-bg: #ffffff;
  --text-main: #3E2723;
  --text-muted: #795548;
  --accent: #E65100; 
  --radius: 12px;
  --shadow: 0 4px 12px rgba(93, 64, 55, 0.15);
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f1c40f;
  --link-color: #007bff;
}

body, html {
  margin: 0; padding: 0;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Header & Navigation --- */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 0;
}
.app-title {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0; /* 제목 줄어들지 않게 */
  margin-right: 10px;
}
.header-btns {
  display: flex;
  gap: 8px; 
  align-items: center;
  flex-wrap: nowrap; /* 줄바꿈 방지 */
}
.header-btns a {
  padding: 8px 12px;
  background: var(--secondary);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
  transition: opacity 0.2s;
  white-space: nowrap; /* 글자 줄바꿈 방지 */
}
.header-btns a:hover { opacity: 0.9; }

/* 🌟 모바일 대응: 버튼 크기 및 폰트 조절 (강력 최적화) */
@media (max-width: 600px) {
  .container { padding: 15px; }
  
  /* 앱 제목 크기 축소 */
  .app-title { font-size: 18px; margin-right: 5px; }

  /* 헤더 버튼 간격 및 크기 축소 */
  .header-btns { gap: 4px; }
  .header-btns a { 
      padding: 6px 8px; 
      font-size: 11px; /* 글자 크기 더 축소 */
      border-radius: 4px;
      letter-spacing: -0.5px; /* 자간 줄임 */
  }
  
  /* 알림 아이콘 위치 조정 */
  .noti-icon-wrapper {
      font-size: 18px !important;
      margin-left: 5px !important;
  }
  
  /* 테이블 폰트 조절 */
  .board-table th, .board-table td { font-size: 13px; padding: 8px 4px; }
  .board-table th:first-child, .board-table td:first-child { width: 75px; }
  .hero-title { font-size: 24px; }
}

/* 🌟 공지사항 배너 스타일 */
.notice-banner {
  background-color: #FFFAEC; /* 아주 연한 노랑 */
  border: 1px solid #FFD700; /* 금색 테두리 */
  color: #333;
  padding: 12px 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  font-size: 15px;
}
.notice-icon {
  margin-right: 10px;
  font-size: 18px;
}
.notice-text {
  font-weight: bold;
}
.notice-text.link {
  color: #E65100;
  text-decoration: underline;
  cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 30px;
  border: 1px solid #e0d4cf;
  word-break: keep-all; 
  overflow-wrap: break-word;
}
.hero-title { font-size: 28px; margin-bottom: 10px; color: var(--primary); margin-top: 0; line-height: 1.3; }
.hero-subtitle { color: var(--text-muted); margin: 0; font-size: 16px; line-height: 1.5; }

/* --- Grid Container --- */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* --- Card UI --- */
.card, .event-box, form {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid #e0d4cf;
  display: flex;
  flex-direction: column;
}

.book-cover-wrapper {
  width: 100%;
  background-color: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.book-cover {
  max-width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.no-cover {
  width: 100%;
  height: 200px;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
}

.card-title { font-size: 20px; font-weight: bold; margin: 0 0 10px 0; color: var(--text-main); }
.card-info { font-size: 15px; color: var(--text-muted); margin-bottom: 6px; }

/* --- Forms & Inputs --- */
label {
  display: block;
  margin-bottom: 6px;
  font-weight: bold;
  color: var(--primary);
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d7ccc8;
  border-radius: 8px;
  margin-bottom: 15px;
  box-sizing: border-box;
  font-size: 16px;
  background-color: #fafafa;
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
}

/* --- Buttons --- */
.btn, button, .button-link, input[type="submit"] {
  display: inline-block;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  color: white;
  margin-top: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--primary); }
.btn-secondary { background: var(--secondary); }
.btn-accent { background: var(--accent); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }

.btn-xs {
  padding: 6px 12px; 
  font-size: 12px;
  border-radius: 6px;
  display: inline-block;
  color: white;
  border: none;
  cursor: pointer;
  width: auto;
  margin-top: 0;
}
.btn-approve { background: var(--success); }
.btn-reject { background: var(--danger); }
.btn-wait { background: #f39c12; }

/* 🌟 텍스트 전용 버튼 스타일 */
.btn-text-only {
  background: none;
  color: #555;
  font-weight: bold;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.btn-text-only:hover { background-color: #f0f0f0; }

.admin-controls { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* --- Table --- */
.board-table { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; }
.board-table th { background: var(--secondary); color: white; padding: 10px; text-align: center; font-size: 14px; }
.board-table th:first-child, .board-table td:first-child { width: 85px; text-align: center; }
.board-table th:last-child, .board-table td:last-child { width: 60px; text-align: center; }
.board-table td { padding: 12px 8px; border-bottom: 1px solid #eee; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-table td:nth-child(2) { white-space: normal; text-align: left; font-weight: bold; }
.board-table tr:hover { background: #fafafa; }

/* --- Utilities --- */
.text-pre-wrap { white-space: pre-wrap; word-break: break-word; }
.text-muted { color: #888; font-size: 0.9em; }
.flex-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.badge { padding: 2px 6px; border-radius: 4px; font-size: 11px; font-weight: bold; color: white; margin-left: 5px; }
.badge-new { background-color: var(--accent); }
.badge-level { background-color: var(--primary); }

/* --- Comments & Replies --- */
.comment-list { margin-top: 5px; }
.comment-item { border-bottom: 1px solid #eee; padding: 10px 0; }
.reply-list { margin-top: 5px; padding-left: 20px; border-left: 2px solid #eee; }
.reply-item { position: relative; padding: 8px 0 8px 15px; background-color: #fafafa; margin-bottom: 3px; border-radius: 0 8px 8px 0; }
.reply-item::before { content: "└"; position: absolute; left: -8px; top: 8px; color: #ccc; font-weight: bold; }

.btn-delete-reply {
  background-color: transparent; color: #aaa; border: 1px solid #ddd;
  border-radius: 4px; padding: 2px 8px; font-size: 12px; cursor: pointer; margin-left: 8px;
}
.btn-delete-reply:hover { color: var(--danger); border-color: var(--danger); background-color: #fff0f0; }