/**
 * PlayerInfo専用スタイル
 * 選手詳細ページ（PlayerInfo.php）のレイアウト・コンポーネント
 * 2026-02-02 PlayerInfo.tplのインラインスタイルから分離
 */

/* ===== アイコン化サイドバー ===== */
.layout-sidenav-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar-nav {
    position: fixed;
    left: 0;
    top: 112px; /* ヘッダー(60px) + メニュー(52px) = 112px */
    height: calc(100vh - 112px);
    width: 72px;
    background: #1f2937;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 12px;
    z-index: 1000;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav:hover {
    width: 180px;
}

.sidebar-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 4px;
    color: #9ca3af;
    text-decoration: none;
    transition: all 0.2s ease;
    text-align: center;
}

.sidebar-nav:hover .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px 16px;
    text-align: left;
}

.sidebar-nav .nav-item:hover {
    background: #374151;
    color: #fff;
}

.sidebar-nav .nav-item.active {
    background: var(--color-primary-700, #334e68);
    color: #fff;
}

.sidebar-nav .nav-icon {
    font-size: 1.25rem;
    min-width: 28px;
    text-align: center;
}

.sidebar-nav .nav-label {
    font-size: 0.6rem;
    margin-top: 2px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 64px;
    transition: all 0.2s ease;
}

.sidebar-nav:hover .nav-label {
    font-size: 0.85rem;
    margin-top: 0;
    margin-left: 10px;
    opacity: 1;
    max-width: none;
}

/* メインコンテンツエリア */
.main-content-sidenav {
    margin-left: 72px;
    flex: 1;
    padding: 20px;
    max-width: calc(100% - 72px);
    transition: margin-left 0.3s ease, max-width 0.3s ease;
}

.sidebar-nav:hover + .main-content-sidenav {
    margin-left: 180px;
    max-width: calc(100% - 180px);
}

/* ===== 既存CSSの上書き ===== */
#container,
#header,
#contents,
#footer {
    width: 100% !important;
    max-width: 100% !important;
}

/* ===== 1カラムレイアウト ===== */
.one-column-layout {
    max-width: calc(100% - 40px); /* サイドバー領域を除いて広く使う */
    margin: 0 auto;
}

.one-column-layout > section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* セクションタイトル */
.section-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--color-primary-800, #243b53);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--color-primary-700, #334e68);
}

/* 選手カード */
.player-section {
    max-width: calc(100% - 40px);
    margin: 0 auto 20px;
}

/* ===== 評価セクションのみ2カラム ===== */
.rating-section-2col {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    max-width: calc(100% - 40px);
    margin: 0; /* 左寄せ */
    margin-left: 20px;
}

.rating-comments {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.rating-form-sticky {
    position: sticky;
    top: 100px;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    height: fit-content;
}

/* チームナビゲーション */
.team-nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 12px 20px;
    border-radius: 8px;
    border: 1px solid #f59e0b;
}

.team-nav-btn {
    background: #f59e0b;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.team-nav-btn:hover {
    background: #d97706;
}

.team-nav-btn.disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.team-nav-current {
    font-weight: 600;
    color: #92400e;
}

/* 紹介・実績 */
.introduction-content, .achievements-content {
    line-height: 1.8;
    color: #374151;
}

.introduction-meta {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.introduction-meta a {
    color: var(--color-primary-700, #334e68);
}

/* みんなの評価サマリー */
.overall-score-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 20px;
}

.big-score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.big-score-inner {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.big-score-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1;
}

.big-score-label {
    font-size: 0.8rem;
    color: #64748b;
}

/* コンテンツなし */
.no-content {
    color: #9ca3af;
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
}

/* ===== 下部2カラムレイアウト ===== */
.bottom-2col-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.bottom-2col-left,
.bottom-2col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bottom-2col-item {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bottom-2col-right {
    position: sticky;
    top: 120px;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

@media (max-width: 768px) {
    .bottom-2col-wrapper {
        grid-template-columns: 1fr;
    }

    .bottom-2col-right {
        position: static;
        max-height: none;
    }
}

/* ===== 注目機能 + ランク分布 2カラム（1カード内） ===== */
.follow-rank-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 24px !important;
    background: #fff !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* 片方だけの場合は1カラム */
.follow-rank-wrapper.follow-rank-single {
    grid-template-columns: 1fr;
}

.follow-rank-left,
.follow-rank-right {
    display: flex;
    flex-direction: column;
}

.follow-rank-item {
    /* カード内の個別アイテム（カードスタイルなし） */
}

@media (max-width: 768px) {
    .follow-rank-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ===== チームナビゲーション（みんなの評価内） ===== */
.team-nav-in-rating {
    margin-top: 24px;
}

/* ===== モバイル左サイドバー（ドロワー） ===== */
.mobile-sidebar-tab,
.mobile-sidebar,
.mobile-sidebar-overlay {
    display: none; /* デスクトップでは非表示 */
}

@media (max-width: 768px) {
    /* サイドバー開くタブ */
    .mobile-sidebar-tab {
        display: flex;
        position: fixed;
        left: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 48px;
        padding: 2px;
        background: rgba(31, 41, 55, 0.85);
        border: none;
        border-radius: 0 4px 4px 0;
        color: #fff;
        font-size: 1rem;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1003;
        box-shadow: 1px 0 4px rgba(0, 0, 0, 0.1);
        transition: background 0.2s;
        box-sizing: border-box;
    }

    .mobile-sidebar-tab:hover,
    .mobile-sidebar-tab:active {
        background: rgba(55, 65, 81, 0.95);
    }

    .sidebar-tab-icon {
        font-size: 0.9rem;
        line-height: 1;
    }

    /* オーバーレイ */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1004;
    }

    .mobile-sidebar-overlay.show {
        display: block;
    }

    /* サイドバー本体 */
    .mobile-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -220px;
        width: 220px;
        height: 100%;
        background: #1f2937;
        z-index: 1005;
        transition: left 0.3s ease;
        padding-top: env(safe-area-inset-top);
        overflow-y: auto;
    }

    .mobile-sidebar.open {
        left: 0;
    }

    /* 閉じるボタン */
    .mobile-sidebar-close {
        position: absolute;
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        background: transparent;
        border: none;
        color: #9ca3af;
        font-size: 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
    }

    .mobile-sidebar-close:hover {
        background: #374151;
        color: #fff;
    }

    /* タイトル */
    .mobile-sidebar-title {
        padding: 16px 16px 12px;
        font-size: 0.85rem;
        color: #9ca3af;
        border-bottom: 1px solid #374151;
        margin-bottom: 8px;
    }

    /* メニューアイテム */
    .mobile-sidebar-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        color: #d1d5db;
        text-decoration: none;
        transition: all 0.2s;
    }

    .mobile-sidebar-item:hover,
    .mobile-sidebar-item:active {
        background: #374151;
        color: #fff;
    }

    .mobile-sidebar-item.active {
        background: #374151;
        color: #fbbf24;
        border-left: 3px solid #fbbf24;
    }

    .sidebar-item-icon {
        font-size: 1.1rem;
        width: 24px;
        text-align: center;
    }

    .sidebar-item-label {
        font-size: 0.95rem;
    }
}

/* ===== フローティング評価ボタン ===== */
.fab-rating-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 50px;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    z-index: 1001;
    transition: all 0.3s ease;
}

.fab-rating-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.fab-rating-button:active {
    transform: translateY(0);
}

.fab-rating-button .fab-icon {
    font-size: 1.25rem;
}

.fab-rating-button .fab-text {
    white-space: nowrap;
}

/* フォームが開いている時はフローティングボタン・投稿ボタンを非表示 */
body.rating-form-open .fab-rating-button,
body.rating-form-open .btn-add-rating {
    display: none !important;
}

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) {
    .sidebar-nav {
        display: none;
    }

    .main-content-sidenav {
        margin-left: 0;
        max-width: 100%;
    }

    .rating-section-2col {
        grid-template-columns: 1fr;
    }

    .rating-form-sticky {
        position: static;
    }
}

@media (max-width: 768px) {
    /* モバイル時の余白縮小 */
    .main-content-sidenav {
        padding: 12px 4px;
    }

    .one-column-layout {
        max-width: 100%;
    }

    .player-section {
        max-width: 100%;
        margin: 0 0 16px;
    }

    .rating-section-2col {
        max-width: 100%;
        margin-left: 0;
    }

    .one-column-layout > section {
        padding: 16px;
        border-radius: 8px;
    }

    .team-nav-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .overall-score-display {
        flex-direction: column;
    }

    /* フローティング評価ボタン縮小 */
    .fab-rating-button {
        bottom: 16px;
        right: 16px;
        padding: 10px 16px;
        font-size: 0.85rem;
        gap: 6px;
    }

    .fab-rating-button .fab-icon {
        font-size: 1rem;
    }
}
