@charset "UTF-8";

/* ==========================================================================
   管理者パネル専用追加スタイル
   ========================================================================== */

/* ステータスバッジ（公開中 / 非表示中） */
.admin-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-visible {
  background: rgba(48, 209, 88, 0.2);
  color: #30d158;
  border: 0.5px solid rgba(48, 209, 88, 0.4);
}

.badge-hidden {
  background: rgba(255, 69, 58, 0.2);
  color: #ff453a;
  border: 0.5px solid rgba(255, 69, 58, 0.4);
}

/* 操作ボタンエリア */
.admin-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-admin {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.2s;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 80px;
}

/* ローディング状態のボタン */
.btn-admin.btn-loading {
  pointer-events: none;
  opacity: 0.75;
}

/* --- Checkbox Animations --- */
.op-daysoff-cb, .edit-days-off-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  background: rgba(0,0,0,0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

.op-daysoff-cb::after, .edit-days-off-cb::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 10px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: scale(0) rotate(-45deg);
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s;
  top: 1px;
}

.op-daysoff-cb:checked, .edit-days-off-cb:checked {
  background: #007aff;
  border-color: #007aff;
}

.op-daysoff-cb:checked::after, .edit-days-off-cb:checked::after {
  transform: scale(1) rotate(45deg);
  opacity: 1;
}

.btn-admin.btn-loading {
  pointer-events: none;
  opacity: 0.75;
  color: transparent;
}
.btn-admin.btn-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--text-secondary) transparent var(--text-secondary) transparent;
  animation: btn-spin 0.7s linear infinite;
  color: var(--text-primary);
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.btn-admin:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  color: var(--color-error);
  border-color: rgba(255, 69, 58, 0.3);
}

.btn-success {
  color: #30d158;
  border-color: rgba(48, 209, 88, 0.3);
}

/* 編集・操作ログカード */
.log-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
  font-size: 0.825rem;
}

.log-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.log-change {
  background: rgba(0, 0, 0, 0.3);
  padding: 8px;
  border-radius: 6px;
  margin-top: 6px;
  font-family: inherit;
  white-space: pre-wrap;
}

/* セレクトボックスのオプションが見えない問題の修正 */
select.form-input option {
  background-color: #2b2b2b;
  color: #ffffff;
}

/* --- Added for UI Revamp --- */
#train-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 16px;
}

.fade-in {
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.train-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.op-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 16px;
  transition: background 0.2s;
}
.op-card:hover {
  background: rgba(255,255,255,0.06);
}

.op-day-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.op-day-row:last-child { border-bottom: none; }

/* Root & Body Scrollbar Normalization */
html {
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  overflow: visible;
}

.btn-admin.active { background: var(--text-link); color: #fff; }

/* Admin Tab Transitions */
#main-container { position: relative; }
.view-panel {
  min-height: auto;
  padding-bottom: 40px;
  flex: none;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s var(--smooth-easing), transform 0.3s var(--spring-easing), visibility 0.3s;
  position: absolute;
  top: 0; left: 0; right: 0;
  visibility: hidden;
}
.view-panel.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  position: relative;
  visibility: visible;
}

/* Hover glow for inputs and buttons */
.btn-admin:hover:not(:disabled) {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}
.form-input {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.form-input:focus {
  border-color: var(--text-link) !important;
  box-shadow: 0 0 0 2px rgba(9, 132, 227, 0.3) !important;
}

/* ===== Train List & Editor Layout ===== */
.train-list-sidebar {
  flex: 1;
  max-width: 300px;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 16px;
  height: fit-content;
}

.train-editor-container {
  flex: 2;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 16px;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
