:root {
    --bg: #fff7ed; /* orange-50 background */
    --card-bg: #ffffff;
    --border: rgba(0, 0, 0, 0.05); /* very light border */
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #f97316; /* orange-500 accent */
    --accent-glow: rgba(249, 115, 22, 0.1);
    --font: 'Red Hat Display', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn, .icon-btn {
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border-radius: 10px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-btn:hover, .icon-btn:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.header h1 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Search Section */
.search-section {
    padding: 1.5rem 1rem;
    background: var(--bg);
}

.route-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.city-input {
    flex: 1;
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: none;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.3s ease;
}

.city-input:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.city-input label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.city-input span {
    font-size: 1.1rem;
    font-weight: 600;
}

.swap-btn {
    width: 40px;
    height: 40px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.swap-btn:hover {
    transform: rotate(180deg);
    box-shadow: 0 0 20px var(--accent-glow);
}

.swap-btn:active {
    transform: rotate(180deg) scale(0.9);
}

.date-box {
    padding: 1.25rem 1.5rem;
    background: var(--card-bg);
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border-radius: 24px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.date-box:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.date-box label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.date-box span {
    font-size: 1.1rem;
    font-weight: 600;
}

.search-btn {
    width: 100%;
    padding: 1.25rem;
    background: #111827; /* Dark black button in contrast to light bg */
    border: none;
    border-radius: 100px;
    color: #ffffff;
    font-family: var(--font);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Results Section */
.results-section {
    padding: 0 1rem 1rem;
}

.results-section.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.results-header span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Bus Card */
.bus-card {
    background: var(--card-bg);
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.03);
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bus-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.bus-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.bus-name {
    font-size: 1rem;
    font-weight: 600;
}

.bus-type {
    font-size: 0.75rem;
    color: var(--accent);
    background: rgba(255, 170, 0, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

.bus-route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.route-time {
    text-align: center;
    min-width: 60px;
}

.route-time .time {
    font-size: 1.25rem;
    font-weight: 700;
    display: block;
}

.route-time .city {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.route-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 1rem;
    position: relative;
}

.route-line::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 6px solid var(--text-muted);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.bus-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bus-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.bus-seats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 24px 24px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease;
}

.modal-content.small {
    max-height: 60vh;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-btn {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    border-color: var(--accent);
    background: rgba(255, 170, 0, 0.1);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--card-bg);
    z-index: 10;
}

.search-box i {
    color: var(--text-muted);
    font-size: 1rem;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 1rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

/* Cities List */
.cities-list {
    padding: 0.5rem 0;
    max-height: 50vh;
    overflow-y: auto;
}

.city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.city-item:last-child {
    border-bottom: none;
}

.city-item:hover {
    background: rgba(255, 170, 0, 0.05);
}

.city-item.selected {
    background: rgba(255, 170, 0, 0.1);
}

.city-info {
    display: flex;
    flex-direction: column;
}

.city-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.city-state {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.city-item i {
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.city-item.selected i {
    opacity: 1;
}

.no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Calendar */
.calendar {
    padding: 1rem;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-header button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-header button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.calendar-header span {
    font-weight: 600;
    font-size: 1.1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    text-align: center;
}

.calendar-day-header {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.calendar-day:hover:not(.disabled):not(.empty) {
    background: rgba(255, 170, 0, 0.1);
    border-color: var(--accent);
}

.calendar-day.selected {
    background: var(--accent);
    color: #000;
    font-weight: 600;
}

.calendar-day.disabled {
    color: var(--text-muted);
    opacity: 0.3;
    cursor: not-allowed;
}

.calendar-day.today {
    border-color: var(--accent);
    color: var(--accent);
}

.calendar-day.empty {
    pointer-events: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media (min-width: 768px) {
    .modal-content {
        max-width: 500px;
        margin: 0 auto;
        border-radius: 24px;
        max-height: 70vh;
        margin-bottom: 2rem;
    }
    
    .search-section {
        max-width: 600px;
        margin: 0 auto;
        padding: 2rem;
    }
    
    .results-section {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .empty-state {
        max-width: 600px;
        margin: 0 auto;
    }
}