/**
 * OhShipped Address Validation Styles
 * 
 * @package OhShipped
 * @since 2.2.0
 */

/* Validation Container */
.ohshipped-validation-container {
    margin: 15px 0;
    clear: both;
}

/* Status Indicator */
.ohshipped-address-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ohshipped-status-validating {
    background: #f0f6fc;
    border: 1px solid #58a6ff;
    color: #0969da;
}

.ohshipped-status-valid {
    background: #dafbe1;
    border: 1px solid #3fb950;
    color: #1a7f37;
}

.ohshipped-status-invalid {
    background: #ffebe9;
    border: 1px solid #f85149;
    color: #cf222e;
}

.ohshipped-status-suggestion {
    background: #fff8c5;
    border: 1px solid #d4a72c;
    color: #9a6700;
}

/* Icons */
.ohshipped-icon-check,
.ohshipped-icon-warning,
.ohshipped-icon-info {
    font-size: 16px;
    font-weight: bold;
}

.ohshipped-icon-check {
    color: #1a7f37;
}

.ohshipped-icon-warning {
    color: #cf222e;
}

.ohshipped-icon-info {
    color: #9a6700;
}

/* Spinner */
.ohshipped-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #58a6ff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ohshipped-spin 0.8s linear infinite;
}

@keyframes ohshipped-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Address Suggestion */
.ohshipped-address-suggestion {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid #d4a72c;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ohshipped-suggestion-header {
    font-weight: 600;
    margin-bottom: 10px;
    color: #9a6700;
    font-size: 14px;
}

.ohshipped-suggested-address {
    background: #f6f8fa;
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 14px;
}

.ohshipped-suggested-address strong {
    color: #24292f;
}

/* Suggestion Buttons */
.ohshipped-suggestion-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ohshipped-suggestion-buttons .button {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

.ohshipped-use-suggestion {
    background: #2271b1 !important;
    border-color: #2271b1 !important;
    color: #fff !important;
}

.ohshipped-use-suggestion:hover {
    background: #135e96 !important;
    border-color: #135e96 !important;
}

.ohshipped-keep-original {
    background: #fff !important;
    border-color: #8c8f94 !important;
    color: #50575e !important;
}

.ohshipped-keep-original:hover {
    background: #f6f7f7 !important;
    border-color: #0a4b78 !important;
    color: #0a4b78 !important;
}

/* WooCommerce Integration */
.woocommerce-checkout .ohshipped-validation-container {
    margin: 10px 0 20px 0;
}

.woocommerce-checkout .ohshipped-address-status {
    font-size: 13px;
}

/* Custom Checkout Integration (sc-multistep) */
.sc-multistep-checkout .ohshipped-validation-container {
    margin: 15px 0;
}

.sc-multistep-checkout .ohshipped-address-suggestion {
    border-color: #7b4397;
}

.sc-multistep-checkout .ohshipped-suggestion-header {
    color: #7b4397;
}

.sc-multistep-checkout .ohshipped-use-suggestion {
    background: #7b4397 !important;
    border-color: #7b4397 !important;
}

.sc-multistep-checkout .ohshipped-use-suggestion:hover {
    background: #5d2f73 !important;
    border-color: #5d2f73 !important;
}

/* Mobile Responsive */
@media screen and (max-width: 600px) {
    .ohshipped-suggestion-buttons {
        flex-direction: column;
    }
    
    .ohshipped-suggestion-buttons .button {
        width: 100%;
    }
    
    .ohshipped-address-status {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Inline validation indicators on fields */
.ohshipped-field-valid {
    border-color: #3fb950 !important;
    box-shadow: 0 0 0 1px #3fb950 !important;
}

.ohshipped-field-invalid {
    border-color: #f85149 !important;
    box-shadow: 0 0 0 1px #f85149 !important;
}

/* Hide suggestion when not needed */
.ohshipped-address-suggestion.hidden {
    display: none;
}
