/**
 * style.css
 * ヤフオク管理システム 共通スタイル
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', sans-serif;
  font-size: 14px;
  color: #333;
  background: #f0f2f5;
  line-height: 1.6;
}

a {
  color: #4a90d9;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ===========================
   ログインページ
   =========================== */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  width: 380px;
  max-width: 90vw;
}

.login-box__title {
  font-size: 20px;
  text-align: center;
  margin-bottom: 24px;
  color: #333;
}

/* ===========================
   ヘッダー
   =========================== */
.header {
  background: #2c3e50;
  color: #fff;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
}

.header__title {
  font-size: 16px;
  font-weight: 600;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header__link {
  color: rgba(255, 255, 255, 0.7);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  transition: background 0.2s;
}
.header__link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}
.header__link.is-active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.header__logout {
  margin-left: 8px;
}

.header__logout-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}
.header__logout-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

/* ===========================
   メインコンテンツ
   =========================== */
.main {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

/* ===========================
   集計カード
   =========================== */
.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  text-align: center;
  border-top: 3px solid #ddd;
}

.stat-card--today { border-top-color: #4a90d9; }
.stat-card--winning { border-top-color: #27ae60; }
.stat-card--outbid { border-top-color: #e74c3c; }
.stat-card--won { border-top-color: #f39c12; }
.stat-card--amount { border-top-color: #8e44ad; }

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  line-height: 1.2;
}

.stat-card__label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* ===========================
   パネル
   =========================== */
.panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel__title {
  font-size: 15px;
  font-weight: 600;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.panel__footer {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid #eee;
}

/* ===========================
   テーブル
   =========================== */
.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  white-space: nowrap;
}

.table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 12px;
  color: #666;
}

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

.table__thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
}

.table__title-link {
  display: block;
  max-width: 400px;
  white-space: normal;
  word-break: break-word;
}

.table__auction-id {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
  color: #999;
  padding: 40px 12px !important;
}

/* ===========================
   ステータスラベル
   =========================== */
.status-label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-label--win {
  background: #d4edda;
  color: #155724;
}

.status-label--outbid,
.status-label--lose {
  background: #f8d7da;
  color: #721c24;
}

.status-label--won {
  background: #fff3cd;
  color: #856404;
}

.status-label--lost {
  background: #e2e3e5;
  color: #383d41;
}

.status-label--skip {
  background: #f0f0f0;
  color: #999;
}

.status-label--error,
.status-label--unknown {
  background: #ffeaa7;
  color: #7d6608;
}

/* ===========================
   行のステータス別背景色
   =========================== */
.table tbody tr.row--won {
  background: #fff8e1;
}
.table tbody tr.row--won:hover {
  background: #fff3c4;
}

.table tbody tr.row--lost {
  background: #f5f5f5;
  opacity: 0.6;
}
.table tbody tr.row--lost:hover {
  background: #eeeeee;
  opacity: 0.8;
}

.table tbody tr.row--outbid {
  background: #fce4ec;
}
.table tbody tr.row--outbid:hover {
  background: #f8bbd0;
}

/* ===========================
   一括削除バー
   =========================== */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: #fff3cd;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 13px;
}

.bulk-bar__select-all {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 600;
}

.bulk-bar__count {
  color: #856404;
  font-weight: 600;
}

.btn--danger {
  background: #e74c3c;
  color: #fff;
}
.btn--danger:hover {
  background: #c0392b;
}

.btn--small {
  padding: 6px 14px;
  font-size: 12px;
}

.th-check,
.td-check {
  width: 36px;
  text-align: center;
}

/* ===========================
   フィルタタブ
   =========================== */
.filter-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.filter-tab {
  padding: 8px 16px;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
}
.filter-tab:hover {
  text-decoration: none;
  background: #e8f0fe;
  color: #4a90d9;
}
.filter-tab.is-active {
  background: #4a90d9;
  color: #fff;
}

.filter-tab__count {
  font-size: 11px;
  opacity: 0.8;
}

/* ===========================
   検索フォーム
   =========================== */
.search-form {
  padding: 16px 20px;
}

.search-form__row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-form__separator {
  color: #999;
  font-size: 13px;
}

/* ===========================
   結果件数 + 凡例
   =========================== */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
  flex-wrap: wrap;
  gap: 8px;
}

.results-info {
  font-size: 12px;
  color: #888;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #666;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend__color {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend__color--active {
  background: #fff;
}

.legend__color--outbid {
  background: #fce4ec;
}

.legend__color--won {
  background: #fff8e1;
}

.legend__color--lost {
  background: #f5f5f5;
  opacity: 0.6;
}

/* ===========================
   ページネーション
   =========================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.pagination__link:hover {
  text-decoration: none;
  background: #e8f0fe;
  color: #4a90d9;
}
.pagination__link.is-active {
  background: #4a90d9;
  color: #fff;
}

/* ===========================
   フォーム部品
   =========================== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #555;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
}
.form-input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.form-input--date {
  width: auto;
}

/* ===========================
   ボタン
   =========================== */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  text-decoration: none;
}

.btn--primary {
  background: #4a90d9;
  color: #fff;
}
.btn--primary:hover {
  background: #357abd;
  text-decoration: none;
}

.btn--outline {
  background: #fff;
  color: #4a90d9;
  border: 1px solid #4a90d9;
}
.btn--outline:hover {
  background: #e8f0fe;
  text-decoration: none;
}

.btn--full {
  display: block;
  width: 100%;
}

/* ===========================
   アラート
   =========================== */
.alert {
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert--error {
  background: #f8d7da;
  color: #721c24;
}

.alert--success {
  background: #d4edda;
  color: #155724;
}

/* ===========================
   画像モーダル
   =========================== */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.image-modal__content {
  position: relative;
  z-index: 1;
}

.image-modal__content img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
}

.image-modal__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===========================
   レスポンシブ
   =========================== */
@media (max-width: 768px) {
  .header__inner {
    flex-direction: column;
    height: auto;
    padding: 12px 0;
    gap: 8px;
  }

  .header__nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card__value {
    font-size: 22px;
  }

  .search-form__row {
    flex-direction: column;
  }

  .form-input--date {
    width: 100%;
  }

  .main {
    padding: 0 12px;
  }
}
