/**
 * 荒野武器ティアリスト CSS
 */

/* コンテナのスタイル */
.knives-tier-list-container {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.knives-tier-list-wrapper {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ティアリストのメインコンテナ */
.tier-list-main {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 20px;
}

/* タイトル */
.tier-list-title {
    width: 100%;
    text-align: center;
    padding: 15px 10px; /* パディングをさらに増やす */
    font-weight: bold;
    font-size: 1.3rem;
    border-bottom: 1px solid #eee;
    white-space: normal; /* テキストを折り返して表示する */
    overflow-wrap: break-word; /* 長い単語も折り返す */
    word-wrap: break-word; /* IE/Edge対応 */
    max-width: 100%; /* 親要素の幅を超えないようにする */
    line-height: 1.4; /* 行間をさらに広げる */
    box-sizing: border-box; /* パディングを幅に含める */
    min-height: 60px; /* 最小の高さをさらに増やす */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* はみ出した部分を隠す */
    margin-bottom: 10px; /* 下部の余白を増やす */
}

#tier-list-title-input {
    text-align: center;
    font-weight: bold;
    font-size: 1.3rem;
    width: 90%;
    max-width: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px 10px;
    white-space: normal; /* テキストを折り返して表示する */
    overflow-wrap: break-word; /* 長い単語も折り返す */
    word-wrap: break-word; /* IE/Edge対応 */
    box-sizing: border-box; /* パディングとボーダーを幅に含める */
    line-height: 1.2; /* 行間をさらに狭める */
    margin: 0 auto;
}

/* ティア行 */
.tier-rows {
    display: flex;
    flex-direction: column;
}

.tier-row {
    display: flex;
    min-height: 80px;
    border-bottom: 2px solid #eee;
    transition: background-color 0.2s;
}

.tier-row:last-child {
    border-bottom: none;
}

.tier-row.drag-over {
    background-color: #f0f0f0;
}

.tier-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    padding: 10px;
    color: white;
    font-weight: bold;
}

.tier-label span {
    font-size: 2rem;
    text-shadow: 1px 1px 0 #000, -1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000;
    letter-spacing: 0.5px;
}

.tier-items {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 80px;
    align-items: center; /* アイテムを垂直方向に中央揃え */
    justify-content: flex-start; /* 左揃え */
}

/* ウォーターマーク */
.tier-list-watermark {
    position: absolute;
    bottom: 10px;
    right: 15px;
    color: #666;
    font-size: 0.8rem;
    text-align: right;
}

/* 武器カテゴリータブ */
.weapon-category-tabs {
    margin-bottom: 20px;
}

.tabs-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    margin-bottom: 15px;
}

.tab {
    text-align: center;
    padding: 12px 5px;
    background-color: #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* タップ時のハイライトを無効化 */
    touch-action: manipulation; /* ダブルタップによるズームを防止 */
    user-select: none; /* テキスト選択を防止 */
}

.tab:hover {
    background-color: #ddd;
}

.tab:active {
    background-color: #ccc; /* タップ時の視覚的フィードバック */
}

.tab.active {
    background-color: #007bff;
    color: white;
}

/* 武器プール */
.weapon-pool-container {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.weapon-pool-title {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: 500;
}

.weapon-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    min-height: 100px;
    transition: background-color 0.2s;
}

.weapon-pool.drag-over {
    background-color: #f0f0f0;
}

/* 武器アイテム */
.weapon-item {
    width: 80px;
    height: 80px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: move;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    touch-action: none;
}

.weapon-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.weapon-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.weapon-item .weapon-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 2px 0;
    font-size: 0.6rem;
    line-height: 1;
    letter-spacing: -0.02em;
    word-break: break-all;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 16px;
}

.weapon-item.dragging {
    opacity: 0.5;
}

.weapon-item.ghost {
    position: absolute;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.8;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ボタン */
.tier-list-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.reset-button {
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.reset-button:hover {
    background-color: #e9ecef;
}

.save-image-button {
    background-color: #007bff;
    color: white;
}

.save-image-button:hover {
    background-color: #0069d9;
}

.save-post-x-button {
    background-color: #1DA1F2;
    color: white;
}

.save-post-x-button:hover {
    background-color: #1a8cd8;
}

.button .dashicons {
    margin-right: 5px;
}

/* トースト通知 */
.knives-tier-list-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 20px;
    max-width: 300px;
    z-index: 9999;
    transform: translateY(150%);
    transition: transform 0.3s ease-in-out;
}

.knives-tier-list-toast.show {
    transform: translateY(0);
}

.toast-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.toast-message {
    color: #666;
    font-size: 0.9rem;
}

/* 管理画面のスタイル */
.knives-tier-list-admin-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.knives-tier-list-card {
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    flex: 1;
    min-width: 300px;
}

.knives-tier-list-shortcode-example {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px 15px;
    margin: 10px 0;
    font-family: monospace;
    border-left: 4px solid #007bff;
}

.knives-tier-list-preview {
    margin-top: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .tabs-container {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 1fr);
    }
    
    .tier-label {
        width: 60px;
    }
    
    .tier-items {
        padding: 8px; /* パディングを少し小さく */
    }
    
    .weapon-item {
        width: 60px;
        height: 60px;
    }
    
    .tier-list-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .knives-tier-list-wrapper {
        padding: 10px;
    }
    
    .tier-list-title {
        padding: 12px 8px; /* パディングをさらに増やす */
        font-size: 1.2rem; /* 基本フォントサイズを大きめに */
        min-height: 55px; /* 最小の高さを増やす */
        line-height: 1.4; /* 行間をさらに広げる */
    }
    
    #tier-list-title-input {
        font-size: 1.2rem; /* 基本フォントサイズを大きめに */
        width: 95%; /* 幅を広げる */
        padding: 10px 8px; /* パディングをさらに増やす */
        line-height: 1.4; /* 行間をさらに広げる */
    }
    
    .tier-label {
        width: 40px;
    }
    
    .tier-label span {
        font-size: 1.5rem;
    }
    
    .tier-items {
        padding: 6px; /* パディングをさらに小さく */
        gap: 6px; /* アイテム間の隙間を小さく */
    }
    
    .weapon-item {
        width: 50px;
        height: 50px;
        margin: 2px 0; /* 上下のマージンを追加 */
    }
    
    .weapon-item .weapon-name {
        font-size: 0.5rem;
        padding: 1px 0;
        letter-spacing: -0.03em;
        min-height: 14px;
    }
    
    .tab {
        padding: 15px 5px; /* モバイルでのタップ領域を拡大 */
        font-size: 0.9rem;
    }
    
    .tabs-container {
        gap: 3px; /* タブ間の隙間を少し狭める */
    }
}