:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f8f9fa;
    --accent-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

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

.main-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.search-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.station-input {
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.station-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(44, 90, 160, 0.25);
}

.btn-search {
    background: var(--primary-color);
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-search:hover {
    background: #1e3d6f;
    transform: translateY(-2px);
}

.train-card {
    background: white;
    border-radius: 15px;
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.train-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.train-type {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.train-type.ic {
    background: var(--accent-color);
}

.train-type.ir {
    background: var(--warning-color);
    color: #000;
}

.train-type.r {
    background: #6c757d;
}

.time-display {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.duration {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.price {
    color: var(--accent-color);
    font-size: 20px;
    font-weight: 700;
}

.route-badge {
    cursor: pointer;
    transition: all 0.3s ease;
}

.route-badge:hover {
    background: var(--primary-color) !important;
    color: white !important;
    transform: translateY(-2px);
}

.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.loading {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.train-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-on-time {
    background: #d4edda;
    color: #155724;
}

.status-delayed {
    background: #fff3cd;
    color: #856404;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.connection-line {
    border-left: 3px dashed #dee2e6;
    margin-left: 15px;
    padding-left: 20px;
}

.station-stop {
    position: relative;
    padding: 8px 0;
}

.station-stop::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* Elegant Detailed Results */
.elegant-results {
    margin: 30px 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.results-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.results-header h2 {
    font-size: 2.2rem;
    font-weight: 300;
    margin: 0 0 10px 0;
    letter-spacing: 1px;
}

.route-arrow {
    font-weight: 100;
    opacity: 0.8;
    margin: 0 15px;
}

.results-count {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

.connection-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.04);
}

.card-header {
    display: flex;
    align-items: center;
    padding: 24px 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.connection-number {
    width: 40px;
    height: 40px;
    background: #2c5aa0;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-right: 20px;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.journey-overview {
    flex: 1;
}

.time-range {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2c5aa0;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.duration {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
}

.connection-type {
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.connection-type.direct {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.connection-type.transfer {
    background: linear-gradient(135deg, #ffc107, #fd7e14);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.journey-details {
    padding: 20px;
}

.segment {
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 15px;
    background: #fafbfc;
}

.segment:last-child {
    margin-bottom: 0;
}

.train-info-detailed {
    margin-bottom: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #2c5aa0;
}

.train-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.train-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c5aa0;
}

.train-category {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.technical-specs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #e9ecef;
}

.spec-item {
    background: #f8f9fa;
    color: #495057;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
}

.train-specs {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.operator {
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

.service-class {
    background: #f0f8ff;
    color: #0066cc;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 500;
}

.facilities {
    color: #28a745;
    font-size: 0.8rem;
    font-weight: 500;
}

.route-timeline {
    display: flex;
    align-items: center;
    gap: 20px;
}

.station-stop {
    text-align: center;
    min-width: 140px;
}

.stop-time {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.stop-name {
    font-size: 0.95rem;
    color: #2c5aa0;
    font-weight: 600;
    margin-bottom: 2px;
}

.platform {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.journey-line {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.direct-line {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.transfer-line {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.travel-time {
    background: white;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    border: 1px solid #e9ecef;
}

.journey-line::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #28a745;
}

.journey-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #dc3545;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #dc3545;
}

.transfer-break {
    display: flex;
    justify-content: center;
    margin: 25px 0;
    position: relative;
}

.transfer-break::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 60px;
    background: #dee2e6;
    border-radius: 1px;
}

.transfer-details {
    background: #fff8e1;
    padding: 15px 25px;
    border-radius: 15px;
    text-align: center;
    border: 2px solid #ffecb3;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.2);
}

.transfer-duration {
    display: block;
    font-weight: 700;
    color: #f57c00;
    font-size: 1rem;
    margin-bottom: 4px;
}

.transfer-station {
    display: block;
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
    margin-bottom: 4px;
}

.transfer-instructions {
    font-size: 0.8rem;
    color: #999;
    font-style: italic;
}

@media (max-width: 768px) {
    .results-header {
        padding: 20px;
        margin-bottom: 30px;
    }
    
    .results-header h2 {
        font-size: 1.6rem;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .train-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .train-specs {
        justify-content: center;
        gap: 10px;
    }
    
    .route-timeline {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .journey-line {
        width: 4px;
        height: 40px;
        margin: 0 auto;
    }
    
    .journey-line::before, .journey-line::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .journey-line::before {
        top: 0;
    }
    
    .journey-line::after {
        bottom: 0;
        top: auto;
    }
}

.col-md-6 {
    position: relative;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.col-md-4 {
    position: relative;
}
.transfer-timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item, .timeline-transfer {
    position: relative;
    margin-bottom: 15px;
}

.timeline-marker {
    position: absolute;
    left: -30px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: -25px;
    top: 17px;
    width: 2px;
    height: 25px;
    background-color: #dee2e6;
}

.timeline-content {
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border-left: 3px solid #007bff;
}

.timeline-transfer .timeline-content {
    border-left-color: #6c757d;
    background-color: #fff3cd;
}

/* Filament-Inspired Results Design */
.new-results {
    margin: 24px 0;
}

.route-header {
    background: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.route-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: rgb(17 24 39);
}

.found-count {
    background: rgb(239 246 255);
    color: rgb(59 130 246);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 4px;
    display: inline-block;
}

.route-item {
    background: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.route-item:hover {
    border-color: rgb(209 213 219);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.route-item.direct {
    border-left: 3px solid rgb(34 197 94);
}

.route-item.transfer {
    border-left: 3px solid rgb(251 146 60);
}

/* New Horizontal Card Layout */
.journey-card {
    background: white;
    border: 1px solid rgb(229 231 235);
    border-radius: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.journey-card:hover {
    box-shadow: 0 4px 12px 0 rgb(0 0 0 / 0.15);
    transform: translateY(-2px);
}

.journey-card.direct {
    border-left: 4px solid rgb(34 197 94);
}

.journey-card.transfer {
    border-left: 4px solid rgb(251 146 60);
}

.card-left {
    min-width: 140px;
    margin-right: 24px;
}

.train-info {
    text-align: center;
}

.train-badge {
    background: rgb(59 130 246);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 8px;
    display: inline-block;
}

.transfer-badge {
    background: rgb(251 146 60);
}

.journey-duration {
    color: rgb(107 114 128);
    font-size: 0.75rem;
    font-weight: 500;
}

.card-center {
    flex: 1;
    margin-right: 24px;
}

.time-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.departure, .arrival {
    text-align: center;
    min-width: 100px;
}

.time {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgb(17 24 39);
    margin-bottom: 4px;
}

.station {
    font-size: 0.75rem;
    color: rgb(107 114 128);
    font-weight: 500;
}

.journey-line {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0 20px;
}

.line {
    height: 3px;
    background: rgb(34 197 94);
    border-radius: 2px;
    flex: 1;
    position: relative;
}

.transfer-line .line {
    background: rgb(251 146 60);
}

.stops-count {
    position: absolute;
    background: white;
    color: rgb(107 114 128);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgb(229 231 235);
    white-space: nowrap;
}

.card-right {
    min-width: 80px;
}

.details-btn {
    background: rgb(239 246 255);
    color: rgb(59 130 246);
    border: 1px solid rgb(219 234 254);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.details-btn:hover {
    background: rgb(59 130 246);
    color: white;
}

@media (max-width: 768px) {
    .journey-card {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    
    .card-left, .card-center, .card-right {
        margin: 8px 0;
    }
    
    .time-display {
        flex-direction: column;
        gap: 16px;
    }
    
    .journey-line {
        width: 100%;
        margin: 16px 0;
    }
}

.duration {
    color: rgb(107 114 128);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: right;
}

.transfer-info {
    background: rgb(249 250 251);
    padding: 12px 24px;
    border-top: 1px solid rgb(229 231 235);
    font-size: 0.75rem;
    color: rgb(107 114 128);
}

.transfer-info span {
    display: block;
    margin: 2px 0;
    padding: 2px 6px;
    background: rgb(255 251 235);
    border-radius: 4px;
    color: rgb(146 64 14);
    font-weight: 500;
}

@media (max-width: 768px) {
    .new-results .route-main {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .new-results .route-header {
        padding: 12px 16px;
    }
    
    .new-results .route-item {
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    .new-results .route-main {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .new-results .duration {
        text-align: center;
    }
    
    .new-results .route-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
.departure-time, .arrival-time {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(17 24 39);
}
/* Expandable Stops Details */
.stops-details {
    border-top: 1px solid rgb(229 231 235);
    background: rgb(249 250 251);
    padding: 16px 24px;
    margin-top: 0;
}

.stops-list {
    max-height: 300px;
    overflow-y: auto;
}

.stop-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    gap: 16px;
    padding: 8px 0;
    align-items: center;
    border-bottom: 1px solid rgb(229 231 235);
}

.stop-row:last-child {
    border-bottom: none;
}

.stop-row .stop-time {
    font-weight: 600;
    color: rgb(17 24 39);
    font-size: 0.875rem;
}

.stop-row .stop-name {
    color: rgb(75 85 99);
    font-size: 0.875rem;
}

.stop-row .stop-duration {
    color: rgb(107 114 128);
    font-size: 0.75rem;
    text-align: right;
}

.transfer-segment {
    margin-bottom: 16px;
}

.transfer-segment:last-child {
    margin-bottom: 0;
}

.segment-title {
    background: rgb(251 146 60);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: inline-block;
}

.transfer-info-row {
    text-align: center;
    padding: 12px 0;
    margin: 16px 0;
    background: rgb(254 249 195);
    border-radius: 8px;
}

.transfer-info-row .transfer-time {
    color: rgb(146 64 14);
    font-weight: 600;
    font-size: 0.875rem;
}
.horizontal-stops {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    overflow-x: auto;
    white-space: nowrap;
}

.stop-station {
    flex-shrink: 0;
}

.stop-dot {
    font-size: 4px;
    color: #ccc;
    flex-shrink: 0;
}

.fw-bold {
    font-weight: 600;
    color: #333;
}
.train-type-badge {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
}

.ic-badge {
    background: #1e40af;
    color: white;
}

.ir-badge {
    background: #059669;
    color: white;
}

.r-badge {
    background: #dc2626;
    color: white;
}

.service-icons {
    display: flex;
    gap: 8px;
    font-size: 14px;
    color: #666;
    align-items: center;
    min-height: 20px;
}

.service-icons i {
    width: 16px;
    text-align: center;
    opacity: 1 !important;
    visibility: visible !important;
}

.journey-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 16px;
}

.card-body {
    padding: 16px;
}
.vertical-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-segment {
    padding: 12px 0;
}

.transfer-indicator {
    border-left: 2px dashed #ccc;
    margin-left: 50px;
    padding-left: 20px;
    background: #f8f9fa;
    border-radius: 4px;
}

.transfer-badge {
    background: #6b7280;
    color: white;
}
