/**
 * user-page.css
 * UserPage.php用スタイル
 *
 * 含まれるコンポーネント:
 * - ユーザーページヘッダー（アバター、ユーザー情報）
 * - プロフィールカード
 * - 応援チームリスト
 * - 編集フォーム
 * - 選手・スカウトリスト
 * - ランクバッジ
 * - もっと見るボタン
 *
 * 移行元:
 * - app/templates/UserPage.tpl（インラインスタイル）
 *
 * 作成日: 2026-02-02
 */

/* ===================================================================
   ユーザーページ モダンデザイン
   =================================================================== */

.userpage-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.userpage-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.userpage-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    font-weight: bold;
    flex-shrink: 0;
}

.userpage-info h1 {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0 0 8px 0;
}

.userpage-info p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

.userpage-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 8px;
}

.userpage-badge.player {
    background-color: #e3f2fd;
    color: #1565c0;
}

.userpage-badge.team {
    background-color: #e8f5e9;
    color: #2e7d32;
}

/* ===================================================================
   成功メッセージ
   =================================================================== */

.userpage-message {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.userpage-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ===================================================================
   カードスタイル
   =================================================================== */

.userpage-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
}

.userpage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
}

.userpage-card-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.userpage-card-body {
    padding: 20px;
}

/* ===================================================================
   プロフィール編集リンク
   =================================================================== */

.userpage-edit-toggle {
    font-size: 13px;
    color: #4A7BF7;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.userpage-edit-toggle:hover {
    text-decoration: underline;
}

/* ===================================================================
   応援チームリスト
   =================================================================== */

.userpage-teams-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.userpage-team-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f0f4ff;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
}

.userpage-team-tag.pro {
    background: #fff3e0;
    color: #e65100;
}

.userpage-team-tag.ama {
    background: #e8f5e9;
    color: #2e7d32;
}

.userpage-no-data {
    color: #999;
    font-size: 14px;
}

/* ===================================================================
   編集フォーム
   =================================================================== */

.userpage-edit-form {
    display: none;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.userpage-edit-form.active {
    display: block;
}

.userpage-form-section {
    margin-bottom: 20px;
}

.userpage-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.userpage-form-input,
.userpage-form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    background-color: #fff;
    transition: border-color 0.2s;
}

.userpage-form-input:focus,
.userpage-form-select:focus {
    outline: none;
    border-color: #4A7BF7;
}

.userpage-team-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.userpage-team-input-wrap {
    position: relative;
}

.userpage-form-hint {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* ===================================================================
   ラジオボタン
   =================================================================== */

.userpage-radio-group {
    display: flex;
    gap: 20px;
}

.userpage-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.userpage-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* ===================================================================
   保存ボタン
   =================================================================== */

.userpage-save-button {
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: #4A7BF7;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.userpage-save-button:hover {
    background-color: #3A6BD7;
}

/* ===================================================================
   選手・スカウトリスト
   =================================================================== */

.userpage-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 4px;
}

.userpage-player-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.2s;
}

.userpage-player-item:hover {
    background: #eef2ff;
}

.userpage-player-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.userpage-player-team {
    font-size: 13px;
    color: #666;
    margin-left: 8px;
}

.userpage-player-pos {
    font-size: 12px;
    color: #888;
    margin-left: auto;
}

.userpage-player-followed-date {
    font-size: 11px;
    color: #999;
    margin-left: 8px;
    white-space: nowrap;
}

/* ===================================================================
   ドラフト指名予想リンク
   =================================================================== */

.userpage-draft-link {
    display: inline-flex;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
    color: white !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.userpage-draft-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(238, 82, 83, 0.4);
}

/* ===================================================================
   エラー表示
   =================================================================== */

.userpage-error {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.userpage-error h2 {
    font-size: 18px;
    color: #333;
    margin-bottom: 12px;
}

/* ===================================================================
   特殊バッジ
   =================================================================== */

.userpage-special-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 16px;
}

.userpage-special-link:hover {
    opacity: 0.9;
}

/* ===================================================================
   ユーザー設定リンク
   =================================================================== */

.userpage-settings-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    margin-top: 8px;
}

.userpage-settings-link:hover {
    color: #4A7BF7;
}

/* ===================================================================
   もっと見るボタン
   =================================================================== */

.userpage-load-more {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.userpage-load-more-btn {
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    color: #4A7BF7;
    background-color: #fff;
    border: 2px solid #4A7BF7;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.userpage-load-more-btn:hover {
    background-color: #4A7BF7;
    color: #fff;
}

.userpage-load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.userpage-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #4A7BF7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===================================================================
   ランクフィルター
   =================================================================== */

.userpage-rank-filter {
    display: flex;
    align-items: center;
}

/* カスタムドロップダウン */
.custom-dropdown {
    position: relative;
    min-width: 160px;
}

.custom-dropdown-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px !important;
    font-size: 14px !important;
    color: #333 !important;
    background-color: #fff !important;
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: border-color 0.2s;
}

.custom-dropdown-toggle:hover,
.custom-dropdown-toggle:focus {
    border-color: #4A7BF7 !important;
    background-color: #fff !important;
    color: #333 !important;
    outline: none;
}

.custom-dropdown.open .custom-dropdown-toggle {
    border-color: #4A7BF7;
}

.custom-dropdown-text {
    flex: 1;
    text-align: left;
}

.custom-dropdown-arrow {
    font-size: 10px;
    color: #666;
    margin-left: 8px;
    transition: transform 0.2s;
}

.custom-dropdown.open .custom-dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    display: none;
    position: fixed !important;
    margin-top: 4px;
    padding: 8px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999 !important;
    max-height: 300px;
    overflow-y: auto;
    list-style: none;
}

.custom-dropdown.open .custom-dropdown-menu {
    display: block;
}

.custom-dropdown-item {
    padding: 12px 16px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.15s;
}

.custom-dropdown-item:hover {
    background-color: #f0f4ff;
}

.custom-dropdown-item.active {
    background-color: #4A7BF7;
    color: #fff;
}

.custom-dropdown-item.active:hover {
    background-color: #3A6BD7;
}

/* ===================================================================
   ランクバッジ
   =================================================================== */

.userpage-player-rank {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    flex-shrink: 0;
}

.userpage-player-rank.rank-s {
    background: linear-gradient(135deg, #ffd700 0%, #ffec8b 100%);
    color: #8B6914;
}

.userpage-player-rank.rank-特a,
.userpage-player-rank.rank-a,
.userpage-player-rank.rank-a- {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
    color: #fff;
}

.userpage-player-rank.rank-b\+,
.userpage-player-rank.rank-b,
.userpage-player-rank.rank-b- {
    background: linear-gradient(135deg, #4A7BF7 0%, #3A6BD7 100%);
    color: #fff;
}

.userpage-player-rank.rank-c\+,
.userpage-player-rank.rank-c,
.userpage-player-rank.rank-c- {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #fff;
}

.userpage-player-rank.rank-d,
.userpage-player-rank.rank-e {
    background: #e0e0e0;
    color: #666;
}

/* ===================================================================
   フルサイズローディング
   =================================================================== */

.userpage-loading-full {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-size: 14px;
}

/* ===================================================================
   ドラフト指名予想セクション
   =================================================================== */

.userpage-expect-item {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.userpage-expect-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.userpage-expect-item:first-child {
    padding-top: 0;
}

.userpage-expect-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.userpage-expect-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.userpage-expect-private {
    display: inline-block;
    padding: 2px 8px;
    background: #f5f5f5;
    color: #666;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
    margin-left: 8px;
}

.userpage-expect-date {
    font-size: 13px;
    color: #888;
}

.userpage-expect-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #ee5253 !important;
    background: #fff;
    border: 2px solid #ee5253;
    border-radius: 6px;
    text-decoration: none !important;
    margin-left: auto;
    transition: all 0.2s;
}

.userpage-expect-edit-link:hover {
    color: #fff !important;
    background: #ee5253;
}

/* 指名予想登録リンク（カード上部） */
.userpage-expect-register-link {
    padding: 12px 16px;
    margin-bottom: 12px;
    background: #e3f2fd;
    border-radius: 8px;
    text-align: center;
}

.userpage-expect-register-link a {
    color: #1565c0 !important;
    font-weight: bold;
    font-size: 14px;
    text-decoration: none;
}

.userpage-expect-register-link a:hover {
    text-decoration: underline;
}

.userpage-expect-meta {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.userpage-expect-meta-row {
    display: flex;
    padding: 6px 0;
}

.userpage-expect-meta-row:first-child {
    padding-top: 0;
}

.userpage-expect-meta-row:last-child {
    padding-bottom: 0;
}

.userpage-expect-meta-label {
    font-size: 13px;
    color: #666;
    min-width: 100px;
    flex-shrink: 0;
}

.userpage-expect-meta-value {
    font-size: 13px;
    color: #333;
}

/* 指名予想テーブル（UserPage用上書き） */
.userpage-card .nominate-expect-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.userpage-card .nominate-expect-table th,
.userpage-card .nominate-expect-table td {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.userpage-card .nominate-expect-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.userpage-card .nominate-expect-table th:first-child {
    width: 100px;
    min-width: 80px;
}

.userpage-card .nominate-expect-table td a {
    color: #4A7BF7;
    text-decoration: none;
}

.userpage-card .nominate-expect-table td a:hover {
    text-decoration: underline;
}

.userpage-card .nominate-expect-table .nominate_expect_correct {
    background-color: #d4edda;
}

/* ===================================================================
   レスポンシブ
   =================================================================== */

@media (max-width: 768px) {
    .userpage-container {
        padding: 16px;
    }

    .userpage-header {
        flex-direction: column;
        text-align: center;
    }

    .userpage-player-grid {
        grid-template-columns: 1fr;
    }

    .userpage-radio-group {
        flex-direction: column;
        gap: 12px;
    }

    .userpage-card-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .userpage-card-body {
        padding: 10px;
    }

    .userpage-rank-filter {
        width: 100%;
    }

    .custom-dropdown {
        width: 100%;
    }

    .custom-dropdown-toggle {
        font-size: 16px;
        padding: 12px 16px;
    }

    .custom-dropdown-item {
        font-size: 16px;
        padding: 14px 16px;
    }

    /* 指名予想セクション モバイル対応 */
    .userpage-expect-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .userpage-expect-edit-link {
        margin-left: 0;
    }

    .userpage-expect-meta {
        padding: 10px 12px;
    }

    .userpage-expect-meta-row {
        flex-direction: column;
        gap: 4px;
    }

    .userpage-expect-meta-label {
        min-width: unset;
    }

    /* 指名予想テーブル モバイル対応 */
    .userpage-card .table-scroll-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .userpage-card .nominate-expect-table {
        min-width: 500px;
    }

    .userpage-card .nominate-expect-table th,
    .userpage-card .nominate-expect-table td {
        padding: 8px 10px;
        font-size: 12px;
    }
}
