/* QA Table CSS - デザインガイドライン準拠 */
.qa-table-container {
    margin-bottom: 20px;
    font-family: var(--font-sans);
}

/* Table container with max-height */
.qa-table-main-container {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

/* Scroll container for just the table */
.qa-table-scroll-container {
    width: 100%;
    overflow: auto;
}

.qa-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.qa-table th, 
.qa-table td {
    padding: 10px;
    border: 1px solid var(--gray-30);
	overflow-wrap: break-word;
	word-wrap: break-word;
	word-break: break-all;
}

.qa-table th {
    background-color: var(--gray-10);
    font-weight: bold;
    cursor: pointer;
    position: relative;
}

.qa-table th.qa-not-sortable,
.qa-table th.qa-select-column {
    cursor: not-allowed;
}

.qa-table th:hover {
    background-color: var(--gray-20);
}

/* Remove alternating row colors as requested */
.qa-table tbody tr {
    background-color: #fff;
}

.qa-table tbody tr:hover {
    background-color: var(--gray-10);
}

/* Pagination */
.qa-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
}

.qa-pagination-info {
    font-size: 14px;
    color: var(--gray);
}

.qa-pagination-controls {
    display: flex;
    align-items: center;
}

.qa-pagination button {
    margin: 0 5px;
    padding: 5px 10px;
    border: 1px solid var(--gray-30);
    background-color: #fff;
    color: var(--text); /* Ensure text is visible */
    cursor: pointer;
    border-radius: 3px;
}

.qa-pagination button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.qa-pagination button:hover:not(.active):not(:disabled) {
    background-color: var(--gray-10);
}

/* Prevent hover color change on disabled buttons */
.qa-pagination button:disabled:hover {
    background-color: #fff;
}

.qa-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--gray); /* Ensure disabled text is still visible */
}

.qa-pagination-ellipsis {
    display: inline-block;
    padding: 5px 8px;
    color: var(--gray);
}

/* Option */
.qa-table-option-container {
    display: flex;
    align-items: flex-end;
	margin-bottom: 24px;
}

/* Filtering */
.qa-filter-container {
    background-color: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 0;
    border: 1px solid var(--gray-30);
}

.qa-filter-title {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    color: var(--text);
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qa-filter-title::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000000'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.qa-filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.qa-filter-column,
.qa-filter-type,
.qa-filter-value {
    padding: 8px 12px;
    border: 1px solid var(--gray-30);
    border-radius: 8px;
    font-size: 14px;
    background-color: #fff;
}

.qa-filter-column {
    min-width: 140px;
}

.qa-filter-type {
    min-width: 100px;
}

.qa-filter-value {
    min-width: 200px;
    flex: 1;
}

.qa-filter-add,
.qa-filter-clear {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.qa-filter-add {
    background-color: var(--primary);
    color: white;
}

.qa-filter-add:hover {
    box-shadow: none;
    transform: translateY(4px);
    opacity: 0.5;
}

.qa-filter-clear {
    background-color: var(--gray);
    color: white;
}

.qa-filter-clear:hover {
    box-shadow: none;
    transform: translateY(4px);
    opacity: 0.5;
}

/* Active filters */
.qa-filter-list {
    margin-top: 12px;
}

.qa-filter-empty {
    color: var(--gray);
    font-style: normal;
    font-size: 14px;
}

.qa-filters-title {
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text);
}

.qa-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qa-filter-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e6f3ff;
    border: 1px solid #b3d7ff;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 13px;
}

.qa-filter-text {
    margin-right: 5px;
}

.qa-filter-remove {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-weight: bold;
    padding: 0 4px;
    font-size: 14px;
}

.qa-filter-remove:hover {
    color: var(--accent);
}

/* Separator between filter and table */
.qa-table-separator {
    background-color: var(--primary-10);
    height: 16px;
    margin: 16px -16px;
}

/* Table action bar (select all + export) */
.qa-table-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 16px 16px;
    margin: 0 -16px;
    background-color: var(--gray-10);
    border-radius: 0 0 8px 8px;
}

.qa-select-all-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qa-select-all-container label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.qa-select-all-container input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* Export buttons */
.qa-export-container {
	margin-left: auto;
}

.qa-export-button {
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qa-export-csv {
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.qa-export-csv::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23005197'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.qa-export-csv:hover {
    box-shadow: none;
    transform: translateY(4px);
    opacity: 0.5;
}

.qa-export-json {
    display: none;
}

/* Row selection */
.qa-select-column {
    width: 30px;
}

.qa-select-cell {
    text-align: center;
}

.qa-row-select,
.qa-select-all {
    cursor: pointer;
}

/* Cell with checkbox */
.qa-cell-with-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qa-row-select {
    margin: 0;
}

/* Disabled checkboxes */
.qa-row-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty message */
.qa-empty-message {
    text-align: center;
    padding: 20px;
    color: var(--gray);
    font-style: italic;
}

/* Sort icons */
.qa-sort-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.qa-sort-icon {
    margin-left: 5px;
    font-size: 10px;
    position: relative;
}

.qa-sort-icon[data-sort-index]:after {
    content: attr(data-sort-index);
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 8px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qa-sort-asc {
    color: var(--primary);
}

.qa-sort-desc {
    color: var(--primary);
}

/* Column type specific styles */
.qa-column-number,
.qa-column-integer,
.qa-column-float,
.qa-column-currency,
.qa-column-percentage {
    text-align: right;
}

.qa-column-duration {
	text-align: center;
}

.qa-column-date,
.qa-column-datetime {
    white-space: nowrap;
    text-align: right;
}

.qa-column-boolean {
    text-align: center;
}

.qa-table-main-container {
    position: relative;
}

/* 空データ表示のスタイル */
.qa-empty-message {
    padding: 0;
    text-align: center;
    width: 100%; /* 幅を100%に設定 */
    height: 100%; /* 高さを100%に設定 */
    display: table-cell;
    vertical-align: middle;
}

.qa-no-data-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.qa-no-data-icon {
    margin-bottom: 15px;
    color: var(--gray);
}

.qa-no-data-text {
    font-size: 16px;
    color: var(--gray);
    font-weight: bold;
}

/* テーブルの高さ設定用 */
.qa-table-main-container {
    position: relative;
    transition: opacity 0.3s ease;
}

/* ローディング中のテーブル表示 */
.qa-table-container {
    position: relative;
}

/* Ensure table maintains column widths during loading */
.qa-table {
    table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
}

/* CSS rules for icon column removed as per user feedback */

/* Add underlines to links in table */
.qa-table a {
    text-decoration: underline;
}

/* Link column styling */
.qa-column-link {
    color: var(--primary);
}

/* Loading */
.qa-table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none; /* Allow clicks to pass through */
}

.qa-table-loading-overlay.qa-hidden {
    opacity: 0;
    pointer-events: none;
}

.qa-table-loading-icon-wrap {
	position: absolute;
	top: 280px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 20px;
}

/*
上下左右中央配置
.qa-table-loading-icon-wrap {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 20px;
}
*/

.qa-table-loading-icon-text {
	color: var(--gray);
	display: inline-block;
	width: 170px;
	margin-left: 8px;
}

.qa-table-loading-icon-text::after {
	content: "";
	display: inline-block;
	width: 30px;
	margin-left: 6px;
	text-align: left;
	animation: loadingDots 1.8s steps(1, end) infinite;
}

@keyframes loadingDots {
	0%, 33.33% {
		content: ".";
	}
	33.34%, 66.66% {
		content: "..";
	}
	66.67%, 100% {
		content: "...";
	}
}

.qa-table-loading-icon-bounceball {
	position: relative;
	display: inline-block;
	height: 35px;
	width: 15px;
	margin-right: 5px;
	&:before {
		position: absolute;
		content: '';
		display: block;
		top: 0;
		width: 15px;
		height: 15px;
		border-radius: 50%;
		background-color: var(--gray);
		transform-origin: 50%;
		animation: bounce 500ms alternate infinite ease;
	}
}

@keyframes bounce {
	0% {
		top: 30px;
		height: 5px;
		border-radius: 60px 60px 20px 20px;
		transform: scaleX(2);
	}
	35% {
		height: 15px;
		border-radius: 50%;
		transform: scaleX(1);
	}
	100% {
		top: 0;
	}
}