/* Vertical timetable layout */
.timetable {
    position: relative;
    margin: 0 0 1rem 70px;
    padding: 0;
    list-style: none;
}
.timetable::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40px;
    width: 2px;
    background: #0d6efd; /* bootstrap primary */
}
.timetable-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.2rem;
    padding: 0.4rem 0.2rem 0.4rem 0; /* 項目内余白 */
}

/* 交互背景 */
.timetable-item:nth-child(odd) {
    background-color: #ffffff;
}
.timetable-item:nth-child(even) {
    background-color: #f8f9fa;
}
.timetable-dot {
    position: absolute;
    left: -46px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #0d6efd;
}
.timetable-time {
    width: 110px;
    min-width: 110px;
    text-align: right;
    font-weight: 700;
    margin-right: 10px;
    white-space: nowrap;
}
.timetable-content {
    flex: 1;
}
.timetable-label {
    display: inline-block;
    margin-top: 2px;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #fff;
    background-color: #6c757d; /* fallback */
    white-space: nowrap;
}
/* ラベルカラーバリエーション */
.label-color-0 { background-color: #0d6efd; }
.label-color-1 { background-color: #6f42c1; }
.label-color-2 { background-color: #20c997; }
.label-color-3 { background-color: #fd7e14; }
.label-color-4 { background-color: #dc3545; }
.timetable-location {
    font-weight: 600;
}

/* 検索結果スタイル拡張 */
/* 比較表スタイル */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.comparison-table th,
.comparison-table td {
    padding: 10px;
    text-align: center;
    border: 1px solid #ddd;
}

.comparison-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

/* クリック可能な行のスタイル */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: #f0f8ff; /* 薄い青色 */
}

/* タイムラインスタイル */
.all-routes-timeline {
    margin-top: 30px;
    margin-bottom: 30px;
}

.timeline-section {
    margin-bottom: 30px;
}

.timeline-section h4 {
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #ddd;
}

.route-timeline-container {
    position: relative;
    padding: 20px 0;
}

.timeline {
    display: flex;
    position: relative;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #ccc;
    z-index: -1;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    min-width: 150px;
}

.timeline-point {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: white;
    border: 2px solid #0d6efd;
    border-radius: 50%;
    z-index: 1;
}

.departure-point {
    border-color: #28a745; /* 緑色 */
}

.arrival-point {
    border-color: #dc3545; /* 赤色 */
}

.point-label {
    font-weight: bold;
    margin-bottom: 5px;
    white-space: nowrap;
}

.point-time {
    font-size: 0.85em;
    color: #666;
    white-space: nowrap;
}

.carrier-info {
    margin: 10px 0;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
    color: #333;
}

/* 詳細表示スタイル */
.route-detail-container {
    margin-top: 20px;
}

.segment-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.segment-table th,
.segment-table td {
    padding: 8px;
    text-align: left;
    border: 1px solid #ddd;
}

.segment-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.segment-header {
    background-color: #e9ecef;
    font-weight: bold;
}

.back-btn {
    padding: 8px 16px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.back-btn:hover {
    background-color: #e9ecef;
}
