/* css/list_views.css */
/* Common styles for master setting pages with a list/table view */

.list-view-main {
    padding: 1.5rem;
    width: 100%;
    flex-grow: 1;
}

.list-view-card {
    position: relative;
    /* The .card class from style.css provides base styling */
}

.list-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.list-view-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}


/* Position the "Add New" button at the top right of the card */
.add-item-btn {
    /* position: absolute; を削除または上書き */
    position: static;
}

.list-table-container {
    /* テーブルが横に長い場合にスクロールできるようにする */
    overflow-x: auto;
    margin-top: 1rem; /* Add some space below the title/add button */
}

/* ドロップダウンメニューのスタイル */
.dropdown-item {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #374151;
    text-decoration: none;
}
.dropdown-item:hover {
    background-color: #f3f4f6;
    color: #1d4ed8;
}

.list-table {
    /* テーブルの最小幅を設定し、内容が詰まりすぎないようにする */
    min-width: 800px;
    width: 100%;
    border-collapse: collapse; /* Use collapse for cleaner borders */
}

.list-table thead {
    background-color: #f8fafc; /* Lighter than the old gray */
}

.list-table th,
.list-table td {
    padding: 0.75rem 1rem; /* Consistent padding */
    text-align: left;
    border-bottom: 1px solid #e2e8f0; /* Lighter border */
    white-space: nowrap; /* Prevent wrapping by default */
}

.list-table th {
    font-weight: 600;
    color: #475569;
}

/* --- ソート機能付きテーブルヘッダーのスタイル --- */
.list-table th.sortable {
    position: relative;
    padding-left: 24px; /* アイコン用のスペース */
    cursor: pointer;
    user-select: none; /* テキスト選択を防ぐ */
}

.list-table th.sortable::before,
.list-table th.sortable::after {
    position: absolute;
    left: 8px;
    font-size: 0.8em;
    color: #cbd5e1; /* 未選択時の色 (薄いグレー) */
    transition: color 0.2s ease;
}

.list-table th.sortable::before {
    content: '▲';
    top: 50%;
    transform: translateY(-50%) translateY(-4px); /* 中央から少し上に配置 */
}

.list-table th.sortable::after {
    content: '▼';
    bottom: 50%;
    transform: translateY(50%) translateY(4px); /* 中央から少し下に配置 */
}

.list-table th.sortable.sort-asc::before { color: #3b82f6; /* 昇順ソート時の色 (青) */ }
.list-table th.sortable.sort-desc::after { color: #3b82f6; /* 降順ソート時の色 (青) */ }

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

.list-table .wrap-text {
    white-space: pre-wrap;
    word-break: break-all;
}

/* ★追加: 無効なアイテムのスタイル */
.list-table .inactive-item {
    background-color: #fef2f2; /* 薄い赤 */
    color: #9ca3af; /* 薄いグレー */
}

.list-table .empty-message td,
.list-table .error-message td {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}