/* =========================================================
   オリパ表（oripacode-1.html）専用スタイル
   ※style2.cssの本文色を邪魔しないように修正
========================================================= */

/* ラッパー・検索 */
.oripa-wrapper {
  font-family: sans-serif;
  max-width: 100%;
}

.oripa-note {
  margin-bottom: 8px;
  color: #c9a227;
  font-size: 14px;
}

#tableSearch {
  padding: 8px 12px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  border: 1px solid #8b6914;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
  background: #1a0a0a;
  color: #e8d9b0;
}

#tableSearch::placeholder {
  color: #8b6914;
}

/* 横スクロール枠 */
.table-container,
.mobile-scroll,
.table-wrap,
#main .table-scroll {
  width: 100%;
  overflow-x: auto;
  max-width: 100%;
  margin: 15px 0 20px;
  border: 1px solid #8b6914;
  border-radius: 6px;
  background: rgba(20, 10, 10, 0.9);
  box-shadow: 0 0 12px rgba(139, 0, 0, 0.3);
}

/* 表本体 */
#oripaTable,
#oripa-table,
table.oripa-table {
  min-width: 1000px;
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 14px;
  color: #e8d9b0;
  background: rgba(20, 10, 10, 0.95);
  margin: 0;
}

#oripaTable th,
#oripa-table th,
table.oripa-table th {
  background: #5c1010 !important;
  color: #e8c547 !important;
  font-weight: bold;
  padding: 10px 12px;
  padding-bottom: 28px !important;
  text-align: left;
  border: 1px solid #8b6914 !important;
  position: relative;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

#oripaTable th:hover,
#oripa-table th:hover {
  background: #8b0000 !important;
  color: #fff0a0 !important;
}

#oripaTable td,
#oripa-table td {
  padding: 8px 12px;
  border: 1px solid #8b6914 !important;
  background: rgba(20, 10, 10, 0.85) !important;
  color: #e8d9b0 !important;
  vertical-align: middle;
}

#oripaTable tbody tr:nth-child(odd) td,
#oripa-table tbody tr:nth-child(odd) td {
  background: rgba(20, 10, 10, 0.85) !important;
}

#oripaTable tbody tr:nth-child(even) td,
#oripa-table tbody tr:nth-child(even) td {
  background: rgba(30, 12, 12, 0.9) !important;
}

#oripaTable tbody tr:hover td,
#oripa-table tbody tr:hover td {
  background: rgba(60, 20, 20, 0.95) !important;
  color: #e8c547 !important;
}

#oripaTable a,
#oripa-table a {
  color: #e8c547 !important;
  text-decoration: none;
}

#oripaTable a:hover,
#oripa-table a:hover {
  color: #fff0a0 !important;
  text-decoration: underline;
}

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

/* ソートマーク */
#oripaTable th.sortable::after,
#oripaStickyHead th.sortable::after {
  content: "⇅";
  font-size: 11px;
  color: #c9a227;
  font-weight: normal;
  margin-left: 4px;
}

#oripaTable th.sorted-asc::after,
#oripaStickyHead th.sorted-asc::after {
  content: " ▲";
  font-size: 11px;
  color: #e8c547;
}

#oripaTable th.sorted-desc::after,
#oripaStickyHead th.sorted-desc::after {
  content: " ▼";
  font-size: 11px;
  color: #e8c547;
}

#oripaTable th.sortable:hover::after {
  color: #e8c547;
}

/* 固定ヘッダー */
#oripaStickyHead {
  position: fixed;
  top: 0;
  z-index: 1000;
  display: none;
  overflow: hidden;
  background: #5c1010;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  border: 1px solid #8b6914;
  box-sizing: border-box;
}

#oripaStickyHead table {
  border-collapse: collapse;
  white-space: nowrap;
  margin: 0;
  font-size: 14px;
}

#oripaStickyHead th {
  background: #5c1010 !important;
  color: #e8c547 !important;
  font-weight: bold;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid #8b6914 !important;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
}

#oripaStickyHead .col-move-btns {
  display: none !important;
}

#oripaStickyHead table.size-s { font-size: 11px; }
#oripaStickyHead table.size-s th { padding: 5px 7px; font-size: 11px; }
#oripaStickyHead table.size-m { font-size: 14px; }
#oripaStickyHead table.size-m th { padding: 10px 12px; font-size: 14px; }
#oripaStickyHead table.size-l { font-size: 16px; }
#oripaStickyHead table.size-l th { padding: 12px 14px; font-size: 16px; }

/* コピー可能セル */
.copyable {
  cursor: pointer;
  position: relative;
  padding-right: 28px !important;
}

.copyable::after {
  content: "📋";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  opacity: 0.6;
}

.copyable:hover::after {
  opacity: 1;
}

.copyable.copied::after {
  content: "✅";
}

#copyToast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: #3a0a0a;
  color: #e8c547;
  border: 1px solid #8b6914;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 9999;
}

#copyToast.show {
  opacity: 1;
}

/* 列移動ボタン */
.col-move-btns {
  display: flex;
  gap: 4px;
  position: absolute;
  left: 8px;
  bottom: 4px;
}

.col-move-btns button {
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  border: 1px solid #8b6914;
  border-radius: 4px;
  background: #3a0a0a;
  color: #e8d9b0;
  cursor: pointer;
}

.col-move-btns button:hover {
  background: #5c1010;
  border-color: #e8c547;
  color: #e8c547;
}

.col-move-btns button:disabled {
  opacity: 0.3;
  cursor: default;
}

/* サイズボタン */
.size-btn {
  padding: 4px 12px;
  margin-right: 4px;
  border: 1px solid #8b6914;
  border-radius: 6px;
  background: #3a0a0a;
  color: #e8d9b0;
  font-size: 13px;
  cursor: pointer;
}

.size-btn:hover {
  background: #5c1010;
  border-color: #e8c547;
  color: #e8c547;
}

.size-btn.is-active {
  background: #5c1010;
  border-color: #e8c547;
  color: #e8c547;
}

/* 表サイズ段階 */
#oripaTable.size-s,
#oripa-table.size-s {
  font-size: 11px;
  min-width: 800px;
}
#oripaTable.size-s th,
#oripa-table.size-s th {
  padding: 5px 7px;
  font-size: 11px;
}
#oripaTable.size-s td,
#oripa-table.size-s td {
  padding: 4px 7px;
  font-size: 11px;
}
#oripaTable.size-s .col-move-btns button {
  font-size: 9px;
  padding: 1px 4px;
}

#oripaTable.size-m,
#oripa-table.size-m {
  font-size: 14px;
}
#oripaTable.size-m th,
#oripa-table.size-m th {
  padding: 10px 12px;
  font-size: 14px;
}
#oripaTable.size-m td,
#oripa-table.size-m td {
  padding: 8px 12px;
  font-size: 14px;
}

#oripaTable.size-l,
#oripa-table.size-l {
  font-size: 16px;
  min-width: 1100px;
}
#oripaTable.size-l th,
#oripa-table.size-l th {
  padding: 12px 14px;
  font-size: 16px;
}
#oripaTable.size-l td,
#oripa-table.size-l td {
  padding: 10px 14px;
  font-size: 16px;
}

/* 表コントロール・フィルター */
.table-controls,
.table-size,
.filter-btns {
  margin-bottom: 12px;
  color: #c9a227;
}

.table-controls button,
.table-controls a,
.table-size button,
.filter-btns button {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 4px 12px;
  background: #3a0a0a;
  border: 1px solid #8b6914;
  border-radius: 4px;
  color: #e8d9b0 !important;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}

.table-controls button:hover,
.table-controls a:hover,
.table-size button:hover,
.filter-btns button:hover,
.table-controls .active,
.table-size .active {
  background: #5c1010 !important;
  color: #e8c547 !important;
  border-color: #e8c547;
}

/* サービス終了行を薄く */
table tr.closed td,
table tr.ended td,
#oripaTable tr.closed td,
#oripa-table tr.closed td {
  opacity: 0.55;
  background: rgba(40, 10, 10, 0.7) !important;
}

/* DataTables 使用時の上書き */
.dataTables_wrapper,
.dataTables_filter,
.dataTables_info,
.dataTables_length,
.dataTables_paginate {
  color: #e8d9b0 !important;
  margin: 8px 0;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #e8c547 !important;
  background: #3a0a0a !important;
  border: 1px solid #8b6914 !important;
  border-radius: 3px;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #5c1010 !important;
  color: #e8c547 !important;
  border-color: #e8c547 !important;
}

.dataTables_filter input,
.dataTables_length select {
  background: #1a0a0a !important;
  border: 1px solid #8b6914 !important;
  color: #e8d9b0 !important;
  border-radius: 4px;
  padding: 4px 8px;
}

/* スマホ対応 */
@media screen and (max-width: 900px) {
  #oripaTable,
  #oripa-table {
    font-size: 12px;
  }
  #oripaTable th,
  #oripaTable td,
  #oripa-table th,
  #oripa-table td {
    padding: 5px 6px;
  }
}

/* 表サイズコントロール（本文色には触らない） */
.table-size-controls,
.table-controls {
  color: #c9a227;
}

.table-size-controls span,
.table-size-controls a,
.table-size-controls button,
[onclick*="size"],
[onclick*="Size"] {
  color: #e8d9b0 !important;
  background: #3d1010;
  border: 1px solid #a67c1a;
  padding: 3px 8px;
  margin: 0 3px;
  border-radius: 3px;
  cursor: pointer;
}

.table-size-controls span:hover,
.table-size-controls a:hover,
.table-size-controls button:hover {
  background: #5e1515;
  color: #e8c547 !important;
  border-color: #e8c547;
}

.table-controls,
.table-size {
  margin-bottom: 12px;
  color: #c9a227;
  font-size: 14px;
}

.table-size::before {
  content: "表サイズ：";
  color: #c9a227;
  margin-right: 6px;
}

.size-btn.is-active {
  background: #8b1a1a !important;
  border-color: #e8c547 !important;
  color: #e8c547 !important;
  box-shadow: 0 0 8px rgba(232, 197, 71, 0.3);
}

.oripa-wrapper {
  font-family: sans-serif;
  max-width: 100%;
}

#oripaTable th,
#oripa-table th,
table.oripa-table th,
#oripaStickyHead th {
  font-family: sans-serif !important;
}