/* ==========================================================================
   POP＆かわいい パステル調デザインシステム (MTAI 講習会ポータル)
   ========================================================================== */

:root {
  /* パステルカラーパレット */
  --bg-color: #FFFDF9;
  --bg-gradient: linear-gradient(135deg, #FFF6EC 0%, #FFFDF9 50%, #F0F7FF 100%);
  --card-bg: #FFFFFF;
  --card-border: #F3EAE0;
  
  --primary: #FF758F;          /* ストロベリーピンク */
  --primary-hover: #FF4D6D;
  --primary-light: #FFE5EC;
  
  --secondary: #48CAE4;        /* スカイブルー */
  --secondary-hover: #0096C7;
  --secondary-light: #E0F7FA;
  
  --mint: #52B788;             /* ミントグリーン (事前資料) */
  --mint-light: #D8F3DC;
  
  --lavender: #9D4EDD;         /* ラベンダー (事後資料・実施報告) */
  --lavender-light: #F3E8FF;
  
  --sunshine: #FFB703;         /* ハニーイエロー */
  --sunshine-light: #FFF8E7;

  --text-main: #3D3A45;        /* 優しい濃色テキスト */
  --text-muted: #7D7589;
  --border-radius-sm: 10px;
  --border-radius-md: 18px;
  --border-radius-lg: 26px;
  --border-radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(120, 80, 100, 0.06);
  --shadow-md: 0 8px 24px rgba(120, 80, 100, 0.08);
  --shadow-hover: 0 12px 30px rgba(255, 117, 143, 0.18);
  --shadow-inset: inset 0 2px 4px rgba(0,0,0,0.02);

  --font-family: 'Zen Maru Gothic', 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* リセット＆基本設定 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* リンク */
a {
  color: var(--primary);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  color: var(--primary-hover);
}

/* コンテナ */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   ヘッダー＆ナビゲーション
   ========================================================================== */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 2px dashed #F5E6D8;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.brand-title {
  display: flex;
  flex-direction: column;
}
.brand-title .main-name {
  font-size: 1.2rem;
  letter-spacing: 0.05em;
}
.brand-title .sub-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  color: var(--primary-hover);
  padding: 0.4rem 0.9rem;
  border-radius: var(--border-radius-full);
  font-size: 0.85rem;
  font-weight: 700;
}

.user-badge .role-tag {
  background: #FFF;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--border-radius-full);
}

.role-tag.admin {
  background: #FF758F;
  color: #FFF;
}

/* ==========================================================================
   ボタン類 (ぷっくり・かわいいデザイン)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--border-radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-hover);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #FFF;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #FFF;
}

.btn-secondary {
  background: var(--secondary-light);
  color: var(--secondary-hover);
}
.btn-secondary:hover {
  background: var(--secondary);
  color: #FFF;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--card-border);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-danger {
  background: #FFE5E5;
  color: #E63946;
}
.btn-danger:hover {
  background: #E63946;
  color: #FFF;
}

.btn-sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
}

/* ==========================================================================
   アラートメッセージ (Flash)
   ========================================================================== */
.flash-container {
  margin: 1.2rem auto 0;
  max-width: 800px;
}

.flash-msg {
  padding: 0.85rem 1.25rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: popIn 0.3s ease-out;
  box-shadow: var(--shadow-sm);
}

.flash-msg.success {
  background: #E8F5E9;
  color: #2E7D32;
  border: 2px solid #C8E6C9;
}
.flash-msg.error {
  background: #FFEBEE;
  color: #C62828;
  border: 2px solid #FFCDD2;
}
.flash-msg.info {
  background: #E1F5FE;
  color: #0277BD;
  border: 2px solid #B3E5FC;
}

@keyframes popIn {
  0% { transform: scale(0.9); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   ログイン画面
   ========================================================================== */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
  padding: 2rem 1rem;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 3px solid #FFF1E6;
  width: 100%;
  max-width: 440px;
  overflow: hidden;
  text-align: center;
}

.login-header-banner {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.login-body {
  padding: 2rem;
}

.login-mascot-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  margin: -65px auto 1rem;
  background: #FFF;
  border: 4px solid #FFF;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.login-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-title {
  font-size: 1.5rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  font-weight: 700;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
  text-align: left;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  background: #FAFAFA;
  border: 2px solid #EBE7EE;
  border-radius: var(--border-radius-md);
  outline: none;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  background: #FFF;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.login-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  margin-top: 0.5rem;
}

.login-tips {
  margin-top: 1.5rem;
  padding: 0.75rem;
  background: #FFF8E7;
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  color: #8C6A00;
  line-height: 1.5;
}

/* ==========================================================================
   カレンダー画面
   ========================================================================== */
.calendar-hero {
  margin: 1.5rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.calendar-header-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.current-month-display {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 160px;
  text-align: center;
  background: #FFF;
  padding: 0.4rem 1rem;
  border-radius: var(--border-radius-full);
  border: 2px solid var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.calendar-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 3px solid #FFF3E6;
  padding: 1.25rem;
  margin-bottom: 2rem;
  overflow-x: auto;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(110px, 1fr));
  gap: 8px;
}

.calendar-day-header {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem 0;
  color: var(--text-muted);
}
.calendar-day-header.sun { color: #E63946; }
.calendar-day-header.sat { color: #0077B6; }

.calendar-cell {
  background: #FDFBF7;
  border: 2px solid #F5EFE6;
  border-radius: var(--border-radius-md);
  min-height: 110px;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-cell:hover {
  background: #FFF;
  border-color: #FFCCD5;
  box-shadow: var(--shadow-sm);
}

.calendar-cell.other-month {
  opacity: 0.35;
  background: #F9F9F9;
}

.calendar-cell.today {
  border-color: var(--primary);
  background: #FFF5F7;
}

.cell-date-num {
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
  width: 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  color: var(--text-main);
}

.calendar-cell.today .cell-date-num {
  background: var(--primary);
  color: #FFF;
}

.cell-events {
  margin-top: 0.3rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.event-chip {
  background: #FFF;
  border: 1.5px solid var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--border-radius-sm);
  padding: 0.3rem 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.03);
  text-align: left;
  line-height: 1.3;
}

.event-chip:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 4px 10px rgba(255, 117, 143, 0.25);
  border-color: var(--primary);
}

.chip-title {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip-badges {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.badge-dot {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--border-radius-full);
  font-weight: 700;
}
.badge-dot.pre { background: var(--mint-light); color: var(--mint); }
.badge-dot.post { background: var(--lavender-light); color: var(--lavender); }

/* ==========================================================================
   モーダルウィンドウ (詳細表示)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 30, 45, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 4px solid #FFF0F3;
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  animation: popIn 0.25s ease-out;
  padding: 2rem;
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: #F0EDF2;
  border: none;
  font-size: 1.25rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: var(--text-muted);
}
.modal-close-btn:hover {
  background: var(--primary);
  color: #FFF;
}

.modal-event-date {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 700;
  display: inline-block;
  background: var(--primary-light);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-full);
  margin-bottom: 0.5rem;
}

.modal-event-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.detail-section {
  background: #FCFAF7;
  border: 2px solid #F5EFE6;
  border-radius: var(--border-radius-md);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
}

.section-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.section-content {
  font-size: 0.92rem;
  color: #555;
  white-space: pre-wrap;
  line-height: 1.7;
}

/* 添付ファイルリスト */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFF;
  border: 1.5px solid #EBE4DC;
  border-radius: var(--border-radius-sm);
  padding: 0.6rem 0.85rem;
  transition: all 0.2s ease;
}

.file-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.file-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  word-break: break-all;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px dashed #F0E8E0;
}

/* ==========================================================================
   講習会編集・新規作成フォーム (event_form.html)
   ========================================================================== */
.form-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  border: 3px solid #FFF0F3;
  padding: 2rem;
  max-width: 800px;
  margin: 1.5rem auto 3rem;
}

.form-header {
  border-bottom: 2px dashed #F5EAE0;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-upload-box {
  background: #FAF8F5;
  border: 2px dashed #E0D6CC;
  border-radius: var(--border-radius-md);
  padding: 1rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   フッター
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.7);
  border-top: 2px dashed #F5E6D8;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================================================
   レスポンシブ対応 (スマートフォン)
   ========================================================================== */
@media (max-width: 768px) {
  .site-header { padding: 0.5rem 0; }
  .brand-logo .sub-name { display: none; }
  .calendar-hero { flex-direction: column; align-items: stretch; }
  .calendar-controls { justify-content: space-between; }
  .calendar-grid { grid-template-columns: repeat(7, minmax(42px, 1fr)); gap: 4px; }
  .calendar-cell { min-height: 80px; padding: 0.2rem; }
  .cell-date-num { font-size: 0.75rem; width: 22px; height: 22px; line-height: 22px; }
  .event-chip { padding: 0.2rem 0.25rem; font-size: 0.65rem; }
  .chip-badges { display: none; } /* スマホでは省略してシンプルに */
  .modal-box { padding: 1.25rem; }
}

/* ==========================================================================
   タグスタイル (POP & かわいいパステルピル)
   ========================================================================== */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--border-radius-full);
  background: #FFF;
  border: 1.5px solid #F0E6DD;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.tag-pill:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 4px 10px rgba(255, 117, 143, 0.15);
}

.tag-pill.active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(255, 117, 143, 0.28);
}

.tag-count {
  font-size: 0.75rem;
  opacity: 0.8;
}

.tag-pill-sm {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--border-radius-full);
  background: #F3E8FF;
  color: #7E22CE;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}

.tag-pill-sm:hover {
  background: #E9D5FF;
  color: #6B21A8;
  transform: translateY(-1px);
}

.event-chip .chip-tag {
  font-size: 0.65rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.05rem 0.35rem;
  border-radius: var(--border-radius-full);
}

.event-summary-card:hover {
  transform: translateY(-2px);
  border-color: #FFCCD5 !important;
  box-shadow: 0 8px 20px rgba(255, 117, 143, 0.12) !important;
}
