/* Quote Form - Compact Single-Screen Design */

/* Hero Section - Removed or Minimized */
.hero-small.quote-hero {
    position: relative;
    min-height: unset;
    height: auto;
    padding-top: calc(var(--header-height) + 2rem);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    color: var(--white);
}

.quote-hero .hero-content {
    position: relative;
    max-width: 640px;
}

/* Logged-in User Info */
.logged-in-user-info {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #81c784;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
}

.logged-in-user-info .user-welcome {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #2e7d32;
    font-size: 0.95rem;
}

.logged-in-user-info .user-welcome i {
    font-size: 1.25rem;
}

.logged-in-user-info .user-welcome strong {
    color: #1b5e20;
}

/* Shipment Type Label for Logged-in Users */
.shipment-type-label {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Main Form Section */
.quote-form-section {
    padding: 1rem 0;
    background: #f5f7fa;
    min-height: 100vh;
}

.quote-form-section .container-fluid {
    max-width: 100%;
    padding: 0 1rem;
}

#request-quote-form {
    background: white;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Honeypot Field */
.honeypot-field {
    position: absolute;
    left: -9999px;
    visibility: hidden;
}

/* Top Section: Contact + Shipment Type */
.top-section {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.contact-info {
    flex: 1;
}

.form-row-compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.form-input-compact {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #2d3748;
    background: white;
}

.form-input-compact:focus {
    outline: none;
    border-color: #4299e1;
}

.form-input-compact::placeholder {
    color: #a0aec0;
}

#readyDate {
    width: 180px;
}

.shipment-type-compact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 200px;
}

.shipment-type-compact select {
    width: 100%;
}

/* Pickup and Destination Grid */
.pickup-destination-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.location-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}

.section-header-compact {
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
}

.pickup-header {
    background: #cfe2ff;
    color: #084298;
}

.destination-header {
    background: #d1e7dd;
    color: #0f5132;
}

.items-header {
    background: #f8f9fa;
    color: #495057;
}

.section-content-compact {
    padding: 0.75rem;
}

.date-field {
    margin-bottom: 0.75rem;
    position: relative;
}

.date-field input[type="date"] {
    cursor: pointer;
    position: relative;
}

.date-input-shell {
    position: relative;
    display: inline-block;
}

.date-input-shell input[type="date"] {
    width: 100%;
    padding-left: 2rem;
}

.calendar-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.95rem;
    pointer-events: none;
}

.date-field input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    opacity: 0;
}

/* Hide default clear/spin buttons */
.date-field input[type="date"]::-webkit-inner-spin-button,
.date-field input[type="date"]::-webkit-clear-button {
    display: none;
}

.label-compact {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.form-select-compact {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #2d3748;
    background: white;
    margin-top: -5px;
}

.form-select-compact:focus {
    outline: none;
    border-color: #4299e1;
}

.subsection-compact {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    margin: 0.75rem 0 0.5rem 0;
    text-transform: uppercase;
}

.address-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.checkbox-grid-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.checkbox-label-compact {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #495057;
    cursor: pointer;
}

.checkbox-label-compact input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4299e1;
}

/* Swap Arrow */
.swap-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-swap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-swap:hover {
    background: #f8f9fa;
    border-color: #4299e1;
    color: #4299e1;
}

/* Items Section */
.items-section {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.items-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e2e8f0;
}

.btn-inventory {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.btn-inventory:hover {
    background: #f8f9fa;
}

.item-filters {
    display: flex;
    gap: 0.75rem;
    flex: 1;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: #6c757d;
    cursor: pointer;
}

.filter-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.toggle-weight {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    background: var(--primary-color);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #000;
}

.toggle-switch {
    width: 32px;
    height: 16px;
    appearance: none;
    background: #6c757d;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
}

.toggle-switch:checked {
    background: #198754;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.toggle-switch:checked::before {
    left: 18px;
}

.btn-delete-item {
    padding: 0.35rem 0.5rem;
    background: transparent;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-delete-item:hover {
    color: #c82333;
}

/* Commodity List */
.commodity-list-compact {
    padding: 0.5rem 0.75rem;
    min-height: 60px;
}

.commodity-row-compact {
    display: grid;
    grid-template-columns: 
        minmax(50px, 0.5fr)    /* Units */
        minmax(100px, 1fr)     /* Handling Unit/Packaging */
        minmax(50px, 0.5fr)    /* Pieces */
        minmax(100px, 1fr)     /* Weight */
        minmax(70px, 0.8fr)    /* Length */
        minmax(70px, 0.8fr)    /* Width */
        minmax(90px, 1fr)      /* Height */
        minmax(80px, 0.8fr)    /* Class */
        minmax(80px, 0.8fr)    /* NMFC */
        minmax(150px, 2fr);    /* Description */
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 4px;
    width: 100%;
}

.field-compact {
    padding: 0.5rem 0.65rem;
    border: 1px solid #cbd5e0;
    border-radius: 3px;
    font-size: 0.875rem;
    background: white;
}

.field-compact:focus {
    outline: none;
    border-color: #4299e1;
}

.field-tiny {
    width: 100%;
}

.field-small {
    width: 100%;
}

.field-medium {
    width: 100%;
}

.field-expand {
    grid-column: span 1;
    width: 100%;
}

.field-with-dropdown {
    display: flex;
    gap: 0;
}

.field-with-dropdown input {
    flex: 1;
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.field-unit-compact {
    width: 45px;
    padding: 0.35rem 0.25rem;
    border: 1px solid #cbd5e0;
    border-left: none;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    font-size: 0.75rem;
    background: #f8f9fa;
}

/* Items Footer */
.items-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
}

.total-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: #495057;
}

.total-stats strong {
    font-weight: 600;
    color: #212529;
}

.btn-add-item-compact {
    padding: 0.4rem 0.75rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-item-compact:hover {
    background: #f8f9fa;
    border-color: #4299e1;
    color: #4299e1;
}

/* Form Footer */
.form-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem;
}

.btn-get-rates {
    padding: 0.65rem 2.5rem;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-get-rates:hover {
    background: var(--primary-dark);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.btn-get-rates.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.notes-section {
    margin-bottom: 0.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.75rem;
}

.textarea-compact {
    width: 100%;
    min-height: 110px;
    padding: 0.6rem 0.75rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 0.9rem;
    resize: vertical;
    color: #2d3748;
    background: #fff;
}

.textarea-compact:focus {
    outline: none;
    border-color: #4299e1;
}

.notes-hint {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #6c757d;
}

/* Success Panel */
.quote-success {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    margin: 2rem 0;
}

.quote-success[hidden] {
    display: none;
}

.success-icon {
    font-size: 3.5rem;
    color: #198754;
    margin-bottom: 1rem;
}

.quote-success h2 {
    color: #212529;
    margin: 1rem 0;
}

.quote-success p {
    color: #6c757d;
    margin: 1rem 0 2rem;
}

.quote-success-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: #0d6efd;
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: #0b5ed7;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: #0d6efd;
    border: 2px solid #0d6efd;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: #e7f1ff;
}

/* Responsive Design */

/* Tablet-specific styles (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .quote-form-section .container-fluid {
        padding: 0 1.5rem;
    }

    #request-quote-form {
        padding: 1rem;
    }

    .top-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-row-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .shipment-type-compact {
        width: 100%;
    }

    .pickup-destination-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .swap-arrow {
        display: none;
    }

    .location-section {
        width: 100%;
    }

    .address-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .checkbox-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .commodity-row-compact {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .field-expand {
        grid-column: span 5;
    }

    .items-toolbar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .item-filters {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .total-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .notes-section {
        padding: 1rem;
    }

    .textarea-compact {
        min-height: 100px;
    }

    .btn-get-rates {
        padding: 0.75rem 2rem;
    }

    .quote-success {
        padding: 2rem;
        margin: 1.5rem 0;
    }
}

@media (max-width: 1400px) {
    .form-row-compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .address-row {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .commodity-row-compact {
        grid-template-columns: 
            minmax(45px, 0.5fr)    /* Units */
            minmax(90px, 1fr)      /* Handling Unit */
            minmax(45px, 0.5fr)    /* Pieces */
            minmax(90px, 1fr)      /* Weight */
            minmax(60px, 0.7fr)    /* Length */
            minmax(60px, 0.7fr)    /* Width */
            minmax(80px, 0.9fr)    /* Height */
            minmax(70px, 0.7fr)    /* Class */
            minmax(70px, 0.7fr)    /* NMFC */
            minmax(120px, 1.5fr);  /* Description */
        gap: 0.4rem;
    }
}

@media (max-width: 1200px) {
    .pickup-destination-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .swap-arrow {
        display: none;
    }
    
    .address-row {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .commodity-row-compact {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.35rem;
    }
    
    .field-expand {
        grid-column: span 5;
    }
}

@media (max-width: 900px) {
    .address-row {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }
}

@media (max-width: 768px) {
    .top-section {
        grid-template-columns: 1fr;
    }
    
    .form-row-compact {
        grid-template-columns: 1fr;
    }
    
    .shipment-type-compact {
        width: 100%;
    }
    
    .address-row {
        grid-template-columns: 1fr;
    }
    
    .checkbox-grid-compact {
        grid-template-columns: 1fr;
    }
    
    .commodity-row-compact {
        grid-template-columns: 1fr 1fr;
    }
    
    .field-expand {
        grid-column: span 2;
    }
}