/**
 * 管理者画面専用スタイルシート
 *
 * 管理者画面で使用される専用スタイル
 * - 管理者ヘッダー（ダークブルー/グレー配色）
 * - ダッシュボードナビゲーショングリッド
 * - モーダル
 * - テーブル拡張
 * - バッジ
 * - ページヘッダー
 * - 管理者専用フォームスタイル
 */

/* ==========================================
   管理者ヘッダー
   ========================================== */
.admin-header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

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

.admin-header .header-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.admin-header .header-user {
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-header .header-username {
  font-size: 1rem;
}

.admin-header .header-logout {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.admin-header .header-logout:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================
   管理者ナビゲーショングリッド
   ========================================== */
.admin-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

/* ==========================================
   管理者ナビゲーションカード
   ========================================== */
.admin-nav-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
  border: 2px solid transparent;
}

.admin-nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

.admin-nav-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.admin-nav-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 8px;
}

.admin-nav-description {
  font-size: 0.95rem;
  color: #718096;
  line-height: 1.5;
}

/* ==========================================
   モーダル
   ========================================== */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background-color: white;
  margin: auto;
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 600px;
  animation: slideIn 0.3s ease;
}

.modal-content.modal-large {
  max-width: 1200px;
  width: 95%;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 24px 32px;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #718096;
  cursor: pointer;
  transition: color 0.3s ease;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #2c3e50;
}

.modal-body {
  padding: 32px;
}

.modal-footer {
  padding: 20px 32px;
  border-top: 2px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.preview-container {
  width: 100%;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  border-radius: 8px;
}

/* ==========================================
   テーブルスタイル拡張
   ========================================== */
.table-container {
  overflow-x: auto;
  margin: 24px 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table thead {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
}

.table th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.table td {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.95rem;
  color: #333;
}

.table tbody tr {
  transition: background-color 0.2s ease;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ==========================================
   バッジ
   ========================================== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.badge-success {
  background-color: #c6f6d5;
  color: #22543d;
}

.badge-secondary {
  background-color: #e2e8f0;
  color: #2d3748;
}

.badge-warning {
  background-color: #feebc8;
  color: #7c2d12;
}

.badge-danger {
  background-color: #fed7d7;
  color: #742a2a;
}

/* ==========================================
   ページヘッダー
   ========================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

/* ==========================================
   管理者フォームスタイル
   ========================================== */
.admin-form .form-group {
  margin-bottom: 24px;
}

.admin-form .form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
  font-size: 0.95rem;
}

.admin-form .form-label.required::after {
  content: " *";
  color: #e53e3e;
}

.admin-form .form-input,
.admin-form .form-select,
.admin-form .form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.admin-form .form-input:focus,
.admin-form .form-select:focus,
.admin-form .form-textarea:focus {
  outline: none;
  border-color: #2c3e50;
  box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

.admin-form .form-input.error,
.admin-form .form-select.error,
.admin-form .form-textarea.error {
  border-color: #e53e3e;
}

.admin-form .form-input.error:focus,
.admin-form .form-select.error:focus,
.admin-form .form-textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

/* ==========================================
   ボタン拡張
   ========================================== */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* ==========================================
   マージンユーティリティ
   ========================================== */
.mr-2 {
  margin-right: 16px;
}

.ml-2 {
  margin-left: 16px;
}

.mr-1 {
  margin-right: 8px;
}

.ml-1 {
  margin-left: 8px;
}

/* ==========================================
   レスポンシブデザイン
   ========================================== */

/* タブレット */
@media (max-width: 1023px) {
  .admin-nav-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
  }

  .admin-nav-card {
    padding: 24px;
  }

  .admin-nav-icon {
    font-size: 2.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .modal-content {
    width: 95%;
  }
}

/* モバイル */
@media (max-width: 767px) {
  .admin-header .header-content {
    flex-direction: column;
    gap: 16px;
  }

  .admin-header .header-user {
    width: 100%;
    justify-content: space-between;
  }

  .admin-nav-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .admin-nav-card {
    padding: 20px;
  }

  .admin-nav-icon {
    font-size: 2rem;
  }

  .admin-nav-title {
    font-size: 1.1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .modal-content {
    width: 95%;
    max-width: none;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 20px;
  }

  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table th,
  .table td {
    padding: 12px;
    font-size: 0.875rem;
  }

  .table-actions {
    flex-direction: column;
    gap: 4px;
  }

  .table-actions .btn-sm {
    width: 100%;
  }
}
