/**
 * Discord Translator Bot ダッシュボードスタイル
 */

/* 全体のスタイル */
body {
  background-color: #f8f9fa;
}

/* カードスタイル */
.card {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.5rem;
  border: 1px solid rgba(0, 0, 0, 0.125);
}

.card-header {
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  padding: 0.75rem 1.25rem;
}

/* サーバーカード */
.server-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.server-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.server-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: #5865F2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: bold;
  margin-right: 1rem;
}

.server-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* チャンネルリスト */
.category-header {
  background-color: #4b4e57;
  color: #ffffff;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 4px;
  margin-top: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
}

.channel-row {
  padding: 8px 12px;
  margin-bottom: 4px;
  border-radius: 4px;
  background-color: #ffffff;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.channel-row:hover {
  background-color: #f0f0f0;
}

.channel-row.modified {
  border-left-color: #ffc107;
}

.channel-name {
  font-weight: 500;
  display: flex;
  align-items: center;
}

.channel-name i {
  margin-right: 8px;
  color: #72767d;
}

/* リンクグループカード */
.linkgroup-card {
  margin-bottom: 16px;
  transition: transform 0.2s ease;
}

.linkgroup-card:hover {
  transform: translateY(-2px);
}

.linkgroup-name {
  font-weight: 600;
  font-size: 1.1rem;
}

.linkgroup-actions {
  display: flex;
  gap: 8px;
}

/* フォーム要素 */
.form-select, .form-control {
  min-height: 38px;
}

/* バッジ */
.badge-channel-count {
  background-color: #5865F2;
  color: white;
  font-weight: normal;
}

/* ローディングスピナー */
.loading-spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #5865F2;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ユーティリティクラス */
.cursor-pointer {
  cursor: pointer;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* フィルター関連 */
.filtered-out {
  display: none;
}

/* 変更ステータスインジケータ */
.changes-indicator {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #ffc107;
  border-radius: 50%;
  margin-left: 8px;
}

/* トースト通知 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1060;
}

/* 言語選択関連スタイルの強化 */
.language-selector-container {
  position: relative;
  z-index: 1000; /* 他の要素より前面に表示 */
}

.language-selector-container .dropdown-toggle {
  color: white !important;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
}

.language-selector-container .dropdown-toggle:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.language-selector-container .dropdown-menu {
  min-width: 150px;
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
  padding: 0.5rem 0;
  /* display: block; この行を削除または以下のようにコメントアウト */
  margin-top: 0.25rem;
}

.language-selector-container .dropdown-item {
  color: #212529;
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
  font-weight: 500;
}

/* ログイン/ログアウトボタンスタイル */
#login-button, #logout-button {
  border-radius: 2rem;
  padding: 0.375rem 1.25rem;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#login-button {
  background: linear-gradient(45deg, #5865F2, #7289da);
  color: white;
  box-shadow: 0 2px 5px rgba(88, 101, 242, 0.3);
}

#login-button:hover {
  background: linear-gradient(45deg, #4752c4, #5d73c7);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(88, 101, 242, 0.4);
}

#logout-button {
  background: linear-gradient(45deg, #ff5e5e, #ff7e7e);
  color: white;
  box-shadow: 0 2px 5px rgba(255, 94, 94, 0.3);
}

#logout-button:hover {
  background: linear-gradient(45deg, #ff4141, #ff6e6e);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 94, 94, 0.4);
}

/* アイコンを追加するためのスタイル */
#login-button::before {
  content: "\F4EC"; /* Bootstrap Iconsの人物アイコン */
  font-family: "bootstrap-icons";
  display: inline-block;
}

#logout-button::before {
  content: "\F1B9"; /* Bootstrap Iconsの出口アイコン */
  font-family: "bootstrap-icons";
  display: inline-block;
}

/* ユーザー名表示のスタイル改善 */
#username-display {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 0.25rem 1rem;
  display: flex;
  align-items: center;
  font-weight: 500;
}

#username-display::before {
  content: "\F4E1"; /* Bootstrap Iconsのユーザーアイコン */
  font-family: "bootstrap-icons";
  margin-right: 0.5rem;
}

/* ロール権限マトリックス */
.permission-matrix .permission-cell {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.permission-matrix .permission-cell:hover {
  background-color: #e9ecef;
}

.permission-matrix .permission-cell i {
  font-size: 1.2rem;
  vertical-align: middle;
}

/* カレンダースタイル */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #dee2e6;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
}

.calendar-header-row {
  display: contents;
}

.calendar-day-header {
  background-color: #f8f9fa;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  border-bottom: 1px solid #dee2e6;
}

.calendar-week {
  display: contents;
}

.calendar-day {
  background-color: white;
  min-height: 120px;
  padding: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.calendar-day:hover {
  background-color: #f8f9fa;
}

.calendar-day.other-month {
  background-color: #f8f9fa;
  color: #adb5bd;
}

.calendar-day.today {
  background-color: #e3f2fd;
  border: 2px solid #2196f3;
}

.calendar-day.selected {
  background-color: #fff3e0;
  border: 2px solid #ff9800;
}

.calendar-day-number {
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-align: center;
}

.calendar-day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-event-preview {
  background-color: #0d6efd;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 2px;
}

.calendar-event-preview:hover {
  opacity: 0.8;
}

.event-time {
  font-weight: 600;
  font-size: 0.7rem;
}

.event-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* イベント・通知リストアイテム */
.event-item, .notification-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-item:hover, .notification-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }
  
  .calendar-day-number {
    font-size: 0.875rem;
  }
  
  .calendar-event-preview {
    font-size: 0.7rem;
    padding: 1px 3px;
  }
}

/* Sticky header for horizontal scroll */
.table-responsive table thead {
  position: sticky;
  top: 0;
  z-index: 1; /* Ensure it stays above scrolling content */
  background-color: #f8f9fa; /* Match table-light background */
}

/* Highlight rows with pending changes */
.permission-matrix .table-warning {
  background-color: #fff3cd !important; /* Bootstrap warning background */
}

/* ロール権限マトリックス */
.permission-matrix .permission-cell {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.permission-matrix .permission-cell:hover {
  background-color: #e9ecef;
}

.permission-matrix .permission-cell i {
  font-size: 1.2rem;
  vertical-align: middle;
}

/* カレンダースタイル */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background-color: #dee2e6;
  border: 1px solid #dee2e6;
  border-radius: 0.375rem;
  overflow: hidden;
}

.calendar-header-row {
  display: contents;
}

.calendar-day-header {
  background-color: #f8f9fa;
  padding: 0.75rem 0.5rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: #6c757d;
  border-bottom: 1px solid #dee2e6;
}

.calendar-week {
  display: contents;
}

.calendar-day {
  background-color: white;
  min-height: 120px;
  padding: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.calendar-day:hover {
  background-color: #f8f9fa;
}

.calendar-day.other-month {
  background-color: #f8f9fa;
  color: #adb5bd;
}

.calendar-day.today {
  background-color: #e3f2fd;
  border: 2px solid #2196f3;
}

.calendar-day.selected {
  background-color: #fff3e0;
  border: 2px solid #ff9800;
}

.calendar-day-number {
  font-weight: 600;
  margin-bottom: 0.25rem;
  text-align: center;
}

.calendar-day-events {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.calendar-event-preview {
  background-color: #0d6efd;
  color: white;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 2px;
}

.calendar-event-preview:hover {
  opacity: 0.8;
}

.event-time {
  font-weight: 600;
  font-size: 0.7rem;
}

.event-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* イベント・通知リストアイテム */
.event-item, .notification-item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-item:hover, .notification-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }
  
  .calendar-day-number {
    font-size: 0.875rem;
  }
  
  .calendar-event-preview {
    font-size: 0.7rem;
    padding: 1px 3px;
  }
}