/* Professional Trip Calculator Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

h1 {
    color: white;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Map Section (Bottom of page) */
.map-section {
    margin-top: 20px;
    scroll-margin-top: 20px; /* Offset for smooth scroll */
}

.map-section h3 {
    margin-bottom: 15px;
    color: #444;
}

.map-container {
    width: 100%;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f5f5f5;
}

.map-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.route-map {
    width: 100%;
    height: 100%;
    border: none;
}

/* View Map Link */
.view-map-link {
    float: right;
    font-size: 0.85em;
    color: #667eea;
    text-decoration: none;
    font-weight: normal;
    transition: color 0.2s ease;
}

.view-map-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Form Styles */
.form-section {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95em;
}

.address-input,
select {
    width: 100%;
    padding: 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.address-input:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
    cursor: pointer;
    background-color: white;
}

/* Checkbox Styles */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #444;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label span {
    user-select: none;
}

/* Fuel Unit Toggle Styles */
.fuel-unit-toggle {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #444;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-label span {
    user-select: none;
}

/* Toll Location Link Styles */
.toll-location-link {
    margin-left: 6px;
    text-decoration: none;
    font-size: 0.9em;
    transition: transform 0.2s ease;
    display: inline-block;
}

.toll-location-link:hover {
    transform: scale(1.2);
}

/* Button Styles */
.button-group {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

button {
    flex: 1;
    padding: 16px;
    font-size: 1.05em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.calculate-btn:active {
    transform: translateY(0);
}

.reset-btn {
    background: #f5f5f5;
    color: #666;
}

.reset-btn:hover {
    background: #e0e0e0;
}

/* Loading Indicator */
#loadingIndicator {
    display: none;
    text-align: center;
    padding: 30px;
    color: #667eea;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Section */
.results {
    display: none;
}

.results.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* Journey Summary Card */
.journey-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.journey-summary h3 {
    font-size: 1.2em;
    margin-bottom: 20px;
    opacity: 0.95;
}

.journey-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
}

.journey-item {
    text-align: center;
}

.journey-label {
    font-size: 0.85em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.journey-value {
    font-size: 2em;
    font-weight: 700;
    line-height: 1.2;
}

.journey-subtext {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 3px;
}

/* Traffic Alert */
.traffic-alert {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 107, 107, 0.2);
    border-left: 4px solid #ff6b6b;
    border-radius: 6px;
    display: none;
}

.traffic-alert.show {
    display: block;
}

.traffic-alert-icon {
    font-size: 1.2em;
    margin-right: 8px;
}

/* Cost Breakdown */
.cost-breakdown {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
}

.cost-breakdown h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #333;
}

.cost-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.cost-section:last-of-type {
    border-bottom: 2px solid #667eea;
}

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

.cost-item-label {
    font-size: 1.05em;
    font-weight: 600;
    color: #333;
}

.cost-item-value {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
}

.cost-details {
    padding-left: 25px;
    margin-top: 8px;
}

.cost-detail-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.9em;
    color: #666;
}

.cost-detail-line.sub-item {
    padding-left: 20px;
    font-size: 0.85em;
    color: #888;
}

.cost-detail-label {
    flex: 1;
}

.cost-detail-value {
    font-weight: 500;
    color: #444;
}

.total-cost {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-cost-label {
    font-size: 1.2em;
    font-weight: 700;
    color: #667eea;
}

.total-cost-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #667eea;
}

/* Toll Gates Info */
.toll-gates-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.toll-gates-card h4 {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #333;
}

.toll-gate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.toll-gate-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

/* Cost Per KM Badge */
.cost-per-km {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 20px;
}

.cost-per-km-label {
    font-size: 0.9em;
    opacity: 0.9;
    margin-bottom: 5px;
}

.cost-per-km-value {
    font-size: 2em;
    font-weight: 700;
}

/* Info Note */
.info-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #856404;
    line-height: 1.6;
}

.info-note strong {
    color: #856404;
}

/* Route Provider */
#routeProvider {
    text-align: center;
    color: #999;
    font-size: 0.85em;
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 600px) {
    h1 {
        font-size: 1.8em;
    }

    .journey-value {
        font-size: 1.5em;
    }

    .total-cost-value {
        font-size: 1.5em;
    }

    .button-group {
        flex-direction: column;
    }

    button {
        width: 100%;
    }
}
