/* Simple Ranking Table Styles - my-best.com style */

/* 固定列テーブルの基本設定 */
.table-fixed-wrapper {
    position: relative;
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #ddd;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.table-fixed-wrapper p:empty {
    display: none;
}

/* テーブル本体 */
.table-fixed-wrapper table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 0 !important;
    min-width: 1200px !important;
    width: auto !important;
    background: #fff !important;
    table-layout: auto !important;
    border: none !important;
}

/* ヘッダー行 */
.table-fixed-wrapper table thead tr {
    background: #f8f9fa;
}

.table-fixed-wrapper table th {
    padding: 6px 4px !important;
    border-right: 1px solid #ddd !important;
    border-bottom: 1px solid #ddd !important;
    background: #f8f9fa !important;
    font-weight: 600 !important;
    font-size: 0.7rem !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
    position: relative !important;
    line-height: 1.1 !important;
}

/* データ行 */
.table-fixed-wrapper table tbody tr {
    background: #fff;
}

.table-fixed-wrapper table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.table-fixed-wrapper table td {
    padding: 6px 4px !important;
    border-right: 1px solid #ddd !important;
    border-bottom: 1px solid #ddd !important;
    text-align: center !important;
    vertical-align: middle !important;
    background: inherit !important;
    position: relative !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
}

/* 動的固定列CSS（PHPで生成される）のため、列固定CSSは削除 */

/* すべての列の基本幅設定 */
.table-fixed-wrapper table th,
.table-fixed-wrapper table td {
    width: 72px !important;
    min-width: 72px !important;
}

/* 1列目（順位）の基本幅 */
.table-fixed-wrapper table th:nth-child(1),
.table-fixed-wrapper table td:nth-child(1) {
    width: 48px !important;
    min-width: 48px !important;
}

/* 2列目（商品名）の基本幅 */
.table-fixed-wrapper table th:nth-child(2),
.table-fixed-wrapper table td:nth-child(2) {
    width: 154px !important;
    min-width: 154px !important;
    text-align: left !important;
}

/* 最後の列のボーダーを削除 */
.table-fixed-wrapper table th:last-child,
.table-fixed-wrapper table td:last-child {
    border-right: none !important;
}

/* ホバー効果 */
.table-fixed-wrapper table tbody tr:hover {
    background: #e3f2fd !important;
}

.table-fixed-wrapper table tbody tr:hover td:nth-child(1),
.table-fixed-wrapper table tbody tr:hover td:nth-child(2) {
    background: #e3f2fd !important;
}

/* WordPress figure要素の調整 */
figure.wp-block-table {
    overflow: visible !important;
    margin: 0 !important;
}

figure.wp-block-table .table-fixed-wrapper {
    margin: 0 !important;
}


/* ショートコード要素のスタイル */
.rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.rating .stars {
    display: flex;
    gap: 1px;
}

.star {
    font-size: 1rem;
    line-height: 1;
}

.star-full {
    color: #ffd700;
}

.star-half {
    background: linear-gradient(90deg, #ffd700 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.star-empty {
    color: #ddd;
}

.rating-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.scores {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: left;
    min-width: 120px;
}

.score-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    padding: 0.125rem 0;
}

.score-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
}

.score-value {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
}

.features {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left;
}

.features li {
    list-style: none !important;
    padding: 0.125rem 0;
    font-size: 0.8rem;
    position: relative;
    padding-left: 0.75rem;
    margin: 0 !important;
}

.features-check {
    list-style: none !important;
}

.features-check li {
    list-style: none !important;
}

.features-check li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
}

.price-currency {
    font-size: 0.8em;
    color: #666;
}

.price-value {
    font-weight: 700;
    color: #dc3545;
}

.price-unit {
    font-size: 0.8em;
    color: #666;
}

.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: bold;
}

.rank-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    margin: 0.125rem;
}

.badge-green {
    background-color: #28a745;
    color: white;
}

.badge-red {
    background-color: #dc3545;
    color: white;
}

.badge-blue {
    background-color: #007bff;
    color: white;
}

.badge-yellow {
    background-color: #ffc107;
    color: #212529;
}

.badge-gray {
    background-color: #6c757d;
    color: white;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .table-fixed-wrapper {
        margin: 1rem -1rem;
        border-left: none;
        border-right: none;
    }
    
    .table-fixed-wrapper table th,
    .table-fixed-wrapper table td {
        padding: 6px 4px !important;
        font-size: 0.7rem;
    }
}