.intigo-parcel-creation,
.intigo-parcel-section {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.intigo-parcel-creation h3,
.intigo-parcel-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 18px;
}

.intigo-parcel-creation p,
.intigo-parcel-section p {
    margin: 10px 0;
    color: #666;
}

.intigo-parcel-info {
    background-color: #e8f5e8;
    border: 1px solid #4caf50;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.intigo-parcel-info p {
    margin: 5px 0;
    color: #2e7d32;
}

.intigo-parcel-actions {
    margin-top: 15px;
}

.intigo-parcel-actions .button {
    margin-right: 10px;
    margin-bottom: 5px;
}

/* WooCommerce Checkout City Dropdown Styling */
#billing_city {
    width: 100% !important;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    background-color: #fff;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23666" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 35px;
    cursor: pointer;
}

#billing_city:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

#billing_city:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.woocommerce form .form-row select#billing_city,
.woocommerce-checkout form .form-row select#billing_city {
    width: 100% !important;
    max-width: none !important;
    display: block;
}

/* Ensure proper spacing in WooCommerce forms */
.woocommerce form .form-row.form-row-wide select#billing_city {
    margin-bottom: 0;
}

.create-parcel-btn {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
    padding: 8px 16px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid;
    transition: all 0.2s ease;
}

.create-parcel-btn:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: #fff;
}

.create-parcel-btn:disabled,
.create-parcel-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.download-label-btn,
.view-history-btn {
    background-color: #f0f0f1;
    border-color: #c3c4c7;
    color: #2c3338;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 13px;
    line-height: 1.5;
    border: 1px solid;
    transition: all 0.2s ease;
}

.download-label-btn:hover,
.view-history-btn:hover {
    background-color: #e0e0e0;
    border-color: #8c8f94;
    color: #2c3338;
}

.download-label-btn:disabled,
.view-history-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal Styles */
.intigo-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
}

.intigo-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000000;
}

.intigo-popup-header {
    background: #0073aa;
    color: #fff;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.intigo-popup-header h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.intigo-popup-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intigo-popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.intigo-popup-content {
    padding: 20px;
}

.intigo-field-mapping {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.order-details,
.shipping-details {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
}

.order-details h3,
.shipping-details h3 {
    margin-top: 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.parcel-form-section,
.pickup-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #fafafa;
    border-radius: 4px;
}

.parcel-form-section h3,
.pickup-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 8px;
}

.auto-mapped-indicator {
    font-size: 12px;
    color: #666;
    font-weight: normal;
    font-style: italic;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.field-group {
    margin-bottom: 15px;
}

.field-group.full-width {
    grid-column: 1 / -1;
}

.field-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.field-group input,
.field-group select,
.field-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.field-group.field-valid input,
.field-group.field-valid select,
.field-group.field-valid textarea {
    border-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.1);
}

.field-group.field-invalid input,
.field-group.field-invalid select,
.field-group.field-invalid textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

.validation-message {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #dc3545;
}

.field-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.required {
    color: #dc3545;
}

.validation-summary {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.validation-summary h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.validation-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 3px;
}

.validation-item.status-valid {
    background-color: #d4edda;
    border-left: 3px solid #28a745;
}

.validation-item.status-invalid {
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
}

.status-icon {
    margin-right: 8px;
    font-weight: bold;
    font-size: 14px;
}

.status-valid .status-icon {
    color: #28a745;
}

.status-invalid .status-icon {
    color: #dc3545;
}

.field-label {
    font-weight: 500;
    margin-right: 10px;
    min-width: 120px;
}

.status-message {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    margin-top: 20px;
}

.modal-actions .button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid;
    transition: all 0.2s ease;
}

.modal-actions .button-primary {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

.modal-actions .button-primary:hover {
    background-color: #005a87;
    border-color: #005a87;
}

.modal-actions .button-secondary {
    background-color: #f0f0f1;
    border-color: #c3c4c7;
    color: #2c3338;
}

.modal-actions .button-secondary:hover {
    background-color: #e0e0e0;
    border-color: #8c8f94;
}

/* Responsive design */
@media (max-width: 768px) {
    .intigo-popup {
        width: 95%;
        max-height: 95vh;
    }
    
    .intigo-field-mapping {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .button {
        width: 100%;
        text-align: center;
    }
    
    .intigo-parcel-actions .button {
        display: block;
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .intigo-parcel-creation,
    .intigo-parcel-section {
        padding: 15px;
    }
}