/* Custom Shipping Button next to title */
.custom-shipping-button {
    background: #007cba !important;
    color: white !important;
    border: none !important;
    padding: 6px 12px !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease !important;
    margin-left: 10px !important;
    vertical-align: middle !important;
    display: inline-block !important;
}

.custom-shipping-button:hover {
    background: #005a87 !important;
    color: white !important;
}

.custom-shipping-button:disabled {
    background: #ccc !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

/* Success state for button */
.custom-shipping-button.success {
    background: #46b450 !important;
}

/* Custom Shipping Form Styles */
.custom-shipping-form {
    margin: 15px 0;
}

.custom-shipping-notice {
    margin-bottom: 15px;
    padding: 10px;
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
}

.custom-shipping-notice p {
    margin: 0 0 5px 0;
}

.custom-shipping-notice p:last-child {
    margin-bottom: 0;
    font-size: 14px;
    color: #666;
}

.custom-shipping-fields {
    margin-top: 15px;
}

.custom-shipping-fields .form-row {
    margin: 0 0 15px 0;
}

.custom-shipping-fields .form-row-first {
    float: left;
    width: 48%;
    margin-right: 4%;
}

.custom-shipping-fields .form-row-last {
    float: right;
    width: 48%;
}

.custom-shipping-fields .clear {
    clear: both;
}

.custom-shipping-fields label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.custom-shipping-fields .required {
    color: #f00;
}

.custom-shipping-fields input[type="tel"],
.custom-shipping-fields input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
	box-shadow: none;
}

.custom-shipping-fields input[type="tel"]:focus,
.custom-shipping-fields input[type="email"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

#submit_shipping_request {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

#submit_shipping_request:hover {
    background: #005a87;
}

#submit_shipping_request:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.custom-shipping-response {
    margin-top: 15px;
}

.custom-shipping-response .woocommerce-message,
.custom-shipping-response .woocommerce-error {
    padding: 10px 15px;
    border-radius: 4px;
    margin: 0;
}

.custom-shipping-response .woocommerce-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.custom-shipping-response .woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.field-error {
    color: #d63384 !important;
    font-size: 12px !important;
    margin-top: 5px;
    display: block;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-shipping-fields .form-row-first,
    .custom-shipping-fields .form-row-last {
        float: none;
        width: 100%;
        margin-right: 0;
    }
    
    .custom-shipping-form {
        padding: 15px;
    }
}

/* Animation for hiding form */
.custom-shipping-fields {
    transition: all 0.3s ease;
}

/* WooCommerce checkout integration */
.woocommerce-checkout .custom-shipping-form {
    margin: 10px 0 20px 0;
	text-align: left;
}

/* Shipping method list styling */
#shipping_method li {
    margin-bottom: 5px;
}

#shipping_method li label {
    font-weight: normal;
    cursor: pointer;
    display: inline-block;
    margin-left: 5px;
}

#shipping_method li input[type="radio"] {
    margin-right: 8px;
}

/* Admin styles for the backend table */
.status-pending {
    background: #f56500;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-contacted {
    background: #0073aa;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.status-completed {
    background: #46b450;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

/* Loading state */
.custom-shipping-loading {
    opacity: 0.6;
    pointer-events: none;
}

.custom-shipping-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}