/* ランキング画面専用スタイル */

/* ランキングタブ切り替え */
.ranking-tabs {
    display: flex;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
}

.ranking-tab {
    flex: 1;
    background-color: transparent;
    border: none;
    padding: 16px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.ranking-tab.active {
    color: #2196F3;
    font-weight: 600;
}

.ranking-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #2196F3;
}

.ranking-tab:hover:not(.active) {
    background-color: rgba(33, 150, 243, 0.05);
    color: #2196F3;
}

/* 期間選択 */
.period-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background-color: #f8f9fa;
    border-bottom: 8px solid #f5f5f5;
}

.period-btn {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-btn.active {
    background-color: #2196F3;
    color: white;
    border-color: #2196F3;
}

.period-btn:hover:not(.active) {
    background-color: #f5f5f5;
}

/* ランキングリスト */
.ranking-list {
    padding: 16px;
}

.ranking-item {
    display: flex;
    align-items: center;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 順位番号 */
.rank-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f5f5f5;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    margin-right: 16px;
    flex-shrink: 0;
}

/* 1位のスタイル */
.rank-1 .rank-number {
    background-color: #FFD700;
    color: white;
}

.rank-1 {
    border-color: #FFD700;
    background-color: #fffbf0;
}

/* 2位のスタイル */
.rank-2 .rank-number {
    background-color: #C0C0C0;
    color: white;
}

.rank-2 {
    border-color: #C0C0C0;
    background-color: #f8f8f8;
}

/* 3位のスタイル */
.rank-3 .rank-number {
    background-color: #CD7F32;
    color: white;
}

.rank-3 {
    border-color: #CD7F32;
    background-color: #faf6f0;
}

/* ランキング情報 */
.rank-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 12px;
}

.rank-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.rank-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.rank-details {
    flex: 1;
    min-width: 0;
}

.rank-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-members,
.rank-location,
.rank-team {
    font-size: 12px;
    color: #666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 統計情報 */
.rank-stats {
    text-align: right;
    flex-shrink: 0;
}

.rank-value {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 2px;
}

.rank-label {
    font-size: 12px;
    color: #666;
}

/* 現在のユーザー */
.current-user {
    border-color: #2196F3;
    background-color: #f0f8ff;
}

.current-user .rank-name {
    color: #2196F3;
    font-weight: bold;
}

/* チーム別ランキング専用スタイル */
.ranking-team .ranking-item {
    cursor: pointer;
}

.ranking-team .ranking-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* チームアイコンアバタースタイル */
.rank-avatar.team-icon-avatar {
    border-radius: 12px;
}

.rank-avatar .team-icon {
    font-size: 24px;
    line-height: 1;
}

/* 個人ランキング専用スタイル */
.ranking-global .rank-avatar,
.ranking-local .rank-avatar {
    background-color: #e0e0e0;
}

/* ヘッダーのポイント情報ボタン */
.points-info-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    color: white;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.points-info-btn::after {
    content: '獲得fc';
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
}

.points-info-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

/* ポイント情報モーダル */
.points-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.points-modal.show {
    opacity: 1;
    visibility: visible;
}

.points-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.points-modal .modal-content {
    position: relative;
    background-color: white;
    margin: 10vh auto;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 16px;
    transform: translateY(50px) scale(0.9);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.points-modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.points-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #2196F3;
    color: white;
    position: relative;
}

.points-modal .modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    text-align: center;
    flex: 1;
}

.points-modal .modal-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: absolute;
    right: 8px;
    line-height: 1;
}

.points-modal .modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.points-modal .modal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

/* ポイントセクション */
.points-section {
    margin-bottom: 24px;
}

.points-section:last-of-type {
    margin-bottom: 16px;
}

.points-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.points-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.points-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.points-item:hover {
    background-color: #e9ecef;
}

.points-rank {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.points-value {
    font-size: 16px;
    font-weight: 700;
    color: #2196F3;
}

/* ポイント注記 */
.points-note {
    background-color: #f0f8ff;
    border-left: 4px solid #2196F3;
    padding: 12px 16px;
    border-radius: 4px;
}

.points-note p {
    font-size: 12px;
    color: #666;
    margin: 0 0 4px 0;
}

.points-note p:last-child {
    margin-bottom: 0;
}

/* レスポンシブ対応 */
@media (max-width: 430px) {
    .ranking-item {
        padding: 12px;
    }
    
    .rank-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-right: 12px;
    }
    
    .rank-avatar {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .rank-name {
        font-size: 15px;
    }
    
    .rank-value {
        font-size: 16px;
    }
    
    .period-selector {
        padding: 12px;
    }
}