/* 기본 초기화 및 테마 컬러 세팅 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

/* 상단 헤더 스타일 */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .site-logo a {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a73e8;
    letter-spacing: -0.05em;
}

/* 레이아웃 컨테이너 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 웰컴 인트로 박스 */
.welcome-section {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
    text-align: center;
}

.welcome-section h1 {
    font-size: 1.8rem;
    color: #111;
    margin-bottom: 8px;
}

.welcome-section p {
    color: #666;
    font-size: 1rem;
}

/* 셀렉터 박스 */
.selector-box {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.selector-box select {
    padding: 10px 15px;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 6px;
    outline: none;
    background-color: #fff;
    min-width: 250px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.selector-box select:focus {
    border-color: #1a73e8;
}

/* 서브 레이아웃 분할 (사이드바 + 메인콘텐츠) */
.content-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

/* 좌측 사이드바 노선 목록 리스트 */
.sidebar-list {
    flex: 0 0 320px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    max-height: 800px;
    overflow-y: auto;
}

.sidebar-list h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f1f3f5;
    color: #222;
}

.route-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.route-item:hover {
    background: #e8f0fe;
    border-color: #d2e3fc;
}

.route-item.active {
    background: #1a73e8;
    color: #fff;
    font-weight: bold;
}

.route-item .badge {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: #e9ecef;
    color: #495057;
    border-radius: 4px;
}

.route-item.active .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* 우측 메인 상세 보기 콘텐츠 */
.main-content {
    flex: 1;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 30px;
    min-height: 500px;
}

.main-content h2 {
    font-size: 1.6rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.city-tag {
    font-size: 0.9rem;
    background-color: #e8f0fe;
    color: #1a73e8;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: normal;
}

/* 운행 정보 안내 그리드 카드 */
.info-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 35px;
}

.info-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    padding: 15px 20px;
    border-radius: 8px;
}

.info-card .card-label {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 5px;
}

.info-card .card-value {
    font-size: 1.05rem;
    font-weight: bold;
    color: #111;
}

.info-card .card-value small {
    color: #1a73e8;
    margin-left: 5px;
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #222;
}

/* 정류소 타임라인 노선도 그래픽 구현 */
.timeline {
    position: relative;
    padding-left: 30px;
    margin-top: 15px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: #ced4da;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-badge {
    position: absolute;
    left: -30px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #1a73e8;
    color: #1a73e8;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.timeline-item:last-child .timeline-badge {
    background: #1a73e8;
    color: #fff;
}

.timeline-panel {
    padding-left: 10px;
}

.station-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.station-sub {
    font-size: 0.8rem;
    color: #888;
}

/* 상태별 플레이스홀더 구성 */
.guide-placeholder, .full-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #888;
    text-align: center;
    font-size: 1.05rem;
}

.empty-text {
    color: #999;
    font-size: 0.95rem;
    padding: 20px 0;
    text-align: center;
}

/* 푸터 디자인 정밀 조정 */
footer {
    background: #ffffff;
    padding: 30px 20px;
    color: #777;
    font-size: 0.85rem;
    line-height: 1.8;
}

/* 스마트폰 디바이스 대응 반응형 브레이크포인트 */
@media (max-width: 991px) {
    .content-layout {
        flex-direction: column;
    }
    .sidebar-list {
        flex: 1 1 auto;
        width: 100%;
        max-height: 300px;
    }
    .info-card-grid {
        grid-template-columns: 1fr;
    }
}

/* 상/하행 방향 선택을 위한 탭 스타일 */
.route-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 12px;
}

.tab-btn {
    flex: 1;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: 600;
    background-color: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.tab-btn small {
    display: block;
    font-size: 0.8rem;
    font-weight: normal;
    color: #868e96;
    margin-top: 2px;
}

.tab-btn:hover {
    background-color: #e9ecef;
}

/* 활성화된 탭 스타일 */
.tab-btn.active {
    background-color: #ffffff;
    border-color: #1a73e8;
    color: #1a73e8;
    box-shadow: 0 4px 6px rgba(26, 115, 232, 0.08);
}

.tab-btn.active small {
    color: #1a73e8;
}

/* 상행과 하행 배지 색상 구분으로 가독성 최적화 */
.timeline-badge.forward-badge {
    border-color: #2b8a3e; /* 초록색 포인트 */
    color: #2b8a3e;
}
.timeline-item:last-child .timeline-badge.forward-badge {
    background: #2b8a3e;
    color: #fff;
}

.timeline-badge.backward-badge {
    border-color: #1c7ed6; /* 파란색 포인트 */
    color: #1c7ed6;
}
.timeline-item:last-child .timeline-badge.backward-badge {
    background: #1c7ed6;
    color: #fff;
}

.direction-timeline-wrapper {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.main-content .content-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #111;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f1f3f5;
    padding-bottom: 10px;
}

/* 사이드바 노선 목록 세로형 레이아웃 변경 */
.route-grid-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 75vh;
    overflow-y: auto;
    padding-right: 5px;
}

/* 개별 노선 카드 아이템 스타일 */
.route-card-item {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease-in-out;
}

.route-card-item:hover {
    border-color: #1a73e8;
    background-color: #f8f9fa;
}

/* 활성화 상태 */
.route-card-item.active {
    border-color: #1a73e8;
    background-color: #e8f0fe;
}

/* 카드 상단: 배지 및 버스 번호 */
.route-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.route-card-header strong {
    font-size: 1.05rem;
    color: #111;
}

/* 카드 하단: 기종점 경로 텍스트 */
.route-card-path {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: #666;
}

.path-node {
    flex: 1;
}

.path-arrow {
    color: #ccc;
    font-weight: bold;
}

/* 말줄임표 처리 공통 */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 지도보기 버튼 마우스 호버 스타일 정의 */
.map-link-btn:hover {
    background-color: #03c75a !important;
    color: #fff !important;
    box-shadow: 0 2px 4px rgba(3, 199, 90, 0.2);
}


