/* Global Styles */
:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --secondary-color: #2c3e50;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --radius: 5px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background-color: var(--secondary-color);
    color: white;
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .logo {
        margin-bottom: 0;
    }
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
}

.logo i {
    font-size: 1.8rem;
}

.tagline {
    font-size: 1rem;
    opacity: 0.8;
}

.main-nav {
    margin-top: 1rem;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 1rem;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem;
    transition: color 0.3s;
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Main Content */
main {
    padding: 2rem 0;
}

.booking-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (min-width: 992px) {
    .booking-container {
        grid-template-columns: 1fr 1fr;
    }
}

/* Map Section */
.map-container {
    position: relative;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 1rem;
}

#map {
    height: 500px;
    width: 100%;
}

.map-tools {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
}

#reset-map {
    background-color: var(--gray-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

#reset-map:hover {
    background-color: var(--secondary-color);
}

.map-legend {
    display: flex;
    gap: 1rem;
}

.map-legend div {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
}

.legend-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
}

.legend-icon.start {
    background-color: green;
}

.legend-icon.stop {
    background-color: orange;
}

.legend-icon.end {
    background-color: red;
}

/* Custom Markers */
.custom-marker i {
    font-size: 2rem;
}

.start-marker i {
    color: green;
}

.stop-marker i {
    color: orange;
}

.end-marker i {
    color: red;
}

/* Route Popup */
.route-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 300px;
    max-height: 80%;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}

.popup-header {
    padding: 0.8rem;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    font-size: 1.1rem;
    margin: 0;
}

#close-route-popup {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.popup-content {
    padding: 1rem;
}

/* Form Styles */
form {
    background-color: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.form-tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 0.8rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-color);
    position: relative;
    transition: color 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.form-section {
    margin-bottom: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Input with icon styles - Fixed positioning */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-color);
    z-index: 1;
    width: 20px;
    text-align: center;
    font-size: 16px;
    pointer-events: none; /* Make sure icon doesn't interfere with input */
}

.input-with-icon input,
.input-with-icon select,
.input-with-icon .selectize-input,
.input-with-icon textarea {
    width: 100%;
    padding-left: 45px !important; /* Force left padding to make room for icon */
}

/* Ensure input text doesn't overlap with icon */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea,
.selectize-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: white;
    line-height: 1.4;
}

/* Special case for date and time inputs which can have browser-specific styling */
input[type="date"],
input[type="time"] {
    padding-left: 45px !important;
    min-height: 42px; /* Ensure consistent height */
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus,
.selectize-input.focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark-color);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background-color: var(--gray-color);
    color: white;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-group {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Stop Points */
#stops-container {
    margin: 1.5rem 0;
}

.stop-point {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.8rem;
    background-color: var(--light-color);
    border-radius: var(--radius);
}

.stop-point input[type="number"] {
    width: 80px;
}

.remove-stop {
    background-color: var(--danger-color);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
}

#add-stop {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Range Sliders */
.range-slider-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.noUiSlider {
    height: 10px;
    margin-bottom: 1rem;
}

.noUiSlider .noUi-connect {
    background-color: var(--primary-color);
}

.noUiSlider .noUi-handle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--primary-color);
    background-color: white;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--light-gray);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Summary Section */
.summary-details {
    background-color: var(--light-color);
    border-radius: var(--radius);
    padding: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--light-gray);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-item.total {
    font-weight: 700;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--light-gray);
    border-bottom: none;
    padding-top: 1rem;
}

/* Payment Section */
.payment-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

@media (min-width: 768px) {
    .payment-options {
        grid-template-columns: repeat(3, 1fr);
    }
}

.payment-option {
    position: relative;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.payment-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.payment-option label img,
.payment-option label i {
    margin-bottom: 0.5rem;
}

.payment-option label i {
    font-size: 2rem;
    color: var(--primary-color);
}

.payment-option:has(input:checked) {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.payment-element {
    margin: 1.5rem 0;
}

.card-element {
    padding: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--radius);
}

.card-errors {
    color: var(--danger-color);
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2.5rem 0 1.5rem;
    margin-top: 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.footer-links h3, 
.footer-contact h3, 
.footer-social h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a, 
.footer-contact a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover, 
.footer-contact a:hover {
    color: var(--primary-color);
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    transition: all 0.3s;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .form-tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .tab-btn {
        border-bottom: 1px solid var(--light-gray);
    }

    .tab-btn.active::after {
        display: none;
    }

    .tab-btn.active {
        background-color: var(--primary-color);
        color: white;
    }
    
    .footer-content {
        text-align: center;
    }
    
    .footer-contact p {
        justify-content: center;
    }
    
    .social-icons {
        justify-content: center;
    }
}

/* Leaflet Map Customizations */
.leaflet-routing-container {
    background-color: white;
    padding: 10px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.leaflet-routing-alt h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.leaflet-routing-alt table {
    font-size: 0.9rem;
}

/* Selectize Customizations */
.selectize-input {
    padding: 0.8rem 1rem;
}

.selectize-dropdown {
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--radius) var(--radius);
}

.selectize-dropdown-content {
    max-height: 200px;
}

.selectize-dropdown-content .option {
    padding: 0.7rem 1rem;
}