/* ===== 伝言板 共通スタイル（元ひな形の緑基調を踏襲） ===== */
body {
  font-family: "Helvetica Neue", Arial, sans-serif;
  background-color: #f4f6f9;
  color: #333;
  margin: 0;
  padding: 20px;
}
.container { max-width: 800px; margin: 0 auto; }

header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid #ddd; padding-bottom: 10px; margin-bottom: 20px;
}
h1 { font-size: 20px; color: #555; margin: 0; }
.header-right { display: flex; align-items: center; gap: 10px; }
.admin-badge { background: #dc3545; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 0.7em; font-weight: bold; }
.logout-btn { background: #6c757d; color: #fff; text-decoration: none; padding: 5px 10px; border-radius: 4px; font-size: 0.8em; }
.lead { color: #666; margin: 0 0 16px; }

/* ===== 扉ページ ===== */
.group-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.group-card {
  background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  border-left: 5px solid #28a745; padding: 6px 16px;
}
.group-row { display: flex; align-items: center; justify-content: space-between; }
.group-link { flex: 1; display: flex; flex-direction: column; text-decoration: none; color: #222; padding: 10px 0; }
.group-name { font-size: 18px; font-weight: bold; }
.group-sub { font-size: 0.8em; color: #888; margin-top: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.group-id { color: #aaa; font-family: monospace; }
.entered-badge { background: #ffc107; color: #333; padding: 1px 8px; border-radius: 4px; font-weight: bold; }
.empty { color: #888; background: #fff; padding: 20px; border-radius: 8px; text-align: center; }

/* 管理操作（折りたたみ） */
.admin-ops { border-top: 1px dashed #e0e0e0; margin-top: 4px; padding-top: 6px; }
.admin-ops summary { cursor: pointer; color: #6c757d; font-size: 0.85em; padding: 4px 0; }
.admin-ops-body { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 8px; }
.op-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.op-label { font-size: 0.85em; color: #555; min-width: 130px; }
.op-form input[type="text"] { flex: 1; min-width: 140px; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9em; }
.btn-op { background: #17a2b8; color: #fff; border: none; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.85em; }
.btn-delete-group { background: #fff; color: #dc3545; border: 1px solid #dc3545; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.85em; }

.create-area { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); border-top: 5px solid #28a745; }
.create-form { display: flex; flex-direction: column; gap: 12px; }
.create-form label { display: flex; flex-direction: column; font-size: 0.9em; color: #555; gap: 4px; }
.create-form input { padding: 10px; font-size: 16px; border: 1px solid #ccc; border-radius: 4px; }
.flash-error { background: #f8d7da; color: #842029; padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

/* ===== ログイン ===== */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #eee; }
.login-box { background: #fff; padding: 30px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); text-align: center; width: 320px; }
.login-note { font-size: 0.85em; color: #666; }
.login-box input[type="password"],
.login-box input[type="text"] { padding: 10px; font-size: 18px; width: 80%; margin-bottom: 20px; text-align: center; border: 1px solid #ccc; border-radius: 5px; }
.error { color: #dc3545; margin-bottom: 15px; font-size: 0.9em; }
.back-link { display: inline-block; margin-top: 18px; color: #6c757d; font-size: 0.85em; text-decoration: none; }

/* ===== 外部リンクボタン（handson から lesson へ） ===== */
.to-lesson { display: block; background: #28a745; color: #fff; text-align: center;
  text-decoration: none; font-size: 20px; font-weight: bold; padding: 16px;
  border-radius: 8px; margin-bottom: 20px; }

/* ===== 掲示板 入力エリア ===== */
.input-area { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); margin-bottom: 30px; border-top: 5px solid #28a745; }
.emoji-palette { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed #eee; display: flex; flex-wrap: wrap; gap: 5px; }
.emoji-btn { font-size: 1.5em; background: none; border: none; cursor: pointer; padding: 5px; border-radius: 5px; }
textarea { width: 100%; height: 80px; font-size: 16px; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; margin-bottom: 10px; }

.pick-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pick-btn { background: #e9ecef; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 0.9em; border: 1px solid #ced4da; }
.pick-btn:hover { background: #dee2e6; }

.file-list { margin-bottom: 10px; }
.file-item { background: #e9ecef; padding: 5px 10px; margin-bottom: 5px; border-radius: 4px; display: flex; justify-content: space-between; align-items: center; font-size: 0.9em; }
.file-item .rm { border: none; background: #dc3545; color: #fff; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; line-height: 1; }

.form-footer { display: flex; justify-content: space-between; align-items: center; }
.btn-submit { background: #28a745; color: #fff; border: none; padding: 10px 24px; font-size: 16px; cursor: pointer; border-radius: 4px; font-weight: bold; }
.btn-submit:disabled { background: #9bd3ab; cursor: default; }
.btn-reset { background: #6c757d; color: #fff; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; font-size: 0.9em; }
.upload-status { font-size: 0.85em; color: #666; margin-top: 10px; }

/* ===== メッセージカード ===== */
.message-card { background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); margin-bottom: 15px; border-left: 5px solid #007bff; position: relative; }
.my-post { border-left: 5px solid #ffc107; background-color: #fffff9; }
.meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; border-bottom: 1px solid #eee; padding-bottom: 8px; }
.date { font-size: 0.85em; color: #666; font-weight: bold; }
.message-body { font-size: 18px; line-height: 1.6; white-space: pre-wrap; color: #222; }
.link-btn { display: inline-block; background: #17a2b8; color: #fff; padding: 5px 15px; border-radius: 4px; text-decoration: none; font-size: 14px; }
.btn-delete { background: #fff; color: #dc3545; border: 1px solid #dc3545; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 0.8em; }

.media-preview { margin-top: 10px; }
img, video { max-width: 100%; border-radius: 8px; display: block; margin-bottom: 8px; border: 1px solid #ddd; }
audio { width: 100%; margin-bottom: 8px; }
.file-attachment { margin-top: 8px; padding: 14px 16px; background-color: #e2e6ea; border: 1px solid #ced4da; border-radius: 8px; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 10px; text-decoration: none; color: #333; margin-right: 10px; margin-bottom: 5px; }
.file-head { display: flex; align-items: center; }
.file-icon { font-size: 1.5em; margin-right: 10px; }
.file-name { font-size: 1.05em; word-break: break-all; }
.file-dl-label { display: inline-block; background: #28a745; color: #fff; text-align: center; font-size: 14px; font-weight: bold; padding: 5px 15px; border-radius: 4px; }

/* ===== フォルダ表示 ===== */
.folder-block { background: #eef6ef; border: 1px solid #cfe6d4; border-radius: 8px; padding: 12px; margin-top: 8px; }
.folder-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.folder-title { font-weight: bold; font-size: 1.05em; }
.folder-count { font-size: 0.8em; color: #666; background: #fff; padding: 1px 8px; border-radius: 4px; }
.folder-dl { margin-left: auto; background: #28a745; color: #fff; text-decoration: none; padding: 6px 14px; border-radius: 4px; font-size: 0.85em; }
.folder-details { margin-top: 10px; }
.folder-details summary { cursor: pointer; color: #28a745; font-size: 0.9em; }
.folder-files { margin: 8px 0 0; padding-left: 20px; font-family: monospace; font-size: 0.85em; color: #444; max-height: 240px; overflow: auto; }
.folder-files li { margin: 2px 0; }

/* ドラッグ＆ドロップ中のハイライト（既存の緑テーマに合わせる） */
.input-area.drag-over { border: 2px dashed #28a745; background: #f0fff4; }

/* 投稿テキストのコピーボタン */
.btn-copy {
  display: inline-block;
  margin: 8px 0 4px;
  padding: 10px 16px;
  background: #6c4bb6;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
.btn-copy.copied {
  background: #2e7d32;
  cursor: default;
}
