/**
 * Courier Guys Pudo Checkout Styles
 *
 * @package CourierGuys\Pudo
 */

/* Main checkout options container */
.courier-guys-pudo-checkout-options {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.courier-guys-pudo-checkout-options h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Form fields */
.courier-guys-pudo-field {
    margin-bottom: 20px;
}

.courier-guys-pudo-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.courier-guys-pudo-field .required {
    color: #e74c3c;
}

.courier-guys-pudo-field select,
.courier-guys-pudo-field input[type="text"],
.courier-guys-pudo-field input[type="tel"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.courier-guys-pudo-field select:focus,
.courier-guys-pudo-field input[type="text"]:focus,
.courier-guys-pudo-field input[type="tel"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Locker search section */
.locker-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.locker-search input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}

.locker-search .button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.locker-search .button:hover {
    background: #005a87;
}

/* Locker results */
.locker-results {
    margin-top: 15px;
}

.locker-results-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.locker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.locker-item:last-child {
    border-bottom: none;
}

.locker-item:hover {
    background: #f5f5f5;
}

.locker-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    color: #333;
}

.locker-info p {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
}

.locker-info small {
    color: #999;
    font-size: 12px;
}

.select-locker {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.select-locker:hover {
    background: #219a52;
}

/* Selected locker display */
.selected-locker {
    margin-top: 15px;
}

.selected-locker-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    padding: 15px;
}

.selected-locker-info strong {
    color: #155724;
    display: block;
    margin-bottom: 8px;
}

.selected-locker-info .locker-name {
    font-weight: 600;
    color: #333;
}

.selected-locker-info .locker-address {
    color: #666;
    font-size: 14px;
}

/* Loading and error states */
.locker-loading,
.locker-error {
    padding: 20px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.locker-loading {
    color: #666;
}

.locker-error {
    color: #e74c3c;
    background: #fdf2f2;
    border-color: #f5c6cb;
}

/* Delivery address section */
.delivery-address-fields {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-top: 15px;
}

.delivery-address-fields h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

.delivery-address-fields .form-row {
    margin-bottom: 15px;
}

.delivery-address-fields .form-row-first,
.delivery-address-fields .form-row-last {
    width: 48%;
    display: inline-block;
}

.delivery-address-fields .form-row-first {
    margin-right: 4%;
}

.delivery-address-fields .form-row-wide {
    width: 100%;
}

.delivery-address-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.delivery-address-fields input,
.delivery-address-fields select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

/* Checkbox styling */
.courier-guys-pudo-field input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.courier-guys-pudo-field label input[type="checkbox"] {
    margin-right: 8px;
}

/* Order details display */
.courier-guys-pudo-order-details {
    margin: 20px 0;
}

.courier-guys-pudo-order-details h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.courier-guys-pudo-order-details .woocommerce-table {
    width: 100%;
    border-collapse: collapse;
}

.courier-guys-pudo-order-details .woocommerce-table th,
.courier-guys-pudo-order-details .woocommerce-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.courier-guys-pudo-order-details .woocommerce-table th {
    font-weight: 600;
    color: #333;
    width: 30%;
}

.courier-guys-pudo-order-details .woocommerce-table td {
    color: #666;
}

.courier-guys-pudo-order-details .woocommerce-table a {
    color: #0073aa;
    text-decoration: none;
}

.courier-guys-pudo-order-details .woocommerce-table a:hover {
    text-decoration: underline;
}

/* Email styles */
.courier-guys-pudo-email-details {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.courier-guys-pudo-email-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.courier-guys-pudo-email-details p {
    margin: 10px 0;
    color: #666;
}

/* Responsive design */
@media (max-width: 768px) {
    .locker-search {
        flex-direction: column;
    }
    
    .locker-search .button {
        width: 100%;
        margin-top: 10px;
    }
    
    .locker-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .select-locker {
        width: 100%;
    }
    
    .delivery-address-fields .form-row-first,
    .delivery-address-fields .form-row-last {
        width: 100%;
        display: block;
        margin-right: 0;
    }
}

/* Hide sections by default */
#pickup-locker-section,
#dropoff-locker-section,
#delivery-address-section {
    display: none !important;
}

/* L2L Service Notice */
.l2l-service-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.l2l-service-notice p {
    margin: 0;
    color: #0066cc;
    font-size: 14px;
}

.l2l-service-notice strong {
    color: #004499;
}

/* Force hide WooCommerce address sections for L2L */
.l2l-active .woocommerce-billing-fields,
.l2l-active .woocommerce-shipping-fields {
    display: none !important;
}

/* Animation for smooth transitions */
.courier-guys-pudo-field,
.selected-locker-info,
.delivery-address-fields {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
.courier-guys-pudo-field input:focus,
.courier-guys-pudo-field select:focus,
.locker-search .button:focus,
.select-locker:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .locker-search,
    .select-locker {
        display: none;
    }
    
    .courier-guys-pudo-checkout-options {
        background: white;
        border: 1px solid #000;
    }
}

/* New WooCommerce Integration Styles */

/* Pudo Locker Interface */
.pudo-locker-interface {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

/* L2L Notice */
.pudo-l2l-notice {
    margin-bottom: 20px;
}

.pudo-l2l-notice .woocommerce-info {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    color: #0066cc;
    padding: 15px;
    border-radius: 4px;
    margin: 0;
}

/* Locker Selection */
.pudo-locker-selection h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Locker Search Container */
.locker-search-container {
    margin-bottom: 20px;
}

.locker-search-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.locker-search-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.locker-search-input .button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.locker-search-input .button:hover {
    background: #005a87;
}

/* Pudo Locker Results */
.pudo-locker-results {
    margin-top: 20px;
}

.pudo-locker-results-list {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.pudo-results-header {
    background: #f8f8f8;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #333;
}

.pudo-locker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.pudo-locker-item:last-child {
    border-bottom: none;
}

.pudo-locker-item:hover {
    background: #f5f5f5;
}

.pudo-locker-info h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.pudo-locker-address {
    margin: 0 0 5px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.pudo-locker-distance {
    color: #27ae60;
    font-weight: bold;
    font-size: 12px;
}

.pudo-locker-actions {
    margin-left: 15px;
}

.pudo-select-locker {
    background: #27ae60;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.pudo-select-locker:hover {
    background: #219a52;
}

/* Selected Locker Display */
.pudo-selected-locker-display {
    margin-top: 20px;
}

.pudo-selected-locker-info .woocommerce-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin: 0;
}

.pudo-locker-name {
    font-weight: 600;
    color: #333;
    display: block;
    margin: 5px 0;
}

.pudo-change-locker {
    margin-top: 10px;
}

.pudo-change-locker .button-link {
    background: none;
    border: none;
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}

.pudo-change-locker .button-link:hover {
    color: #005a87;
}

/* Loading States */
.pudo-loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Error States */
.woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Hide address fields for L2L */
body.pudo-l2l-checkout .woocommerce-billing-fields,
body.pudo-l2l-checkout .woocommerce-shipping-fields,
body.pudo-l2l-checkout .woocommerce-additional-fields {
    display: none !important;
}

/* Responsive Design for New Elements */
@media (max-width: 768px) {
    .locker-search-input {
        flex-direction: column;
    }
    
    .locker-search-input .button {
        width: 100%;
        margin-top: 10px;
    }
    
    .pudo-locker-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .pudo-locker-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .pudo-select-locker {
        width: 100%;
    }
}

/* Animation for smooth transitions */
.pudo-locker-interface,
.pudo-selected-locker-info {
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
.pudo-select-locker:focus,
.locker-search-input .button:focus,
.locker-search-input input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* DOM Manipulation - Moved Interface Styles */
.pudo-interface-moved-to-top {
    order: -999 !important;
    position: relative !important;
    z-index: 10 !important;
    margin-bottom: 30px !important;
    background: #f0f8ff !important;
    border: 2px solid #0073aa !important;
    border-radius: 6px !important;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1) !important;
}

/* Ensure moved interface appears first in flexbox containers */
.woocommerce-checkout .pudo-interface-moved-to-top,
.checkout .pudo-interface-moved-to-top,
#checkout .pudo-interface-moved-to-top {
    order: -999 !important;
    flex-order: -999 !important;
    -webkit-order: -999 !important;
    -moz-order: -999 !important;
    -ms-flex-order: -999 !important;
}

/* Force positioning for moved interface */
.woocommerce-checkout-review-order-table + .pudo-interface-moved-to-top,
.woocommerce-billing-fields + .pudo-interface-moved-to-top,
.woocommerce-shipping-fields + .pudo-interface-moved-to-top {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 0 !important;
    margin-bottom: 30px !important;
}

/* Enhanced L2L checkout body class with higher specificity */
body.pudo-l2l-checkout .woocommerce-checkout .woocommerce-billing-fields,
body.pudo-l2l-checkout .woocommerce-checkout .woocommerce-shipping-fields,
body.pudo-l2l-checkout .woocommerce-checkout .woocommerce-additional-fields,
body.pudo-l2l-checkout #checkout .woocommerce-billing-fields,
body.pudo-l2l-checkout #checkout .woocommerce-shipping-fields,
body.pudo-l2l-checkout #checkout .woocommerce-additional-fields {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure locker interface is always visible for L2L */
body.pudo-l2l-checkout .pudo-locker-interface,
body.pudo-l2l-checkout .pudo-interface-moved-to-top,
body.pudo-l2l-checkout #pudo-locker-interface {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Special styling for moved interface header */
.pudo-interface-moved-to-top .pudo-locker-selection h3::before {
    content: "🔒 ";
    color: #0073aa;
    font-size: 20px;
    margin-right: 8px;
}

.pudo-interface-moved-to-top .pudo-l2l-notice .woocommerce-info {
    background: linear-gradient(135deg, #e7f3ff 0%, #cce7ff 100%) !important;
    border-color: #0073aa !important;
    font-weight: 500 !important;
}

/* Grid layout override for checkout forms */
.woocommerce-checkout .col2-set {
    display: flex !important;
    flex-direction: column !important;
}

.woocommerce-checkout .col2-set .pudo-interface-moved-to-top {
    order: -999 !important;
    width: 100% !important;
    margin-bottom: 30px !important;
}

/* Ensure proper spacing after moved interface */
.pudo-interface-moved-to-top + * {
    margin-top: 20px !important;
}

/* Animation for interface movement */
@keyframes pudoInterfaceSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pudo-interface-moved-to-top {
    animation: pudoInterfaceSlideIn 0.3s ease-out !important;
}

/* Mobile responsiveness for moved interface */
@media (max-width: 768px) {
    .pudo-interface-moved-to-top {
        margin-left: -10px !important;
        margin-right: -10px !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
}

/* Print styles for moved interface */
@media print {
    .pudo-interface-moved-to-top {
        background: white !important;
        border: 1px solid #000 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
    }
}

/* Modal Styles (from example plugin integration) */
.pudo-modal {
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pudo-modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.pudo-modal-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #005a87;
}

.pudo-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pudo-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.pudo-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.pudo-modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.pudo-locker-search-container {
    margin-bottom: 20px;
}

.pudo-locker-search-container input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}

.pudo-locker-search-container .button {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.pudo-locker-search-container .button:hover {
    background: #005a87;
}

.pudo-modal-results {
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    max-height: 300px;
    overflow-y: auto;
}

/* Modal responsive design */
@media (max-width: 768px) {
    .pudo-modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }
    
    .pudo-modal-header {
        padding: 12px 15px;
    }
    
    .pudo-modal-body {
        padding: 15px;
    }
    
    .pudo-locker-search-container .button {
        width: 100%;
        margin-right: 0;
    }
}

/* Modal animation */
@keyframes pudoModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pudo-modal {
    animation: pudoModalFadeIn 0.3s ease-out;
}

/* Close modal when clicking outside */
.pudo-modal:not(.pudo-modal-content):not(.pudo-modal-content *) {
    cursor: pointer;
}

/* Locker Map Integration Styles */

/* Results header with map toggle */
.pudo-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f8f8;
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #333;
}

.pudo-results-actions {
    display: flex;
    gap: 10px;
}

.toggle-map-view {
    background: #666;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.toggle-map-view:hover {
    background: #555;
}

.toggle-map-view .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Locker code display */
.pudo-locker-code {
    display: block;
    color: #666;
    font-size: 12px;
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 5px;
    display: inline-block;
}

/* Enhanced locker list for map integration */
.pudo-locker-list {
    background: white;
}

/* Map integration responsive design */
@media (max-width: 768px) {
    .pudo-results-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .pudo-results-actions {
        justify-content: center;
    }
    
    .toggle-map-view {
        width: 100%;
        justify-content: center;
    }
}

/* Integration with existing locker map styles */
.pudo-locker-results .locker-map-container {
    margin-top: 0;
    border-top: 1px solid #ddd;
}

.pudo-locker-results .locker-map-header {
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
    padding: 15px;
}

.pudo-locker-results .locker-map-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.pudo-locker-results .map-address-search-container {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 250px;
}

.pudo-locker-results .map-address-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pudo-locker-results .map-address-search,
.pudo-locker-results .get-current-location {
    background: #0073aa;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pudo-locker-results .map-address-search:hover,
.pudo-locker-results .get-current-location:hover {
    background: #005a87;
}

.pudo-locker-results .get-current-location {
    background: #27ae60;
}

.pudo-locker-results .get-current-location:hover {
    background: #219a52;
}

.pudo-locker-results .locker-map-canvas {
    height: 400px;
    width: 100%;
    background: #f0f0f0;
}

/* Loading states for map integration */
.pudo-locker-results .get-current-location .dashicons.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Map responsive design within locker results */
@media (max-width: 768px) {
    .pudo-locker-results .locker-map-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .pudo-locker-results .map-address-search-container {
        min-width: auto;
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .pudo-locker-results .map-address-search,
    .pudo-locker-results .get-current-location {
        width: 100%;
        justify-content: center;
    }
    
    .pudo-locker-results .locker-map-canvas {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .pudo-locker-results .locker-map-header {
        padding: 10px;
    }
    
    .pudo-locker-results .locker-map-canvas {
        height: 250px;
    }
}

/* New UI Components Styles */

/* Service Type and Parcel Size Fields */
.pudo-service-type-field,
.pudo-parcel-size-field,
.pudo-selected-locker-field {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pudo-service-type-field label,
.pudo-parcel-size-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.pudo-service-type-field select,
.pudo-parcel-size-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #333;
}

.pudo-service-type-field select:focus,
.pudo-parcel-size-field select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

.pudo-service-type-field select:disabled,
.pudo-parcel-size-field select:disabled {
    background: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

/* Auto-detection info for parcel size */
.auto-detection-info {
    margin-top: 8px;
    padding: 8px 12px;
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 3px;
    color: #0066cc;
    font-size: 12px;
    line-height: 1.4;
}

/* Instructions for locker selection */
.pudo-instructions {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    color: #856404;
}

.pudo-instructions p {
    margin: 0 0 8px 0;
}

.pudo-instructions p:last-child {
    margin-bottom: 0;
}

.pudo-instructions strong {
    color: #533f03;
}

/* Validation errors */
.pudo-validation-errors {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.pudo-validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

.pudo-validation-errors li {
    margin-bottom: 5px;
}

.pudo-validation-errors li:last-child {
    margin-bottom: 0;
}

/* Enhanced field visibility controls */
.pudo-service-type-field.hidden,
.pudo-parcel-size-field.hidden,
.pudo-selected-locker-field.hidden {
    display: none !important;
}

/* Field highlighting for active service types */
.pudo-service-type-field.active {
    background: #e7f3ff;
    border-color: #0073aa;
}

.pudo-parcel-size-field.active {
    background: #f0f8ff;
    border-color: #0073aa;
}

/* Required field indicators */
.pudo-service-type-field .required,
.pudo-parcel-size-field .required {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 3px;
}

/* Service type specific styling */
.service-type-d2d .pudo-parcel-size-field {
    background: #fff5f5;
    border-color: #fed7d7;
}

.service-type-d2l .pudo-service-type-field,
.service-type-l2l .pudo-service-type-field {
    background: #f0fff4;
    border-color: #c6f6d5;
}

/* Smooth transitions for field changes */
.pudo-service-type-field,
.pudo-parcel-size-field,
.pudo-instructions,
.auto-detection-info {
    transition: all 0.3s ease;
}

/* Mobile responsiveness for new fields */
@media (max-width: 768px) {
    .pudo-service-type-field,
    .pudo-parcel-size-field {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .pudo-instructions {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .pudo-validation-errors {
        padding: 10px 12px;
        margin-bottom: 15px;
    }
}

/* Print styles for new components */
@media print {
    .pudo-service-type-field,
    .pudo-parcel-size-field {
        background: white !important;
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    .pudo-instructions,
    .auto-detection-info {
        background: white !important;
        border: 1px solid #000 !important;
    }
    
    .pudo-validation-errors {
        display: none !important;
    }
}

/* Accessibility improvements */
.pudo-service-type-field select:focus,
.pudo-parcel-size-field select:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .pudo-service-type-field,
    .pudo-parcel-size-field {
        border-width: 2px;
    }
    
    .auto-detection-info {
        background: #ffffff;
        border-color: #000000;
        color: #000000;
    }
    
    .pudo-instructions {
        background: #ffffff;
        border-color: #000000;
        color: #000000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .pudo-service-type-field,
    .pudo-parcel-size-field {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .pudo-service-type-field label,
    .pudo-parcel-size-field label {
        color: #e2e8f0;
    }
    
    .pudo-service-type-field select,
    .pudo-parcel-size-field select {
        background: #1a202c;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .auto-detection-info {
        background: #2b6cb0;
        border-color: #3182ce;
        color: #bee3f8;
    }
    
    .pudo-instructions {
        background: #744210;
        border-color: #975a16;
        color: #faf089;
    }
    
    .pudo-validation-errors {
        background: #742a2a;
        border-color: #9b2c2c;
        color: #fed7d7;
    }
}
