/* 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* 시스템 헤더 */
.system-header {
    text-align: center;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.system-header h1 {
    margin: 0;
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
}

/* 모바일에서 컨테이너 최대 너비 제거 */
@media (max-width: 768px) {
    .container {
        max-width: none;
        padding: 8px;
        margin: 0;
        width: 100%;
    }
}


/* 상단 컨트롤 스타일 */
.top-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
    gap: 15px;
}

/* 패널 컨트롤 스타일 */
.panel-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

/* 상단 버스 타입 선택 스타일 */
/* 상단 버스 타입 선택 (2행으로 배치) */
.top-bus-selection {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    background: #f8f9fa;
    border-radius: 0;
    border: 1px solid #e9ecef;
    margin-bottom: 0;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}

.bus-type-section {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    border-radius: 4px;
    padding: 4px 8px;
    border: 1px solid #ddd;
}

.bus-type-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.bus-type-label {
    margin: 0;
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 50px;
    display: inline-block;
}


.route-search {
    width: 120px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 10px;
    color: #333;
    transition: border-color 0.3s ease;
    margin-right: 8px;
}

.route-search:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.route-search::placeholder {
    color: #999;
    font-size: 9px;
}

.route-dropdown {
    width: 140px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 10px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
    flex: 1;
}

.route-dropdown:hover {
    border-color: #2196f3;
}

.route-dropdown:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.btn-view {
    background: linear-gradient(45deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    margin-left: 8px;
}

.btn-view:hover:not(:disabled) {
    background: linear-gradient(45deg, #1976d2, #1565c0);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-view:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* 유사 노선 찾기 버튼 */
.btn-find {
    background: linear-gradient(45deg, #2196f3, #1976d2);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}

.btn-find:hover:not(:disabled) {
    background: linear-gradient(45deg, #1976d2, #1565c0);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.btn-find:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-find:disabled:hover {
    background: #ccc !important;
    color: #666 !important;
    transform: none;
    box-shadow: none;
}

/* 모달 스타일 */
.large-modal .modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
}

.route-containers-modal {
    max-height: 400px;
    overflow-y: auto;
    position: relative;
}

.btn-add-container {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    background: #2196f3;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-add-container:hover {
    background: #1976d2;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.route-container-modal {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
}

.simple-data-input {
    padding: 20px 0;
}

.simple-data-input .input-group {
    margin-bottom: 20px;
}

.simple-data-input label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.simple-data-input textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: vertical;
    min-height: 400px;
}

.simple-data-input textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 정거장 툴팁 스타일 */
.station-tooltip {
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 1000;
}

/* 전체 정류장 목록 스타일 */
.all-stations-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    background: #f9f9f9;
}

.station-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

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

.station-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    margin-right: 10px;
    flex-shrink: 0;
}

.station-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.station-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 10px;
}

/* 정류장 상태별 스타일 */
.station-item.boarding-station {
    background: #d4edda;
    border-left: 4px solid #28a745;
}

.station-item.boarding-station .station-number {
    background: #28a745;
}

.station-item.boarding-station .station-status {
    background: #28a745;
    color: white;
}

.station-item.alighting-station {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.station-item.alighting-station .station-number {
    background: #dc3545;
}

.station-item.alighting-station .station-status {
    background: #dc3545;
    color: white;
}

.station-item.passing-station {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
}

.station-item.passing-station .station-number {
    background: #17a2b8;
}

.station-item.passing-station .station-status {
    background: #17a2b8;
    color: white;
}

.station-item.other-station {
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.station-item.other-station .station-status {
    background: #6c757d;
    color: white;
}

.station-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.tooltip-content {
    text-align: center;
    line-height: 1.4;
}

/* 경로 그리기 프로그레스 바 */
.route-progress {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #007bff;
    border-radius: 12px;
    padding: 20px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 300px;
}

.progress-content {
    text-align: center;
}

.progress-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #007bff;
}

.route-container-modal .btn-delete {
    position: absolute;
    top: 10px;
    right: 10px;
}

.route-form-group {
    margin-bottom: 15px;
}

.route-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.route-form-group input,
.route-form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.route-form-group input:focus,
.route-form-group textarea:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.route-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'Courier New', monospace;
}

/* 매칭 결과 스타일 */
.no-results {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
}

.match-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-item:hover {
    background: #f8f9fa;
    border-color: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.match-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
}

.total-time {
    background: #2196f3;
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8rem;
}

.match-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-breakdown {
    display: flex;
    gap: 10px;
    font-size: 0.75rem;
    color: #666;
}

.time-breakdown span {
    background: #f8f9fa;
    padding: 3px 6px;
    border-radius: 3px;
}

.station-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7rem;
    color: #555;
}

.station-info span {
    padding: 1px 0;
}

/* 상태 메시지 */
#statusMessage {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#statusMessage.show {
    opacity: 1;
}

.status-success {
    background: #4caf50 !important;
}

.status-error {
    background: #f44336 !important;
}

.status-warning {
    background: #ff9800 !important;
}

.status-info {
    background: #2196f3 !important;
}

/* 경로 정보 헤더 스타일 */
.route-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 6px;
}

/* 트래픽 정보 스타일 */
.traffic-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.traffic-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.traffic-icon {
    font-size: 0.9rem;
}

.traffic-text {
    white-space: nowrap;
}

.traffic-status.warning {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.traffic-status.error {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
}

.route-info-label {
    margin: 0;
    color: #2c3e50;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
}

.bus-type-radio {
    display: flex;
    gap: 12px;
    align-items: center;
}

.bus-type-radio .radio-item {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.bus-type-radio .radio-item:hover {
    background: rgba(33, 150, 243, 0.1);
}

.bus-type-radio .radio-item input[type="radio"] {
    margin: 0;
    accent-color: #4caf50;
}

.bus-type-radio .radio-item input[type="radio"]:checked + span {
    font-weight: 600;
    color: #4caf50;
}

.btn {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.btn.enabled {
    background: linear-gradient(45deg, #4caf50, #45a049);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
    50% { box-shadow: 0 6px 25px rgba(76, 175, 80, 0.6); }
    100% { box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4); }
}

.btn.secondary {
    background: linear-gradient(45deg, #4caf50, #45a049);
}

/* 파일 입력 스타일 */
.file-input {
    display: none;
}

.data-source {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.file-label {
    background: linear-gradient(45deg, #2196f3, #1976d2);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    text-align: center;
}

.data-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    text-align: left;
    font-style: italic;
}

.file-label:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* 메인 콘텐츠 스타일 */
.main-content {
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
    width: 100%;
}

/* 좌측 레이아웃: top-bus-selection + map-container */
.left-layout {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 6;
    width: 100%;
}

/* 우측 레이아웃: info-panel */
.right-layout {
    flex: 4;
    width: 100%;
}

.map-container {
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    flex: 1;
    position: relative;
    min-height: 700px;
    min-width: 400px; /* 최소 너비 설정 */
}

.info-panel {
    background: white;
    border-radius: 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    padding: 0;
    height: calc(700px + 120px + 20px); /* map-container 높이 + top-bus-selection 높이 + gap */
    overflow-y: auto;
    min-width: 300px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem; /* 기본 폰트 크기 설정 */
}


/* 상태 메시지 */
#statusMessage {
    margin-top: 20px;
    text-align: center;
}

#statusMessage .success {
    background: rgba(46, 204, 113, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
    animation: slideUp 0.3s ease-out;
}

#statusMessage .error {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.map {
    width: 100%;
    height: 700px;
}


.info-panel h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3rem;
}

/* 경로 정보 스타일 */
.route-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: none;
    margin-bottom: 3px;
}

.route-point {
    flex: 1;
    min-width: 180px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 4px;
    text-align: center;
}

.route-point.selected {
    border-color: #2196f3;
    background: #e3f2fd;
}

.route-point h4 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.route-point .coords {
    font-size: 0.75rem;
    color: #666;
}

.route-point .status {
    font-size: 0.7rem;
    color: #999;
    margin-top: 4px;
}

/* 매치 결과 스타일 */
.match-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    flex: 1;
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
}

.match-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.match-item:hover {
    background: #e3f2fd;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.match-item.selected {
    background: #bbdefb;
    border-color: #2196f3;
}

.match-score {
    position: absolute;
    top: 10px;
    right: 15px;
    background: #ff6b6b;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.match-route-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.match-station-count {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.match-stations {
    font-size: 0.8rem;
    color: #999;
}

.match-click-hint {
    font-size: 0.85rem;
    color: #2196f3;
    margin-top: 8px;
    font-weight: 500;
    text-align: center;
    padding: 4px 8px;
    background: rgba(33, 150, 243, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.match-time-info {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.time-breakdown {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 8px 0;
    font-size: 0.9rem;
}

.time-breakdown span {
    padding: 4px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

.station-info {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #666;
}

.station-info div {
    margin: 2px 0;
    padding: 2px 0;
}

/* 상태 메시지 스타일 */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    background: #ffebee;
    border: 1px solid #f44336;
    border-radius: 10px;
    padding: 15px;
    color: #c62828;
    margin-bottom: 20px;
}

.success {
    background: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 10px;
    padding: 15px;
    color: #2e7d32;
    margin-bottom: 20px;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
        width: 100%;
    }
    
    .left-layout {
        flex-direction: column;
        width: 100%;
    }
    
    .right-layout {
        width: 100%;
    }
    
    .map-container {
        flex: 1;
        min-width: auto; /* 모바일에서 전체 폭 사용 */
        width: 100%;
    }
    
    .info-panel {
        flex: 1;
        width: 100%;
    }
    
    .time-presets {
        grid-template-columns: 1fr;
    }
    
    .bus-type-selection {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .radio-group {
        gap: 10px;
    }
    
    .top-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .action-buttons {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 8px;
        width: 100%;
    }
    
    .main-content {
        gap: 10px;
        width: 100%;
    }
    
    .left-layout {
        flex-direction: column;
        width: 100%;
    }
    
    .right-layout {
        width: 100%;
    }
    
    .system-header {
        padding: 0;
    }
    
    .system-header h1 {
        font-size: 1.8rem;
    }
    
    .map-container {
        min-height: 40vh; /* 뷰포트 높이의 40% (80% 수준) */
        min-width: auto;
        width: 100%;
    }
    
    .map {
        height: 40vh; /* 뷰포트 높이의 40% (80% 수준) */
        min-height: 240px; /* 최소 높이 보장 */
    }
    
    .info-panel {
        max-height: calc(100vh - 120px); /* 전체 화면 높이에서 헤더와 여백 제외 */
        min-width: auto;
        width: 100%;
        height: calc(100vh - 120px);
        font-size: 0.7rem; /* 모바일 폰트 크기 */
        overflow-y: auto;
    }
    
    /* info-panel 내부 요소들 모바일 최적화 */
    .info-panel h3, .info-panel h4 {
        font-size: 1rem;
    }
    
    .info-panel .btn {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
    
    .info-panel .label, .info-panel .bus-type-label {
        font-size: 0.9rem;
    }
    
    .info-panel .text, .info-panel .route-info-label {
        font-size: 0.9rem;
    }
    
    .info-panel .match-item h4 {
        font-size: 0.8rem;
    }
    
    .info-panel .total-time {
        font-size: 0.7rem;
    }
    
    .info-panel .departure-time {
        font-size: 0.6rem;
    }
    
    .info-panel .route-flow {
        font-size: 0.6rem;
    }
    
    /* bus-type-section 모바일 최적화 */
    .bus-type-section {
        margin-bottom: 4px;
    }
    
    .bus-type-header {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .bus-type-label {
        min-width: 60px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .route-search {
        flex: 1;
        min-width: 80px;
        font-size: 0.9rem;
        padding: 3px 6px;
    }
    
    .route-dropdown {
        flex: 1.5;
        min-width: 100px;
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .btn-view {
        min-width: 50px;
        font-size: 0.9rem;
        padding: 3px 8px;
        flex-shrink: 0;
    }
    
    .btn-find {
        font-size: 12px;
    }
    
    .route-info {
        display: none;
    }
    
    .panel-controls {
        padding: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    /* 시간 버튼 모바일에서 숨김 */
    .time-hour-buttons {
        display: none;
    }
    
    .hour-btn {
        font-size: 0.7rem;
        padding: 3px 6px;
        min-height: 32px;
    }
    
    .preset-btn {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    /* 시간 입력 모바일 최적화 - 한 줄 유지 */
    .time-main-row {
        flex-direction: row;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
    }
    
    .time-label {
        font-size: 0.9rem;
        min-width: 50px;
        flex-shrink: 0;
    }
    
    .time-inputs {
        flex-direction: row;
        gap: 4px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group {
        flex-direction: row;
        align-items: center;
        gap: 2px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group label {
        display: none;
    }
    
    .time-input-container {
        gap: 2px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input {
        width: 100%;
        min-width: 60px;
        font-size: 0.8rem;
        padding: 2px 4px;
    }
    
    .time-arrow-btn {
        width: 16px;
        height: 12px;
        font-size: 8px;
        flex-shrink: 0;
    }
    
    .time-separator {
        font-size: 0.8rem;
        margin: 0 2px;
        flex-shrink: 0;
    }
}

/* 스크롤바 스타일링 */
.info-panel::-webkit-scrollbar {
    width: 8px;
}

.info-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.info-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.info-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 시간 범위 선택 스타일 */
.time-range-selection {
    margin-top: 2px;
    padding-top: 2px;
}

.time-main-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.time-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    min-width: 60px;
}

.time-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-input-group label {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

.time-input-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.time-input {
    padding: 4px 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    transition: border-color 0.3s ease;
    width: 120px;
}

.time-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 5px rgba(33, 150, 243, 0.3);
}

.time-arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-arrow-btn {
    width: 20px;
    height: 15px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 2px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.time-arrow-btn:hover {
    background: #f8f9fa;
    border-color: #2196f3;
}

.time-arrow-btn:active {
    background: #e9ecef;
}

.time-separator {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    margin: 0 3px;
}

.time-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.preset-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196f3;
    color: #2196f3;
    transform: translateY(-1px);
}

.preset-btn.active {
    background: #2196f3;
    border-color: #2196f3;
    color: #fff;
    font-weight: 600;
}

/* 시간 버튼 스타일 - 2줄 배치 */
.time-hour-buttons {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 3px;
    margin-top: 4px;
    height: 50px;
}

/* 현재시간 버튼을 두 칸 너비로 설정 */
.time-hour-buttons > *:nth-child(1) { 
    grid-column: 1 / 3; 
}

/* 첫 번째 행: 04시~12시 (9개) */
.time-hour-buttons > *:nth-child(2) { grid-column: 3; }  /* 04시 */
.time-hour-buttons > *:nth-child(3) { grid-column: 4; }  /* 05시 */
.time-hour-buttons > *:nth-child(4) { grid-column: 5; }  /* 06시 */
.time-hour-buttons > *:nth-child(5) { grid-column: 6; }  /* 07시 */
.time-hour-buttons > *:nth-child(6) { grid-column: 7; }  /* 08시 */
.time-hour-buttons > *:nth-child(7) { grid-column: 8; }  /* 09시 */
.time-hour-buttons > *:nth-child(8) { grid-column: 9; }  /* 10시 */
.time-hour-buttons > *:nth-child(9) { grid-column: 10; } /* 11시 */
.time-hour-buttons > *:nth-child(10) { grid-column: 11; } /* 12시 */

/* 두 번째 행: 13시~23시 (11개) */
.time-hour-buttons > *:nth-child(11) { grid-column: 1; grid-row: 2; } /* 13시 */
.time-hour-buttons > *:nth-child(12) { grid-column: 2; grid-row: 2; } /* 14시 */
.time-hour-buttons > *:nth-child(13) { grid-column: 3; grid-row: 2; } /* 15시 */
.time-hour-buttons > *:nth-child(14) { grid-column: 4; grid-row: 2; } /* 16시 */
.time-hour-buttons > *:nth-child(15) { grid-column: 5; grid-row: 2; } /* 17시 */
.time-hour-buttons > *:nth-child(16) { grid-column: 6; grid-row: 2; } /* 18시 */
.time-hour-buttons > *:nth-child(17) { grid-column: 7; grid-row: 2; } /* 19시 */
.time-hour-buttons > *:nth-child(18) { grid-column: 8; grid-row: 2; } /* 20시 */
.time-hour-buttons > *:nth-child(19) { grid-column: 9; grid-row: 2; } /* 21시 */
.time-hour-buttons > *:nth-child(20) { grid-column: 10; grid-row: 2; } /* 22시 */
.time-hour-buttons > *:nth-child(21) { grid-column: 11; grid-row: 2; } /* 23시 */

.hour-btn {
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
    white-space: nowrap;
}

.hour-btn:hover {
    background: rgba(33, 150, 243, 0.1);
    border-color: #2196f3;
    color: #2196f3;
    transform: translateY(-1px);
}

.hour-btn.active {
    background: #2196f3;
    border-color: #2196f3;
    color: #fff;
    font-weight: 600;
}

.hour-btn:disabled {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 유사노선 찾기 결과 스타일 */
.match-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #4CAF50;
    transition: all 0.3s ease;
    min-width: 0;
    overflow: visible;
    width: 100%;
}

.match-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    min-width: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.match-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
    flex: 1;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    min-width: 0;
    word-break: break-word;
    line-height: 1.3;
    max-width: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: fit-content;
}

.total-time {
    background: #2196F3;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    white-space: nowrap;
}

.match-details {
    font-size: 0.9rem;
}

.route-summary {
    margin-bottom: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.departure-time {
    margin-bottom: 8px;
    color: #333;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.departure-time strong {
    color: #2c3e50;
    font-weight: 600;
}

.departure-time .time-arrow {
    color: #7f8c8d;
    font-weight: 500;
}

.route-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.flow-item {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    text-align: center;
}

.flow-item.start {
    background: #4caf50;
    color: white;
}

.flow-item.end {
    background: #2196f3;
    color: white;
}

.flow-item.walk {
    background: #e3f2fd;
    color: #1976d2;
}

.flow-item.bus {
    background: #ffebee;
    color: #d32f2f;
}

.flow-item.station {
    background: #f3e5f5;
    color: #7b1fa2;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
}

.flow-item.boarding {
    background: #4caf50;
    color: white;
    white-space: nowrap;
}

.flow-item.alighting {
    background: #f44336;
    color: white;
    white-space: nowrap;
}

.flow-item.transit {
    background: #2196f3;
    color: white;
    white-space: nowrap;
}

.flow-arrow {
    color: #666;
    font-weight: bold;
    font-size: 0.8rem;
}

.time-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.time-item {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.time-arrow {
    color: #666;
    font-weight: bold;
    font-size: 0.9rem;
}

.time-breakdown {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.time-breakdown span {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.station-info {
    display: flex;
    gap: 15px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.station-item {
    color: #666;
    font-size: 0.8rem;
    background: #fff3e0;
    padding: 3px 8px;
    border-radius: 8px;
    border-left: 2px solid #ff9800;
}

.route-actions {
    display: flex;
    gap: 6px;
}

.view-route-btn, .show-route-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.view-route-btn:hover {
    background: #5a6268;
}

.show-route-btn {
    background: #6c757d;
}

.show-route-btn:hover {
    background: #5a6268;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* 상세 정보 모달 스타일 */
.route-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.1rem;
}

.route-info, .time-breakdown, .station-details {
    margin-bottom: 0;
}

.time-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.time-item.total {
    border-top: 2px solid #4CAF50;
    border-bottom: none;
    font-weight: bold;
    background: #f8f9fa;
    padding: 12px;
    margin-top: 10px;
    border-radius: 4px;
}

.bus-stations {
    margin: 8px 0;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #ff9800;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.route-info p, .station-details p {
    margin: 5px 0;
    color: #666;
}

/* 버스 경로 상세 스타일 */
.route-stations {
    margin-bottom: 25px;
}

.bus-route-flow {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.stations-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background: #fafafa;
}

.station-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    border-left: 4px solid #ddd;
    background: white;
    transition: all 0.2s ease;
}

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

.station-item.start-station {
    border-left-color: #4caf50;
    background: #f1f8e9;
}

.station-item.end-station {
    border-left-color: #f44336;
    background: #ffebee;
}

.station-item.middle-station {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.station-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #666;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.start-station .station-number {
    background: #4caf50;
}

.end-station .station-number {
    background: #f44336;
}

.middle-station .station-number {
    background: #2196f3;
}

.station-info {
    flex: 1;
    min-width: 0;
}

.station-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    word-break: break-word;
}

.station-label {
    font-size: 0.75rem;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 액션 버튼 스타일 */
.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.action-buttons .btn {
    padding: 12px 20px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

/* 추가 반응형 브레이크포인트 */

/* 태블릿 세로 모드 */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 12px;
        width: 100%;
    }
    
    .map-container {
        min-height: 48vh; /* 80% 수준 */
        width: 100%;
    }
    
    .map {
        height: 48vh; /* 80% 수준 */
    }
    
    .info-panel {
        max-height: calc(100vh - 120px); /* 전체 화면 높이에서 헤더와 여백 제외 */
        width: 100%;
        height: calc(100vh - 120px);
        font-size: 0.75rem; /* 태블릿 폰트 크기 */
        overflow-y: auto;
    }
    
    /* info-panel 내부 요소들 태블릿 최적화 */
    .info-panel h3, .info-panel h4 {
        font-size: 1.1rem;
    }
    
    .info-panel .btn {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
    
    .info-panel .label, .info-panel .bus-type-label {
        font-size: 0.9rem;
    }
    
    .info-panel .text, .info-panel .route-info-label {
        font-size: 0.9rem;
    }
    
    /* 시간 버튼 태블릿에서 숨김 */
    .time-hour-buttons {
        display: none;
    }
    
    .route-info {
        display: none;
    }
    
    .hour-btn {
        font-size: 0.75rem;
        padding: 4px 6px;
        min-height: 30px;
    }
    
    .preset-btn {
        font-size: 0.75rem;
        padding: 4px 6px;
    }
    
    /* 시간 입력 태블릿 최적화 - 한 줄 유지 */
    .time-main-row {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        flex-wrap: nowrap;
    }
    
    .time-label {
        font-size: 0.9rem;
        min-width: 60px;
        flex-shrink: 0;
    }
    
    .time-inputs {
        flex-direction: row;
        gap: 6px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group {
        flex-direction: row;
        align-items: center;
        gap: 3px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group label {
        display: none;
    }
    
    .time-input {
        width: 100%;
        min-width: 70px;
        font-size: 0.8rem;
        padding: 3px 5px;
    }
    
    .time-arrow-btn {
        width: 18px;
        height: 14px;
        font-size: 9px;
        flex-shrink: 0;
    }
    
    .time-separator {
        font-size: 0.8rem;
        margin: 0 2px;
        flex-shrink: 0;
    }
}

/* 모바일 가로 모드 */
@media (max-width: 896px) and (orientation: landscape) {
    .main-content {
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }
    
    .map-container {
        flex: 1;
        min-height: 64vh; /* 80% 수준 */
        width: 100%;
    }
    
    .map {
        height: 64vh; /* 80% 수준 */
    }
    
    .info-panel {
        flex: 1;
        max-height: calc(100vh - 120px); /* 전체 화면 높이에서 헤더와 여백 제외 */
        width: 100%;
        height: calc(100vh - 120px);
        overflow-y: auto;
    }
    
    .system-header h1 {
        font-size: 1.5rem;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .container {
        padding: 4px;
        width: 100%;
    }
    
    .main-content {
        gap: 6px;
        width: 100%;
    }
    
    .map-container {
        min-height: 36vh; /* 80% 수준 */
        width: 100%;
    }
    
    .map {
        height: 36vh; /* 80% 수준 */
        min-height: 200px;
    }
    
    .info-panel {
        max-height: calc(100vh - 120px); /* 전체 화면 높이에서 헤더와 여백 제외 */
        width: 100%;
        height: calc(100vh - 120px);
        font-size: 0.65rem; /* 작은 모바일 폰트 크기 */
        overflow-y: auto;
    }
    
    /* info-panel 내부 요소들 작은 모바일 최적화 */
    .info-panel h3, .info-panel h4 {
        font-size: 0.9rem;
    }
    
    .info-panel .btn {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    
    .info-panel .label, .info-panel .bus-type-label {
        font-size: 0.9rem;
    }
    
    .info-panel .text, .info-panel .route-info-label {
        font-size: 0.9rem;
    }
    
    .info-panel .match-item h4 {
        font-size: 0.7rem;
    }
    
    .info-panel .total-time {
        font-size: 0.65rem;
    }
    
    .info-panel .departure-time {
        font-size: 0.55rem;
    }
    
    .info-panel .route-flow {
        font-size: 0.55rem;
    }
    
    .info-panel .flow-item {
        font-size: 0.55rem;
    }
    
    .info-panel .flow-arrow {
        font-size: 0.55rem;
    }
    
    .system-header {
        padding: 0;
    }
    
    .system-header h1 {
        font-size: 1.5rem;
    }
    
    /* bus-type-section 작은 모바일 최적화 - 한 행 유지 */
    .bus-type-header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
    }
    
    .bus-type-label {
        min-width: 45px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .route-search {
        flex: 1;
        min-width: 60px;
        font-size: 0.9rem;
        padding: 2px 4px;
    }
    
    .route-dropdown {
        flex: 1.5;
        min-width: 80px;
        font-size: 0.7rem;
        padding: 2px 4px;
    }
    
    .btn-view {
        min-width: 40px;
        font-size: 0.9rem;
        padding: 2px 6px;
        flex-shrink: 0;
    }
    
    .btn-find {
        font-size: 12px;
    }
    
    /* 시간 버튼 작은 모바일에서 숨김 */
    .time-hour-buttons {
        display: none;
    }
    
    .route-info {
        display: none;
    }
    
    .hour-btn {
        font-size: 0.65rem;
        padding: 2px 4px;
        min-height: 28px;
    }
    
    .preset-btn {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    /* 시간 입력 작은 모바일 최적화 - 한 줄 유지 */
    .time-main-row {
        flex-direction: row;
        align-items: center;
        gap: 3px;
        flex-wrap: nowrap;
    }
    
    .time-label {
        font-size: 0.9rem;
        min-width: 45px;
        flex-shrink: 0;
    }
    
    .time-inputs {
        flex-direction: row;
        gap: 3px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group {
        flex-direction: row;
        align-items: center;
        gap: 1px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group label {
        display: none;
    }
    
    .time-input {
        width: 100%;
        min-width: 50px;
        font-size: 0.8rem;
        padding: 1px 3px;
    }
    
    .time-arrow-btn {
        width: 14px;
        height: 10px;
        font-size: 7px;
        flex-shrink: 0;
    }
    
    .time-separator {
        font-size: 0.7rem;
        margin: 0 1px;
        flex-shrink: 0;
    }
}

/* 매우 작은 모바일 (360px 이하) */
@media (max-width: 360px) {
    .container {
        padding: 2px;
        width: 100%;
    }
    
    .system-header h1 {
        font-size: 1.3rem;
    }
    
    .map {
        min-height: 200px;
    }
    
    .info-panel {
        font-size: 0.6rem; /* 매우 작은 모바일 폰트 크기 */
    }
    
    /* info-panel 내부 요소들 매우 작은 모바일 최적화 */
    .info-panel h3, .info-panel h4 {
        font-size: 0.8rem;
    }
    
    .info-panel .btn {
        font-size: 0.55rem;
        padding: 2px 4px;
    }
    
    .info-panel .label, .info-panel .bus-type-label {
        font-size: 0.9rem;
    }
    
    .info-panel .text, .info-panel .route-info-label {
        font-size: 0.9rem;
    }
    
    .info-panel .match-item h4 {
        font-size: 0.65rem;
    }
    
    .info-panel .total-time {
        font-size: 0.6rem;
    }
    
    .info-panel .departure-time {
        font-size: 0.5rem;
    }
    
    .info-panel .route-flow {
        font-size: 0.5rem;
    }
    
    .info-panel .flow-item {
        font-size: 0.5rem;
    }
    
    .info-panel .flow-arrow {
        font-size: 0.5rem;
    }
    
    /* bus-type-section 매우 작은 모바일 최적화 - 한 행 유지 */
    .bus-type-section {
        padding: 2px 4px;
        margin-bottom: 2px;
    }
    
    .bus-type-header {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 4px;
    }
    
    .bus-type-label {
        min-width: 40px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }
    
    .route-search {
        flex: 1;
        min-width: 50px;
        font-size: 0.9rem;
        padding: 1px 3px;
    }
    
    .route-dropdown {
        flex: 1.5;
        min-width: 70px;
        font-size: 0.7rem;
        padding: 1px 3px;
    }
    
    .btn-view {
        min-width: 35px;
        font-size: 0.9rem;
        padding: 1px 5px;
        flex-shrink: 0;
    }
    
    .btn-find {
        font-size: 12px;
    }
    
    /* 시간 버튼 매우 작은 모바일에서 숨김 */
    .time-hour-buttons {
        display: none;
    }
    
    .route-info {
        display: none;
    }
    
    .hour-btn {
        font-size: 0.6rem;
        padding: 1px 3px;
        min-height: 24px;
    }
    
    .preset-btn {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    
    /* 시간 입력 매우 작은 모바일 최적화 - 한 줄 유지 */
    .time-main-row {
        flex-direction: row;
        align-items: center;
        gap: 2px;
        flex-wrap: nowrap;
    }
    
    .time-label {
        font-size: 0.9rem;
        min-width: 40px;
        flex-shrink: 0;
    }
    
    .time-inputs {
        flex-direction: row;
        gap: 2px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group {
        flex-direction: row;
        align-items: center;
        gap: 1px;
        flex: 1;
        min-width: 0;
    }
    
    .time-input-group label {
        display: none;
    }
    
    .time-input {
        width: 100%;
        min-width: 40px;
        font-size: 0.8rem;
        padding: 1px 2px;
    }
    
    .time-arrow-btn {
        width: 12px;
        height: 8px;
        font-size: 6px;
        flex-shrink: 0;
    }
    
    .time-separator {
        font-size: 0.6rem;
        margin: 0 1px;
        flex-shrink: 0;
    }
}

/* 카드 활성화 스타일 */
.match-item {
    cursor: pointer;
    transition: all 0.3s ease;
}

.match-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.match-item.active {
    border: 2px solid #2196f3;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.3);
}

.match-item.active .match-header h4 {
    color: #1976d2;
}

/* 경로보기 버튼 활성화 스타일 */
.show-route-btn {
    transition: all 0.3s ease;
}

.show-route-btn.active {
    background: #2196f3 !important;
    color: white !important;
    border-color: #1976d2 !important;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.show-route-btn.active:hover {
    background: #1976d2 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

/* 모바일 슬라이드 토글 기능 */
.mobile-toggle-header {
    display: none;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-bottom: none;
    border-radius: 0;
    cursor: pointer;
    user-select: none;
    min-height: 10px;
    margin-bottom: 0;
}

.toggle-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.mobile-toggle-btn {
    background: #0056b3;
    border: 0;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.mobile-toggle-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

.toggle-text {
    font-size: 0.9rem;
    font-weight: 500;
}

.toggle-icon {
    font-size: 0.8rem;
}

/* 슬라이드 컨테이너 */
.bus-selection-slider {
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.bus-selection-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

/* 모바일에서만 슬라이드 기능 활성화 */
@media (max-width: 1024px) {
    .mobile-toggle-header {
        display: flex;
    }
    
    .top-bus-selection {
        padding: 0;
        margin-bottom: 0;
        background: transparent;
        border: none;
    }
    
    .bus-selection-slider {
        max-height: 0;
        opacity: 0;
        margin: 0;
        padding: 0;
        border: none;
        overflow: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-top: none;
    }
    
    .bus-selection-slider.expanded {
        max-height: 1000px;
        opacity: 1;
        padding: 8px;
        background: #f8f9fa;
        border: 1px solid #e9ecef;
        border-top: none;
    }
    
    .bus-selection-content {
        transform: translateY(-10px);
        margin: 0;
        padding: 0;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .bus-selection-slider.expanded .bus-selection-content {
        transform: translateY(0);
    }
}

/* 데스크톱에서는 슬라이드 기능 비활성화 */
@media (min-width: 1025px) {
    .mobile-toggle-header {
        display: none !important;
    }
    
    .bus-selection-slider {
        max-height: none !important;
        opacity: 1 !important;
    }
    
    .bus-selection-content {
        transform: translateY(0) !important;
    }
}
