.economic-timeline {
    position: relative;  /* 親要素に必須 */
}

.economic-timeline::before {
    content: '';                    /* 絶対必須！ */
    position: absolute;             /* 必須 */
    top: 0;                        /* 位置指定 */
    left: 0;                       /* 位置指定 */
    right: 0;                      /* 幅指定 */
    height: 2px;                   /* 高さ指定 */
    background: linear-gradient(90deg, #00d4aa, #4ade80, #60a5fa, #a78bfa);
    border-radius: 12px 12px 0 0;  /* 角丸（オプション） */
}

/* ========================================
   経済指標タイムライン - ダークテーマ版
   背景色: #1a1a1a対応
   ======================================== */

.economic-timeline {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #242424; /* ダークグレー背景 */
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    max-width: 300px;
    color: #e0e0e0; /* 明るいグレーテキスト */
    position: relative;  /* 親要素に必須 - 疑似要素用 */
}

.timeline-header {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.timeline-content {
    position: relative;
    padding-left: 30px;
}

/* カラーレジェンド */
.color-legend {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #333333;
    border-radius: 6px;
    font-size: 11px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #b0b0b0;
}

/* 時間グループ */
.time-group {
    margin-bottom: 25px;
    border-left: 3px solid #333333;
    padding-left: 15px;
    position: relative;
}

.time-header {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
    background: #4a9eff;
    padding: 6px 12px;
    border-radius: 15px;
    display: inline-block;
    position: relative;
    left: -20px;
}

/* 時間グループの状態別スタイル */
.time-group.status-past {
    opacity: 0.5;
}

.time-group.status-past .time-header {
    background: #4a4a4a;
    color: #808080;
}

.time-group.status-current {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 10px;
    animation: currentPulse 2s infinite;
}

.time-group.status-current .time-header {
    background: #ffc107;
    color: #1a1a1a;
}

.time-group.status-future .time-header {
    background: #4a9eff;
    color: white;
}

/* タイムラインアイテム */
.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 20px;
}

/* 重要度別のドットカラー */
.timeline-item.importance-high::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    border: 3px solid #ff6b6b;
}

.timeline-item.importance-medium::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffc107;
    border: 3px solid #ffc107;
}

.timeline-item.importance-low::before {
    content: '';
    position: absolute;
    left: -18px;
    top: 8px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4caf50;
    border: 3px solid #4caf50;
}

/* アイテムの状態別スタイル */
.timeline-item.status-past {
    opacity: 0.5;
}

.timeline-item.status-past .item-name {
    text-decoration: line-through;
    color: #606060;
}

.timeline-item.status-current {
    background: rgba(255, 193, 7, 0.15);
    border-left: 4px solid #ffc107;
    padding-left: 16px;
    border-radius: 4px;
}

.timeline-item.status-current .item-name {
    color: #ffd54f;
}

/* 指標名 */
.item-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
    line-height: 1.2;
}

/* 国名 */
.item-country {
    font-size: 12px;
    color: #b0b0b0;
    background: #2a2a2a;
    border: 1px solid #333333;
    padding: 2px 6px;
    border-radius: 10px;
    display: inline-block;
}

/* 予想値・前回値 */
.item-details {
    font-size: 11px;
    color: #a0a0a0;
    margin-top: 3px;
    line-height: 1.2;
}

.item-details strong {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* パルスアニメーション */
@keyframes currentPulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 193, 7, 0.6);
    }
}

/* フッター */
.timeline-footer {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #333333;
    text-align: center;
}

.timeline-footer small {
    color: #808080;
    font-size: 11px;
}

/* ホバー効果 */
.timeline-item:hover {
    background: rgba(74, 158, 255, 0.1);
    border-radius: 6px;
    margin-left: -10px;
    padding-left: 30px;
    transition: all 0.2s ease;
}

/* ウィジェット用の調整 */
.widget .economic-timeline {
    max-width: 100%;
    padding: 15px;
    background: #1f1f1f;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .economic-timeline {
        max-width: 100%;
        margin: 0 10px;
        padding: 15px;
    }
    
    .color-legend {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        font-size: 10px;
    }
    
    .time-header {
        font-size: 14px;
        padding: 4px 8px;
        left: -15px;
    }
}