/* Responsive Auto Transport Lead Form */
.atlf-container{
    max-width: 720px;
    margin: 0 auto;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    padding: 0 15px;
}

.atlf-form{
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.atlf-step h3{
    margin: 0 0 12px;
    font-size: 20px;
    color: #111827;
}

.atlf-row{
    margin-bottom: 16px;
}

.atlf-row label{
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.atlf-row input,
.atlf-row select{
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.atlf-row input:focus,
.atlf-row select:focus{
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Google Places Autocomplete styling */
.pac-container {
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    margin-top: 2px;
}

.pac-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #374151;
}

.pac-item:hover {
    background-color: #f9fafb;
}

.pac-item-selected {
    background-color: #eff6ff;
    color: #1d4ed8;
}

.pac-item-query {
    font-weight: 600;
    color: #111827;
}

/* New PlaceAutocompleteElement styling */
gmp-place-autocomplete {
    --gmpx-color-surface: #ffffff;
    --gmpx-color-on-surface: #374151;
    --gmpx-color-on-surface-variant: #6b7280;
    --gmpx-color-outline: #d1d5db;
    --gmpx-color-outline-variant: #e5e7eb;
    --gmpx-color-primary: #3b82f6;
    --gmpx-font-family-base: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --gmpx-font-size-base: 16px;
    --gmpx-font-weight-medium: 500;
    --gmpx-font-weight-bold: 600;
    --gmpx-radius-sm: 6px;
    --gmpx-radius-md: 8px;
    --gmpx-shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --gmpx-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
}

gmp-place-autocomplete:focus-within {
    --gmpx-color-outline: #3b82f6;
    --gmpx-shadow-outline: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Loading indicator for Google Places */
.atlf-row input[name="ship_from"],
.atlf-row input[name="ship_to"] {
    background-image: none;
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}

.atlf-row input[name="ship_from"]:not(:placeholder-shown),
.atlf-row input[name="ship_to"]:not(:placeholder-shown) {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTggMTVDMTEuODY2IDE1IDE1IDExLjg2NiAxNSA4QzE1IDQuMTM0IDExLjg2NiAxIDggMUM0LjEzNCAxIDEgNC4xMzQgMSA4QzEgMTEuODY2IDQuMTM0IDE1IDggMTVaIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPHBhdGggZD0iTTggNFY4TDExIDExIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+');
}

.atlf-actions{
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.atlf-actions button{
    background: #111827;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    flex: 1;
    min-width: 120px;
}

.atlf-actions button:hover{
    background: #1f2937;
}

.atlf-actions button.atlf-prev{
    background: #6b7280;
}

.atlf-actions button.atlf-prev:hover{
    background: #4b5563;
}

.atlf-actions button:disabled{
    opacity: 0.6;
    cursor: not-allowed;
}

.atlf-grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.atlf-vehicle{
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.atlf-vehicle.collapsed {
    padding: 8px 16px;
}

.atlf-vehicle.collapsed .atlf-grid {
    display: none;
}

.atlf-vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
}

.atlf-vehicle-header h4 {
    margin: 0;
    font-size: 16px;
    color: #374151;
}

.atlf-vehicle-toggle {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.atlf-vehicle-toggle:hover {
    color: #374151;
}

.atlf-vehicle.collapsed .atlf-vehicle-toggle {
    transform: rotate(180deg);
}

.atlf-vehicle.complete {
    border-color: #10b981;
    background: #f0fdf4;
}

.atlf-vehicle.complete .atlf-vehicle-header h4::after {
    content: " ✓";
    color: #10b981;
    font-weight: bold;
}

.atlf-del-vehicle{
    background: #ef4444;
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 8px 12px;
    margin-top: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.atlf-del-vehicle:hover{
    background: #dc2626;
}

.atlf-error{
    border-color: #ef4444;
}

/* Date picker always open */
.atlf-row input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
}

.atlf-row input[type="date"] {
    position: relative;
}

/* Show calendar icon */
.atlf-row input[type="date"]::before {
    content: "📅";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Tablet and Desktop Responsive */
@media (min-width: 768px) {
    .atlf-container {
        padding: 0 20px;
    }
    
    .atlf-form {
        padding: 24px;
    }
    
    .atlf-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .atlf-actions {
        flex-wrap: nowrap;
    }
    
    .atlf-actions button {
        flex: none;
    }
}

@media (min-width: 1024px) {
    .atlf-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile Specific Adjustments */
@media (max-width: 767px) {
    .atlf-container {
        padding: 0 10px;
    }
    
    .atlf-form {
        padding: 16px;
        margin: 10px 0;
    }
    
    .atlf-step h3 {
        font-size: 18px;
        text-align: center;
    }
    
    .atlf-actions {
        flex-direction: column;
    }
    
    .atlf-actions button {
        width: 100%;
        min-width: auto;
    }
    
    .atlf-vehicle {
        padding: 12px;
    }
    
    .atlf-row input,
    .atlf-row select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 12px;
    }
    
    .atlf-vehicle-header h4 {
        font-size: 14px;
    }
    
    .atlf-vehicle-toggle {
        font-size: 16px;
        padding: 6px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .atlf-container {
        padding: 0 5px;
    }
    
    .atlf-form {
        padding: 12px;
    }
    
    .atlf-step h3 {
        font-size: 16px;
    }
    
    .atlf-row label {
        font-size: 13px;
    }
}

/* Toast Notifications */
.atlf-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 350px;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.atlf-toast.show {
    transform: translateX(0);
}

.atlf-toast.success {
    border-left: 4px solid #10b981;
    background: #f0fdf4;
}

.atlf-toast.error {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.atlf-toast.warning {
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
}

.atlf-toast.info {
    border-left: 4px solid #3b82f6;
    background: #eff6ff;
}

.atlf-toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.atlf-toast-title {
    font-weight: 600;
    font-size: 14px;
    margin: 0;
}

.atlf-toast.success .atlf-toast-title {
    color: #065f46;
}

.atlf-toast.error .atlf-toast-title {
    color: #991b1b;
}

.atlf-toast.warning .atlf-toast-title {
    color: #92400e;
}

.atlf-toast.info .atlf-toast-title {
    color: #1e40af;
}

.atlf-toast-message {
    font-size: 13px;
    line-height: 1.4;
    margin: 0;
}

.atlf-toast.success .atlf-toast-message {
    color: #047857;
}

.atlf-toast.error .atlf-toast-message {
    color: #dc2626;
}

.atlf-toast.warning .atlf-toast-message {
    color: #d97706;
}

.atlf-toast.info .atlf-toast-message {
    color: #2563eb;
}

.atlf-toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin-left: 12px;
}

.atlf-toast-close:hover {
    color: #374151;
}

/* Mobile toast adjustments */
@media (max-width: 767px) {
    .atlf-toast {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .atlf-toast.show {
        transform: translateY(0);
    }
}


/* Loading states for form elements */
.atlf-loading {
    position: relative;
    pointer-events: none;
}

.atlf-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 12px;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: atlf-spin 1s linear infinite;
    transform: translateY(-50%);
}

.atlf-loading select {
    padding-right: 40px;
}

/* Form submission loading state */
.atlf-form-submitting {
    opacity: 0.7;
    pointer-events: none;
}
