/* Taxi Fare Calculator Styles */

.gh-taxi-calculator-wrapper {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Field Groups */
.taxi-field-group {
    margin-bottom: 20px;
}

.taxi-field-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.taxi-field-help {
    color: #666;
    font-size: 12px;
    font-style: italic;
    margin-top: 4px;
    display: block;
}

/* Row Layout */
.taxi-fields-row { display:flex; flex-wrap:wrap; gap:16px; margin-bottom:16px; align-items:flex-end; }

.taxi-field-half {
    flex: 1;
    margin-bottom: 0;
}

.taxi-field-third {
    flex: 1;
    min-width: 150px;
    max-width: 33.33%;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .taxi-fields-row {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
        flex-wrap: nowrap;
        align-items: flex-end;
        margin-bottom: 20px;
    }
    
    .taxi-field-third {
        flex: 1;
        max-width: 32%;
        min-width: 90px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .taxi-field-third .taxi-field-label {
        font-size: 13px;
        margin-bottom: 8px;
        text-align: center;
        line-height: 1.3;
        font-weight: 600;
    }
    
    .taxi-field-third .taxi-compact-select {
        width: 100%;
        max-width: 100% !important;
        min-width: 60px !important;
        text-align: center;
        font-size: 16px; /* Larger for better touch */
        padding: 10px 8px !important;
        border-radius: 8px;
        appearance: none;
        background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230037B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 16px;
        padding-right: 30px !important;
    }
}

/* Very small screens - stack vertically if needed */
@media (max-width: 480px) {
    .taxi-fields-row {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    
    .taxi-field-third {
        max-width: 200px;
        width: 100%;
    }
    
    .taxi-field-third .taxi-field-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .taxi-field-third .taxi-compact-select {
        min-width: 120px !important;
        font-size: 16px;
        padding: 12px 8px !important;
    }
    
    .gh-taxi-calculator-wrapper.gh-taxi-shortcode {
        padding: 16px 12px;
    }
}

/* Input Styling */
.gh-taxi-calculator-wrapper .elementor-field-textual {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e8ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    font-family: 'POLIN', 'Heebo', 'Arial', sans-serif;
}

.gh-taxi-calculator-wrapper .elementor-field-textual:hover {
    border-color: #004DD9;
    box-shadow: 0 2px 6px rgba(0, 55, 181, 0.08);
}

.gh-taxi-calculator-wrapper .elementor-field-textual:focus {
    border-color: #0037B5;
    box-shadow: 0 0 0 3px rgba(0, 55, 181, 0.12), 0 2px 8px rgba(0, 55, 181, 0.15);
    outline: none;
    transform: translateY(-1px);
}

.gh-taxi-calculator-wrapper .elementor-field-textual:read-only {
    background-color: #f5f5f5;
    color: #666;
    cursor: default; /* avoid red forbidden icon */
}

/* City Autocomplete */
.city-autocomplete-container {
    position: relative;
    z-index: 1000;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
}

.city-autocomplete-container.hidden {
    display: none;
}

.city-options {
    padding: 0;
    margin: 0;
}

.autocomplete-row {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
    font-family: 'POLIN', 'Heebo', 'Arial', sans-serif;
}

.autocomplete-row:hover {
    background-color: #f8f9fa;
}

.autocomplete-row:last-child {
    border-bottom: none;
}

.autocomplete-more {
    padding: 10px 15px;
    font-style: italic;
    color: #666;
    font-size: 12px;
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.autocomplete-helper {
    padding: 10px 15px;
    color: #666;
    font-size: 12px;
    text-align: center;
}

/* Fare Display */
.taxi-fare-display {
    margin-top: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.taxi-fare-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.taxi-fare-details {
    background: #ffffff;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.taxi-fare-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px 0;
}

.taxi-fare-row:last-child {
    margin-bottom: 0;
}

.taxi-fare-label {
    font-weight: 500;
    color: #555;
}

.taxi-fare-value {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

.taxi-commission-rate {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

.taxi-fare-separator {
    margin: 15px 0;
    border: none;
    border-top: 2px solid #e0e0e0;
}

.taxi-total-row {
    border-top: 2px solid #007cba;
    padding-top: 12px !important;
    margin-top: 10px;
}

.taxi-total-row .taxi-fare-label {
    font-size: 18px;
    font-weight: 700;
    color: #007cba;
}

.taxi-total-row .taxi-fare-value {
    font-size: 20px;
    font-weight: 700;
    color: #007cba;
}

.taxi-fare-info {
    margin-top: 15px;
    text-align: center;
}

.taxi-rate-info {
    color: #666;
    font-size: 12px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    display: inline-block;
}

/* Error Styling */
.taxi-error {
    color: #dc3545;
    text-align: center;
    padding: 15px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-weight: 500;
}

.city-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    padding: 5px 0;
}

/* Loading State */
.taxi-calculating {
    opacity: 0.7;
    pointer-events: none;
}

.taxi-calculating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: taxi-spinner 1s linear infinite;
}

@keyframes taxi-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success States */
.taxi-field-valid {
    border-color: #28a745 !important;
}

.taxi-field-valid:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

.taxi-field-invalid {
    border-color: #dc3545 !important;
}

.taxi-field-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Vehicle Type Indicator */
.taxi-vehicle-display[value*="Big"] {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.taxi-vehicle-display[value*="Small"] {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Commission Override Styling */
.taxi-commission-input {
    border-color: #ffc107 !important;
    background-color: #fff8e1;
}

.taxi-commission-input:focus {
    border-color: #ff8f00 !important;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15) !important;
}

/* Responsive Design */
@media (max-width: 480px) {
    .gh-taxi-calculator-wrapper {
        padding: 15px;
        margin: 10px;
    }
    
    .taxi-fare-display {
        padding: 15px;
    }
    
    .taxi-fare-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .taxi-fare-value {
        align-self: flex-end;
    }
}

/* Animation for fare display */
.taxi-fare-display {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .gh-taxi-calculator-wrapper {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .city-autocomplete-container {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .gh-taxi-calculator-wrapper {
        border-color: #000;
    }
    
    .taxi-fare-display {
        background: #fff;
        border-color: #000;
    }
    
    .autocomplete-row:hover {
        background-color: #000;
        color: #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .gh-taxi-calculator-wrapper .elementor-field-textual,
    .autocomplete-row,
    .taxi-fare-display {
        transition: none;
    }
    
    .taxi-calculating::after {
        animation: none;
    }
}

/* Focus Visible Support */
.gh-taxi-calculator-wrapper .elementor-field-textual:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gh-taxi-calculator-wrapper {
        background: #2c2c2c;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .taxi-field-label {
        color: #e0e0e0;
    }
    
    .gh-taxi-calculator-wrapper .elementor-field-textual {
        background: #3c3c3c;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .taxi-fare-display {
        background: #3c3c3c;
        border-color: #555;
    }
    
    .taxi-fare-details {
        background: #2c2c2c;
        border-color: #555;
    }
}

/* Contact Button Styling */
.taxi-contact-button-wrapper {
    width: 100%;
    text-align: center;
    margin-top: 15px;
    padding: 10px 5px 5px 5px;
    display: block;
}

/* Hide button initially */
.taxi-contact-button-wrapper.taxi-button-hidden {
    display: none !important;
}

/* Show button when inside visible hero prices */
.taxi-hero-prices:not([style*="display: none"]) .taxi-contact-button-wrapper:not(.taxi-button-hidden),
.taxi-hero-prices[style*="display: block"] .taxi-contact-button-wrapper:not(.taxi-button-hidden) {
    display: block !important;
}

.taxi-contact-button {
    display: inline-block;
    text-align: center;
    transition: all .3s;
    box-shadow: none;
    text-decoration: none;
    background-color: #0037B5;
    font-family: "POLIN", Sans-serif;
    font-weight: 300;
    text-transform: uppercase;
    line-height: 1em;
    letter-spacing: 1px;
    fill: #FFFFFF;
    color: #FFFFFF;
    border-style: solid;
    border-width: 1px;
    border-color: #0037B5;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 10px;
    box-sizing: border-box;
    margin: 0 auto;
    width: 100%;
    max-width: 140px;
}

.taxi-contact-button:hover {
    background-color: #002a8a;
    border-color: #002a8a;
    color: #FFFFFF;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 55, 181, 0.3);
}

.taxi-contact-button:focus {
    outline: 2px solid #0037B5;
    outline-offset: 2px;
}

.taxi-contact-button .elementor-button-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.taxi-contact-button .elementor-button-text {
    color: inherit;
    font-weight: inherit;
    font-family: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
}

/* Responsive adjustments for contact button */
@media (max-width: 768px) {
    .taxi-contact-button {
        padding: 6px 12px;
        font-size: 9px;
        max-width: 120px;
    }
    
    .taxi-contact-button-wrapper {
        margin-top: 12px;
        padding: 8px 3px 3px 3px;
    }
}

@media (max-width: 480px) {
    .taxi-contact-button {
        padding: 5px 10px;
        font-size: 8px;
        max-width: 100px;
    }
    
    .taxi-contact-button-wrapper {
        margin-top: 10px;
        padding: 6px 2px 2px 2px;
    }
}