/* Base & Reset */
:root {
    --primary: #c22300; /* GSRTC Red */
    --primary-hover: #a11c00;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --bg-main: #F8FAFC;
    --bg-card: #FFFFFF;
    --border: #E2E8F0;
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 15px rgba(0,0,0,0.05);
    --transition: all 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

.fw-light { font-weight: 300; }
.hidden { display: none !important; }

/* Header */
.header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

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

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    margin-left: 24px;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: white;
    padding: 80px 0 100px;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 18px;
    color: #94A3B8;
    margin-bottom: 48px;
}

/* Search Box */
.search-box {
    background: var(--bg-card);
    padding: 12px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    transform: translateY(40px);
}

.search-form {
    display: flex;
    gap: 12px;
    align-items: center;
}

.input-group {
    flex: 1;
    position: relative;
    text-align: left;
    background: var(--bg-main);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: var(--transition);
}

.input-group:focus-within {
    border-color: var(--primary);
    background: var(--bg-card);
}

.input-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.input-group input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
}

.input-group input::placeholder {
    color: #CBD5E1;
    font-weight: 400;
}

/* Swap Button */
.swap-btn-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.swap-btn:hover {
    background: var(--bg-main);
    transform: rotate(180deg);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 32px;
    height: 62px; /* matches input-group height approx */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(194, 35, 0, 0.3);
}

/* Suggestions Dropdown */
.suggestions-list {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    list-style: none;
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.suggestions-list li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background: var(--bg-main);
    color: var(--primary);
}

/* Main Content & Results */
.main-content {
    padding: 80px 0;
}

.results-header {
    margin-bottom: 32px;
}

.results-header h3 {
    font-size: 24px;
    font-weight: 700;
}

.results-header p {
    color: var(--text-muted);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Bus Card */
.bus-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.bus-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #CBD5E1;
}

.bus-info-main {
    display: flex;
    align-items: center;
    gap: 48px;
}

.time-block {
    text-align: center;
}

.time-block h4 {
    font-size: 22px;
    font-weight: 700;
}

.time-block p {
    font-size: 14px;
    color: var(--text-muted);
}

.journey-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
}

.journey-duration {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-main);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.journey-line {
    width: 100%;
    height: 2px;
    background: var(--border);
    position: relative;
}

.journey-line::before, .journey-line::after {
    content: '';
    position: absolute;
    top: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
}

.journey-line::before { left: 0; }
.journey-line::after { right: 0; }

.journey-km {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

.bus-details h4 {
    font-size: 16px;
    font-weight: 600;
}

.bus-details p {
    font-size: 14px;
    color: var(--text-muted);
}

.bus-price-action {
    text-align: right;
}

.bus-price {
    font-size: 24px;
    font-weight: 700;
    color: #059669; /* Emerald 600 */
    margin-bottom: 8px;
}

.bus-price span {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 400;
}

.btn-book {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 8px 24px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-book:hover {
    background: var(--primary);
    color: white;
}

/* Loading & Empty State */
.loading {
    text-align: center;
    padding: 60px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.empty-state svg {
    color: #CBD5E1;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-main);
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }
    
    .swap-btn-container {
        transform: rotate(90deg);
        margin: -8px 0;
        z-index: 10;
    }
    
    .input-group, .btn-primary {
        width: 100%;
    }
    
    .bus-card {
        flex-direction: column;
        align-items: stretch;
        gap: 24px;
    }
    
    .bus-info-main {
        justify-content: space-between;
        gap: 16px;
    }
    
    .journey-meta {
        min-width: auto;
        flex: 1;
        padding: 0 16px;
    }
    
    .bus-price-action {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid var(--border);
        padding-top: 16px;
    }
    
    .bus-price { margin-bottom: 0; }
}

/* Boarding Points Accordion */
.boarding-points-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: none;
    animation: slideDown 0.3s ease-out;
}

.boarding-points-section.active {
    display: block;
}

.points-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.point-column h5 {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.point-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.point-item span.time {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.point-item span.location {
    font-size: 0.9rem;
}

.btn-details {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 1rem;
}

.btn-details:hover {
    border-color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .points-grid { grid-template-columns: 1fr; gap: 1rem; }
}
