/**
 * Notification Bell & Dropdown Styles
 */

/* ========================================
   ベルアイコン
   ======================================== */
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notification-bell-btn {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  position: relative;
  color: #64748b;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

.notification-bell-btn:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.notification-bell-icon {
  width: 24px;
  height: 24px;
  display: block;
}

/* 未読バッジ */
.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ========================================
   ドロップダウン
   ======================================== */
.notification-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 480px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ヘッダー */
.notification-dropdown-header {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9fafb;
}

.notification-dropdown-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

.mark-all-read-btn {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.mark-all-read-btn:hover {
  background-color: #eff6ff;
}

/* ========================================
   セグメントタブ
   ======================================== */
.notification-tabs {
  display: flex;
  padding: 0;
  gap: 0;
  background: #f9fafb;
}

.notification-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 13px;
  color: #64748b;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

.notification-tab:hover {
  background-color: #f1f5f9;
  color: #475569;
}

.notification-tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  background-color: white;
}

.tab-icon {
  font-size: 14px;
}

.tab-label {
  font-weight: 500;
}

.tab-badge {
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ========================================
   コンテンツエリア
   ======================================== */
.notification-dropdown-content {
  flex: 1;
  overflow-y: auto;
  max-height: 360px;
}

.mark-all-read-link {
  display: block;
  width: 100%;
  padding: 8px 16px;
  background: #eff6ff;
  border: none;
  color: #3b82f6;
  font-size: 12px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s;
}

.mark-all-read-link:hover {
  background: #dbeafe;
}

.notification-list {
  padding: 0;
}

/* 空の状態 */
.notification-empty {
  padding: 40px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* ========================================
   通知アイテム
   ======================================== */
.notification-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: background-color 0.2s;
  position: relative;
}

.notification-item:hover {
  background-color: #f9fafb;
}

.notification-item:last-child {
  border-bottom: none;
}

/* 未読インジケーター */
.notification-item-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.notification-item.unread .notification-item-indicator {
  background: #3b82f6;
}

.notification-item.read .notification-item-indicator {
  background: transparent;
}

.notification-item.unread {
  background-color: #f0f9ff;
}

/* コンテンツ */
.notification-item-content {
  flex: 1;
  min-width: 0;
}

.notification-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.4;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item.read .notification-item-title {
  color: #64748b;
  font-weight: 400;
}

.notification-item-meta {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-item-date {
  font-size: 11px;
  color: #94a3b8;
}

/* ========================================
   詳細モーダル
   ======================================== */
.notification-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.notification-detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.notification-detail-content {
  position: relative;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.notification-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.notification-detail-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  padding-right: 16px;
}

.notification-detail-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.notification-detail-close:hover {
  color: #64748b;
}

.notification-detail-body {
  padding: 20px;
  overflow-y: auto;
}

.notification-detail-date {
  font-size: 12px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.notification-detail-text {
  font-size: 14px;
  line-height: 1.7;
  color: #475569;
}

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 480px) {
  .notification-dropdown {
    width: calc(100vw - 32px);
    right: -8px;
  }

  .notification-detail-content {
    max-width: 100%;
    margin: 0 16px;
  }
}

/* ========================================
   管理画面用追加スタイル
   ======================================== */
.admin-header .notification-bell {
  margin-right: 12px;
}

.admin-header .notification-bell-btn {
  color: #64748b;
}

.admin-header .notification-bell-btn:hover {
  color: #1e293b;
  background-color: #f1f5f9;
}

/* ========================================
   お知らせ管理テーブル用スタイル
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.badge-info {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-secondary {
  background: #f1f5f9;
  color: #475569;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-active {
  background: #dcfce7;
  color: #15803d;
}

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

/* テーブル操作ボタン */
.actions-cell {
  white-space: nowrap;
}

.btn-icon {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #64748b;
  border-radius: 4px;
  transition: background-color 0.2s, color 0.2s;
}

.btn-icon:hover {
  background-color: #f1f5f9;
}

.btn-icon.btn-edit:hover {
  color: #3b82f6;
}

.btn-icon.btn-delete:hover {
  color: #ef4444;
}

/* モーダルサイズ */
.modal-medium {
  max-width: 560px;
}

.modal-small {
  max-width: 400px;
}

/* フォーム行 */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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