/**
 * Belize Cost Calculator Styles
 * Embeddable form styling with #288596 brand color
 */

/* Form Container */
#belize-cost-calculator {
    width: 100%;
    max-width: 100%;
}

.belize-calculator-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 30px 0;
    color: #1a1a1a;
}

/* Form Fields */
.belize-form-row {
    margin-bottom: 20px;
}

.belize-form-field label {
    margin-bottom: -15px!important;
}

.belize-form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.belize-dates-row {
    grid-template-columns: 1fr 1fr;
}

.belize-cities-row {
    grid-template-columns: 1fr 1fr;
}

/* Readonly field styling */
.belize-readonly-field {
    background: #f7fafc !important;
    color: #4a5568;
    cursor: not-allowed;
    font-weight: 500;
}

.belize-form-field {
    position: relative;
}

.belize-form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
}

.belize-form-field input[type="text"],
.belize-form-field input[type="email"],
.belize-form-field input[type="tel"],
.belize-form-field input[type="number"],
.belize-form-field input[type="date"] {
    width: 100%;
    padding: 12px 16px;
    font-size: inherit;
    font-family: inherit;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.belize-form-field input:focus {
    outline: none;
    border-color: #288596;
    box-shadow: 0 0 0 3px rgba(40, 133, 150, 0.1);
}

/* Airport Autocomplete */
.belize-airport-field {
    position: relative;
}

.belize-airport-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: none;
}

.airport-result-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #f7fafc;
}

.airport-result-item:last-child {
    border-bottom: none;
}

.airport-result-item:hover {
    background: #f7fafc;
}

.airport-result-item strong {
    color: #2d3748;
    font-weight: 600;
}

.airport-result-item small {
    color: #718096;
}

.belize-airport-results .loading,
.belize-airport-results .no-results,
.belize-airport-results .error {
    padding: 16px;
    text-align: center;
    color: #718096;
}

/* Price Breakdown Section */
.belize-price-breakdown {
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
    border: 2px solid #288596;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 12px rgba(40, 133, 150, 0.1);
}

.belize-price-section {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px dashed #e2e8f0;
}

.belize-submit-button.elementor-button {
    border: none;
    color: #fff !important;
    width: 100%;
    border-radius: 5px !important;
}

.belize-price-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 0 0px 0 !important;
    color: #288596 !important;
}

.belize-price-item.flights {
    border-bottom: none;
}

.belize-price-item p {
    margin-bottom: 0;
}

.belize-price-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.belize-price-item:last-child {
    border-bottom: none!important;
    padding-top: 16px;
    margin-top: 8px;
}

.belize-price-label {
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    color: #1a1a1a;
    flex: 1;
}

.belize-price-label strong {
    font-size: 1.05rem;
    color: #2d3748;
    margin-bottom: 4px;
}

.belize-price-detail {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-line {
    display: block;
    padding-left: 4px;
    line-height: 1.6;
    color: #4a5568;
}

.belize-price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #288596;
}

.belize-price-item:last-child .belize-price-label {
    font-size: 1.125rem;
    font-weight: 700;
}

.belize-price-item:last-child .belize-price-value {
    font-size: 1.75rem;
}

/* Loading and Error States */
.loading {
    color: #288596;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(40, 133, 150, 0.2);
    border-top-color: #288596;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-pulse {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.error {
    color: #dc2626;
    font-size: 0.875rem;
}

/* Flight unavailable styling */
.belize-price-item .error {
    font-weight: 500;
    font-size: 0.9rem;
}

/* Submit Button */
.belize-submit-button {
    width: 100%;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: #288596;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
}

.belize-submit-button:hover {
    background: #236d7a;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(40, 133, 150, 0.3);
}

.belize-submit-button:active {
    transform: translateY(0);
}

/* Flight Price Loading Section */
.belize-flight-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #f0f9ff;
    border: 2px dashed #288596;
    border-radius: 6px;
    margin: 16px 0;
}

.belize-flight-loading-icon {
    font-size: 24px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.belize-flight-loading-text {
    flex: 1;
}

.belize-flight-loading-title {
    font-weight: 600;
    color: #288596;
    margin-bottom: 4px;
}

.belize-flight-loading-subtitle {
    font-size: 0.875rem;
    color: #718096;
}

/* Hidden Fields */
input[name="departure_airport_code"],
input[name="flight_cost"],
input[name="package_cost"],
input[name="total_cost"],
input[name="arrival_city"] {
    display: none !important;
}

/* Calculator Note */
.belize-calculator-note {
    margin-top: 20px;
    padding: 12px;
    background: #f0f9ff;
    border-left: 3px solid #288596;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #4a5568;
}

/* Standalone Calculator Styles */
.belize-standalone-calculator {
    max-width: 800px;
    margin: 0 auto;
}

button#calculate-flight-prices {
    display: flex;
    color: #fff;
}

/* Calculate Button */
.belize-calculate-button {
    width: 100%!important;
    color: #ffffff;
    background: #288596;
    border: none!important;
    border-radius: 5px!important;
    cursor: pointer;
    padding: 10px!important;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}


.belize-calculate-button:hover:not(:disabled) {
    background: #236d7a;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(40, 133, 150, 0.3);
    border: none;
    padding: 10px;
}

.belize-calculate-button:active:not(:disabled) {
    transform: translateY(0);
    border: none;
    padding: 10px;
}

.belize-calculate-button:disabled,
.belize-calculate-button.disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    color: #fff;
    transform: none;
    border: none;
    padding: 10px;
}

.belize-calculate-button .button-icon {
    font-size: 1.5rem;
    animation: plane-float 2s ease-in-out infinite;
}

@keyframes plane-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.belize-calculate-button:disabled .button-icon {
    animation: none;
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 768px) {
    .belize-form-row-group {
        grid-template-columns: 1fr;
    }
    
    .belize-calculator-title {
        font-size: 1.5rem;
    }
    
    .belize-price-breakdown {
        padding: 20px;
    }
}

/* Contact Form 7 Specific Overrides */
.wpcf7-form-control-wrap {
    display: block !important;
    width: 100%;
}

.wpcf7-not-valid-tip {
    color: #f56565;
    font-size: 0.875rem;
    margin-top: 4px;
}

.wpcf7-response-output {
    margin: 20px 0;
    padding: 16px;
    border-radius: 8px;
    border: 2px solid;
}

.wpcf7-validation-errors {
    border-color: #f56565;
    background: #fff5f5;
    color: #c53030;
}

.wpcf7-mail-sent-ok {
    border-color: #48bb78;
    background: #f0fff4;
    color: #22543d;
}

/* Number Input Styling */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 40px;
}

/* Accessibility */


/* Price Success Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.price-loaded {
    animation: slideIn 0.3s ease-out;
}

/* Flight Cards Container */
.belize-flight-cards-container {
    margin: 24px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.belize-flight-cards-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
}

.flight-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.belize-flight-cards-header h3 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #1a1a1a !important;
}

.flights-sorted-note {
    font-size: 0.8125rem;
    color: #718096;
    margin: 0;
    font-weight: 500;
}

.powered-by-google-flights {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #718096;
}

.powered-by-google-flights span {
    font-weight: 500;
}

.google-flights-logo {
    height: 20px;
    width: auto;
}

/* Static Powered By Section */
.belize-powered-by-section {
    margin: 20px 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.powered-by-google-flights-static {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #718096;
}

.powered-by-google-flights-static span {
    font-weight: 500;
}

/* Flight Card - Compact Horizontal Layout */
.belize-flight-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
}

.belize-flight-card.animated {
    opacity: 1;
    transform: translateY(0);
}

.belize-flight-card:last-child {
    margin-bottom: 0;
}

.belize-flight-card:hover {
    border-color: #288596;
    box-shadow: 0 4px 12px rgba(40, 133, 150, 0.1);
    transform: translateY(-2px);
}

.belize-flight-card.clickable-card {
    cursor: pointer;
}

.belize-flight-card.clickable-card:hover {
    border-color: #288596;
    box-shadow: 0 6px 20px rgba(40, 133, 150, 0.2);
    transform: translateY(-3px);
    background: #ffffff;
}

.belize-flight-card.clickable-card:active {
    transform: translateY(-1px);
}

/* Horizontal Card Layout */
.belize-flight-card-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Logo Section - Left */
.flight-logo-section {
    flex-shrink: 0;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.airline-logo-compact {
    height: 35px;
    width: auto;
    max-width: 50px;
    object-fit: contain;
}

/* Details Section - Middle (grows to fill space) */
.flight-details-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.flight-primary-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.flight-route-compact {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.time-code {
    color: #2d3748;
    white-space: nowrap;
}

.time-code strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1a1a1a;
}

.route-arrow-compact {
    color: #288596;
    font-size: 1rem;
    font-weight: bold;
}

.flight-secondary-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 0.8125rem;
    color: #4a5568;
    line-height: 1.4;
}

.info-item {
    white-space: nowrap;
}

.info-separator {
    color: #cbd5e0;
    margin: 0 2px;
}

.flight-amenities {
    font-size: 0.75rem;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.flight-emissions-compact {
    font-size: 0.75rem;
    color: #4a5568;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.flight-emissions-compact.emissions-high {
    color: #dc2626;
}

.flight-emissions-compact.emissions-low {
    color: #059669;
}

/* Price Section - Right */
.flight-price-section {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 100px;
}

.flight-price-compact {
    font-size: 1.5rem;
    font-weight: 700;
    color: #288596;
    line-height: 1;
}

.view-details-link {
    font-size: 0.75rem;
    color: #288596;
    font-weight: 600;
    white-space: nowrap;
}

.belize-flight-card.clickable-card:hover .view-details-link {
    color: #236d7a;
    text-decoration: underline;
}

/* Legacy styles - keeping for backwards compatibility */
.airline-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.airport-code {
    color: #1a1a1a;
    font-family: monospace;
    font-size: 1.25rem;
}

/* Responsive Design for Flight Cards */
@media (max-width: 768px) {
    .belize-flight-cards-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .flight-header-left h3 {
        font-size: 1.125rem !important;
    }
    
    .flights-sorted-note {
        font-size: 0.75rem;
    }
    
    .powered-by-google-flights {
        align-self: flex-start;
    }
    
    .belize-powered-by-section {
        margin: 16px 0;
        padding: 10px 12px;
    }
    
    .powered-by-google-flights-static {
        font-size: 0.8125rem;
    }
    
    .belize-flight-cards-container {
        padding: 16px;
    }
    
    .belize-flight-card {
        padding: 12px;
    }
    
    .belize-flight-card-content {
        gap: 10px;
    }
    
    .flight-logo-section {
        width: 40px;
    }
    
    .airline-logo-compact {
        height: 30px;
        max-width: 40px;
    }
    
    .flight-route-compact {
        font-size: 0.875rem;
        gap: 6px;
    }
    
    .time-code {
        font-size: 0.875rem;
    }
    
    .time-code strong {
        font-size: 0.9375rem;
    }
    
    .flight-secondary-info {
        font-size: 0.75rem;
        gap: 4px;
    }
    
    .flight-amenities {
        font-size: 0.6875rem;
    }
    
    .flight-emissions-compact {
        font-size: 0.6875rem;
    }
    
    .flight-price-section {
        min-width: 80px;
    }
    
    .flight-price-compact {
        font-size: 1.25rem;
    }
    
    .view-details-link {
        font-size: 0.6875rem;
    }
}

@media (max-width: 480px) {
    .belize-flight-card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .flight-logo-section {
        width: auto;
    }
    
    .flight-details-section {
        width: 100%;
    }
    
    .flight-price-section {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .flight-price-compact {
        font-size: 1.5rem;
    }
}

.powered-by-google-flights-static {
    display: flex;
    align-items: center;
    gap: 5px;
}