/**
 * エントリーリスト CSS
 */

/* ===================================================================
 リセットcss
=================================================================== */

.cmn_entrylist .cmn_ttl-l_left {
    position: relative;
    width: auto !important;
}

/* ===================================================================
 コンテナ
=================================================================== */

.cmn_page_ttl {
    background-image:URL(/img/entrylist/page_ttl_bg.jpg);
}

.cmn_entrylist .inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    
}

/* ===================================================================
 検索ボックス
=================================================================== */

.entrylist_search {
    display: flex;
    gap: 10px;
    margin: 30px 0 20px;
}

.entrylist_search input {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
    color: #ccc;
    background: #373737;
    border: 2px solid #555;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.entrylist_search input:focus {
    outline: none;
    border-color: #495fa5;
    background: #444;
}

.entrylist_search input::placeholder {
    color: #999;
}

.entrylist_search input::-webkit-input-placeholder {
    color: #999;
}

.entrylist_search input:-moz-placeholder {
    color: #999;
    opacity: 1;
}

.entrylist_search input::-moz-placeholder {
    color: #999;
    opacity: 1;
}

.entrylist_search input:-ms-input-placeholder {
    color: #999;
}

.entrylist_search .cmn_btn {
    padding: 12px 28px;
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: #495fa5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.entrylist_search .cmn_btn:hover {
    background: #596fb3;
}

.entrylist_search .cmn_btn:active {
    transform: translateY(1px);
}

.entrylist_search .btn_secondary {
    background: #666;
}

.entrylist_search .btn_secondary:hover {
    background: #777;
}

/* ===================================================================
 件数表示
=================================================================== */

.entrylist_info {
    margin-bottom: 20px;
    padding: 12px 20px;
    font-size: 14px;
    color: #999;
    background: #262626;
    border-left: 4px solid #495fa5;
    border-radius: 2px;
}

#entrylistTotal {
    font-weight: bold;
    color: #ccc;
}

#entrylistFiltered {
    margin-left: 15px;
    color: #495fa5;
    font-weight: bold;
}

/* ===================================================================
 テーブルラッパー
=================================================================== */

.entrylist_table_wrap {
    overflow-x: auto;
    margin-bottom: 30px;
    background: #1a1a1a;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===================================================================
 テーブル
=================================================================== */

#entrylistTable {
    width: 100%;
    border-collapse: collapse;
    background: #262626;
}

#entrylistTable thead {
    background: #333;
    border-bottom: 3px solid #495fa5;
}

#entrylistTable th {
    padding: 18px 20px;
    text-align: left;
    font-weight: bold;
    font-size: 15px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: normal;
    word-break: break-word;
    user-select: none;
    box-sizing: border-box;
    vertical-align: middle;
    line-height: 1.4;
}

#entrylistTable th.sortable {
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

#entrylistTable th.sortable:hover {
    background: #3d3d3d;
    color: #495fa5;
}

#entrylistTable th.sortable:active {
    background: #444;
}

.sort_icon {
    margin-left: 8px;
    color: #666;
    font-size: 14px;
    display: inline-block;
    transition: color 0.2s ease;
}

#entrylistTable th.sortable:hover .sort_icon {
    color: #495fa5;
}

#entrylistTable tbody tr {
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
}

#entrylistTable tbody tr:hover {
    background: #2d2d2d;
}

#entrylistTable tbody tr:last-child {
    border-bottom: none;
}

#entrylistTable td {
    padding: 16px 20px;
    color: #ccc;
    font-size: 15px;
    line-height: 1.6;
    /* 追加 */
    box-sizing: border-box;
    vertical-align: top;
}

#entrylistTable td:first-child {
    font-weight: 500;
}

#entrylistTable tbody tr:nth-child(even) {
    background: #242424;
}

#entrylistTable tbody tr:nth-child(even):hover {
    background: #2d2d2d;
}

/* ===================================================================
 特殊セル
=================================================================== */

.loading,
.error,
.no_data {
    text-align: center !important;
    padding: 60px 20px !important;
    color: #666;
    font-style: italic;
    font-size: 16px;
}

.loading {
    position: relative;
}

.loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 0 auto 20px;
    border: 3px solid #333;
    border-top-color: #495fa5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.error {
    color: #cf443a;
    background: #2a1a1a;
}

.no_data {
    color: #999;
}

/* ===================================================================
 カラム幅の調整
=================================================================== */

/* No列 - 狭く */
#entrylistTable th.sort_no_col,
#entrylistTable td.sort_no_col {
    width: 60px;
    text-align: center;
    padding: 12px 8px;
    white-space: normal;
    word-break: break-word;
}

/* ライセンスID列 - 標準 */
#entrylistTable th.license_id_col,
#entrylistTable td.license_id_col {
    width: 120px;
    text-align: center;
    padding: 12px 10px;
    white-space: normal;
    word-break: break-word;
}

/* 名前列 - 広く */
#entrylistTable th[data-sort="name"],
#entrylistTable td:nth-child(3) {
    width: 35%;
    min-width: 200px;
    padding: 12px 12px;
    white-space: normal;
    word-break: break-word;
}

/* 国籍列 - 標準 */
#entrylistTable th[data-sort="country"],
#entrylistTable td:nth-child(4) {
    width: 120px;
    padding: 12px 10px;
    white-space: normal;
    word-break: break-word;
}

/* 年間ランキング列 - 狭く */
#entrylistTable th.ranking_col,
#entrylistTable td.ranking_col {
    width: 100px;
    text-align: center;
    padding: 12px 8px;
    white-space: normal;
    word-break: break-word;
}

/* ===================================================================
 テーブル全体の設定
=================================================================== */

/* すべてのセルで折り返しを許可 */
#entrylistTable th,
#entrylistTable td {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    vertical-align: middle;
    line-height: 1.5;
}

/* ===================================================================
 レスポンシブ対応（スマートフォン）でのカラム幅調整
=================================================================== */

@media screen and (max-width: 768px) {
    /* テーブル全体を%ベースに変更 */
    #entrylistTable {
        table-layout: fixed;
        width: 100%;
    }
    
    /* すべてのセル */
    #entrylistTable th,
    #entrylistTable td {
        padding: 10px 5px;
        font-size: 12px;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.4;
    }
    
    /* No列 - 7% */
    #entrylistTable th.sort_no_col,
    #entrylistTable td.sort_no_col {
        width: 7%;
        padding: 10px 3px;
        font-size: 11px;
    }
    
    /* ライセンスID列 - 16% */
    #entrylistTable th.license_id_col,
    #entrylistTable td.license_id_col {
        width: 16%;
        padding: 10px 4px;
        font-size: 11px;
    }
    
    /* 名前列 - 42% (広め) */
    #entrylistTable th[data-sort="name"],
    #entrylistTable td:nth-child(3) {
        width: 42%;
        min-width: auto;
        padding: 10px 6px;
    }
    
    /* 国籍列 - 15% */
    #entrylistTable th[data-sort="country"],
    #entrylistTable td:nth-child(4) {
        width: 15%;
        padding: 10px 4px;
    }
    
    /* 年間ランキング列 - 20% */
    #entrylistTable th.ranking_col,
    #entrylistTable td.ranking_col {
        width: 20%;
        padding: 10px 3px;
        font-size: 11px;
    }
}

@media screen and (max-width: 480px) {
    /* 超小型デバイス用のさらなる調整 */
    
    #entrylistTable th,
    #entrylistTable td {
        padding: 8px 3px;
        font-size: 11px;
        line-height: 1.3;
    }
    
    /* No列 - 6% */
    #entrylistTable th.sort_no_col,
    #entrylistTable td.sort_no_col {
        width: 6%;
        padding: 8px 2px;
        font-size: 10px;
    }
    
    /* ライセンスID列 - 15% */
    #entrylistTable th.license_id_col,
    #entrylistTable td.license_id_col {
        width: 15%;
        padding: 8px 3px;
        font-size: 10px;
    }
    
    /* 名前列 - 46% (さらに広く) */
    #entrylistTable th[data-sort="name"],
    #entrylistTable td:nth-child(3) {
        width: 46%;
        padding: 8px 5px;
    }
    
    /* 国籍列 - 14% */
    #entrylistTable th[data-sort="country"],
    #entrylistTable td:nth-child(4) {
        width: 14%;
        padding: 8px 3px;
        font-size: 10px;
    }
    
    /* 年間ランキング列 - 19% */
    #entrylistTable th.ranking_col,
    #entrylistTable td.ranking_col {
        width: 19%;
        padding: 8px 2px;
        font-size: 10px;
    }
}

/* ===================================================================
 年間ランキング列の動的表示/非表示
=================================================================== */

/* デフォルトで年間ランキング列を表示 */
#entrylistTable th.ranking_col,
#entrylistTable td.ranking_col {
    display: table-cell;
}

/* data-show-ranking="false" の時だけ非表示 */
.cmn_entrylist[data-show-ranking="false"] #entrylistTable th.ranking_col,
.cmn_entrylist[data-show-ranking="false"] #entrylistTable td.ranking_col {
    display: none !important;
}

/* 年間ランキング非表示時のカラム幅調整（PC） */
.cmn_entrylist[data-show-ranking="false"] #entrylistTable th.sort_no_col,
.cmn_entrylist[data-show-ranking="false"] #entrylistTable td.sort_no_col {
    width: 70px;
}

.cmn_entrylist[data-show-ranking="false"] #entrylistTable th.license_id_col,
.cmn_entrylist[data-show-ranking="false"] #entrylistTable td.license_id_col {
    width: 140px;
}

.cmn_entrylist[data-show-ranking="false"] #entrylistTable th[data-sort="name"],
.cmn_entrylist[data-show-ranking="false"] #entrylistTable td:nth-child(3) {
    width: 45%;
}

.cmn_entrylist[data-show-ranking="false"] #entrylistTable th[data-sort="country"],
.cmn_entrylist[data-show-ranking="false"] #entrylistTable td:nth-child(4) {
    width: 150px;
}

/* スマホ表示時 */
@media screen and (max-width: 768px) {
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th.sort_no_col,
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td.sort_no_col {
        width: 8%;
    }
    
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th.license_id_col,
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td.license_id_col {
        width: 18%;
    }
    
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th[data-sort="name"],
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td:nth-child(3) {
        width: 52%;
    }
    
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th[data-sort="country"],
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td:nth-child(4) {
        width: 22%;
    }
}

@media screen and (max-width: 480px) {
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th.sort_no_col,
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td.sort_no_col {
        width: 7%;
    }
    
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th.license_id_col,
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td.license_id_col {
        width: 16%;
    }
    
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th[data-sort="name"],
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td:nth-child(3) {
        width: 55%;
    }
    
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable th[data-sort="country"],
    .cmn_entrylist[data-show-ranking="false"] #entrylistTable td:nth-child(4) {
        width: 22%;
    }
}

/* ===================================================================
 ページネーション
=================================================================== */

.entrylist_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 40px 0;
    padding: 20px;
    background: #1a1a1a;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.entrylist_pagination .cmn_btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: bold;
    color: #fff;
    background: #495fa5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.entrylist_pagination .cmn_btn:hover:not(:disabled) {
    background: #596fb3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(73, 95, 165, 0.3);
}

.entrylist_pagination .cmn_btn:active:not(:disabled) {
    transform: translateY(0);
}

.entrylist_pagination .cmn_btn:disabled {
    background: #444;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

#entrylistPageInfo {
    font-size: 15px;
    color: #ccc;
    font-weight: 500;
    padding: 0 10px;
    min-width: 200px;
    text-align: center;
}

/* ===================================================================
 レスポンシブ対応（タブレット）
=================================================================== */

@media screen and (max-width: 1024px) {
    .cmn_entrylist .inner {
        padding: 0 15px;
        left: 0;
    }
    
    #entrylistTable th,
    #entrylistTable td {
        padding: 14px 15px;
        font-size: 14px;
    }
}

/* ===================================================================
 レスポンシブ対応（スマートフォン）
=================================================================== */

@media screen and (max-width: 768px) {
    .cmn_entrylist .inner {
        padding: 0 10px;
        left: 0;
    }
    
    /* 検索ボックス */
    .entrylist_search {
        flex-direction: column;
        gap: 8px;
        margin: 20px 0 15px;
    }
    
    .entrylist_search input {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .entrylist_search .cmn_btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* 件数表示 */
    .entrylist_info {
        margin-bottom: 15px;
        padding: 10px 15px;
        font-size: 13px;
    }
    
    #entrylistFiltered {
        display: block;
        margin-left: 0;
        margin-top: 5px;
    }
    
    /* テーブル */
    .entrylist_table_wrap {
        margin-bottom: 20px;
        border-radius: 2px;
    }
    
    #entrylistTable th {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    #entrylistTable td {
        padding: 12px 10px;
        font-size: 14px;
    }
    
    .sort_icon {
        font-size: 12px;
    }
    
    /* 特殊セル */
    .loading,
    .error,
    .no_data {
        padding: 40px 15px !important;
        font-size: 14px;
    }
    
    .loading::before {
        width: 32px;
        height: 32px;
        margin-bottom: 15px;
    }
    
    /* ページネーション */
    .entrylist_pagination {
        flex-wrap: wrap;
        gap: 12px;
        margin: 25px 0;
        padding: 15px 10px;
    }
    
    .entrylist_pagination .cmn_btn {
        flex: 1;
        min-width: 100px;
        padding: 10px 16px;
        font-size: 13px;
    }
    
    #entrylistPageInfo {
        width: 100%;
        order: -1;
        font-size: 13px;
        padding: 8px 0;
        min-width: auto;
    }
}

/* ===================================================================
 超小型デバイス対応
=================================================================== */

@media screen and (max-width: 480px) {
    #entrylistTable {
        font-size: 13px;
    }
    
    #entrylistTable th,
    #entrylistTable td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    #entrylistTable th {
        font-size: 12px;
    }
    
    .entrylist_pagination .cmn_btn {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ===================================================================
 アクセシビリティ
=================================================================== */

.entrylist_search input:focus,
.entrylist_search .cmn_btn:focus,
.entrylist_pagination .cmn_btn:focus {
    outline: 2px solid #495fa5;
    outline-offset: 2px;
}

/* ===================================================================
 アニメーション
=================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#entrylistTable tbody tr {
    animation: fadeIn 0.3s ease;
}

/* ===================================================================
 プリント時のスタイル
=================================================================== */

@media print {
    .entrylist_search,
    .entrylist_pagination {
        display: none;
    }
    
    #entrylistTable {
        box-shadow: none;
    }
    
    #entrylistTable tbody tr {
        background: #fff !important;
    }
    
    #entrylistTable tbody tr:hover {
        background: #fff !important;
    }
}