/* dashboard.css */

body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.stat-card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem;
}

/* ランキングアイテム */
.ranking-item {
    display: flex;
    flex-direction: column;  /* 縦方向に配置 */
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}
.ranking-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
/* 上部: アイコンとギフト情報 */
.ranking-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
/* 順位バッジ */
.rank-badge {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #fff;
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: #fff;
}

.rank-other {
    background: #e9ecef;
    color: #495057;
}
/* ギフトアイコン */
.gift-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
/* ギフト情報 */
.gift-info {
    flex: 1;
    min-width: 0;
}
.gift-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.gift-stats {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 6px;
}

.revenue-amount {
    font-weight: bold;
    color: #28a745;
}

.progress {
    height: 5px;
    margin-top: 5px;
}

/* ユーザーランキング */
.user-item {
    display: flex;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    border-bottom: 1px solid #e9ecef;
}

.user-item:last-child {
    border-bottom: none;
}

.user-id {
    font-family: monospace;
    color: #6c757d;
    font-size: 0.9rem;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* アニメーション */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ranking-item {
    animation: fadeIn 0.3s ease-in-out;
}

/* ステータスバッジ */
.badge i {
    animation: pulse 2s infinite;
}

/* プログレスバーのコンテナ */
.gift-info .d-flex {
    margin-top: 5px;
}

.gift-info .progress {
    height: 6px;
    margin: 0;
}
/* dashboard.css に追加 */

/* ランダムギフトのアイテム */
.ranking-item.has-details {
    cursor: pointer;
    transition: background-color 0.2s;
}

.ranking-item.has-details:hover {
    background-color: #f8f9fa;
}

/* 展開ボタン */
.ranking-item .btn-link {
    text-decoration: none;
    color: #6c757d;
}

.ranking-item .btn-link:hover {
    color: #495057;
}

/* 明細テーブル */
.gift-details {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
}

.gift-details table {
    font-size: 0.85rem;
}

/* アコーディオンのアニメーション */
.collapse {
    transition: height 0.3s ease;
}

.collapse.show {
    display: block;
}

/* 矢印アイコンのアニメーション */
.ranking-item i.fa-chevron-down,
.ranking-item i.fa-chevron-up {
    transition: transform 0.3s ease;
}

/* プログレスバー */
.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-container .progress {
    flex: 1;
    height: 8px;
    margin: 0;
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-percentage {
    min-width: 45px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}
/* 明細部分（全幅） */
.gift-details-fullwidth {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.details-content {
    padding: 1rem;
}

/* 明細テーブル */
.gift-details-fullwidth table {
    margin-bottom: 0;
}

/* アコーディオンのアニメーション */
.collapse {
    transition: height 0.3s ease;
}

/* ランダムギフトのハイライト 
.ranking-item.has-details {
    border-left: 3px solid #ffc107;
}
*/

/* 展開ボタン */
.ranking-item .btn-link {
    text-decoration: none;
    color: #6c757d;
}

.ranking-item .btn-link:hover {
    color: #495057;
}

/* スピナー（ローディング） */
.details-content .spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
}
/* dashboard.css に追加 */

/* ライバー情報コンテナ（右側配置用） */
.liver-info-container {
    display: inline-block;
}

/* ライバー情報コンテナ（センター配置用） */
.liver-info-container-center {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ライバーカード */
.liver-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.liver-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* センター配置用のライバーカード */
.liver-info-container-center .liver-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 20px;
}

/* ライバーアバター */
.liver-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ライバー詳細 */
.liver-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ライバー名 */
.liver-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

/* Room ID */
.liver-room-id {
    font-size: 0.75rem;
    color: #718096;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .liver-info-container {
        margin-bottom: 10px;
    }
    
    .liver-card {
        padding: 6px 12px;
    }
    
    .liver-avatar {
        width: 40px;
        height: 40px;
    }
    
    .liver-name {
        font-size: 0.9rem;
    }
}
/* dashboard.css */

/* グラフコンテナの基本設定 */
.chart-container {
    position: relative;
    margin-bottom: 20px;
}

/* 時間別推移グラフ（大きめ） */
#hourlyChart {
    height: 500px !important;
}

/* ギフトタイプ別グラフ */
#giftTypeChart {
    height: 400px !important;
}

/* トップユーザーグラフ */
#topUsersChart {
    height: 400px !important;
}

/* タブレット */
@media (max-width: 992px) {
    #hourlyChart {
        height: 400px !important;
    }

    #giftTypeChart,
    #topUsersChart {
        height: 350px !important;
    }
}

/* モバイル */
@media (max-width: 768px) {
    #hourlyChart {
        height: 300px !important;
    }

    #giftTypeChart,
    #topUsersChart {
        height: 300px !important;
    }
}

/* dashboard.css に追加 */

/* 時間別推移: 横長で詳細を見やすく */
#hourlyChart {
    height: 500px !important;
}

/* ギフトタイプ: ドーナツは正方形に近い方が良い */
#giftTypeChart {
    height: 400px !important;
}

/* トップユーザー: 横棒グラフなので高さが重要 */
#topUsersChart {
    height: 450px !important;
}

/* dashboard.css を修正 */

/* ランキングアイテムの構造 */
.ranking-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.ranking-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 上部: アイコンとギフト情報 */
.ranking-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
}

/* クリック可能なヘッダー */
.ranking-item-header.clickable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    padding: 4px;
    margin: -4px;
    border-radius: 6px;
}

.ranking-item-header.clickable:hover {
    background-color: #f8f9fa;
}

.ranking-item-header.clickable:active {
    background-color: #e9ecef;
}

/* 順位バッジ */
.rank-badge {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #fff;
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
    color: #fff;
}

.rank-other {
    background: #e9ecef;
    color: #495057;
}

/* ギフトアイコン */
.gift-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ギフト情報 */
.gift-info {
    flex: 1;
    min-width: 0;
}

.gift-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.gift-stats {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 6px;
}

/* 統計行 */
.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 0.9rem;
}

.stats-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.stats-item i {
    font-size: 0.85rem;
}

/* プログレスバー */
.progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-container .progress {
    flex: 1;
    height: 8px;
    margin: 0;
    background-color: #e9ecef;
    border-radius: 4px;
}

.progress-percentage {
    min-width: 45px;
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: #495057;
}

/* 展開インジケーター */
.expand-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #6c757d;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.ranking-item-header.clickable:hover .expand-indicator {
    color: #495057;
}

/* アイコンの回転アニメーション */
.expand-indicator i {
    transition: transform 0.3s ease;
}

.expand-indicator i.fa-chevron-up {
    transform: rotate(180deg);
}

/* 明細部分（全幅） */
.gift-details-fullwidth {
    width: 100%;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}

.details-content {
    padding: 1rem;
}

/* 明細テーブル */
.gift-details-fullwidth table {
    margin-bottom: 0;
}

/* アコーディオンのアニメーション */
.collapse {
    transition: height 0.3s ease;
}

/* ランダムギフトのハイライト
.ranking-item.has-details {
    border-left: 3px solid #ffc107;
}
 */

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .gift-icon {
        width: 40px;
        height: 40px;
    }
    
    .expand-indicator {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }
}

/* クリックのフィードバックを強化 */
@media (hover: hover) {
    .ranking-item-header.clickable:hover {
        background-color: #f1f3f5;
    }
}

/* タッチデバイス用 */
@media (hover: none) {
    .ranking-item-header.clickable:active {
        background-color: #e9ecef;
        transform: scale(0.99);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
