/**
 * Smart Order Filter CSS
 * Styles for the Smart Order Filter feature
 */

/* Message container */
.orderguard-smart-filter-message {
    margin: 10px 0;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    animation: fadeIn 0.3s ease-out;
    display: none;
}

.orderguard-smart-filter-message.error-message {
    background-color: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #d32f2f;
}

.orderguard-smart-filter-message.info-message {
    background-color: rgba(33, 150, 243, 0.1);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #1976d2;
}

.otp-required {
    font-weight: bold;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight for phone field when validation is needed */
#billing_phone.dp-check-needed {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b;
}

/* Loading indicator */
.dp-checking {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

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

/* DP ratio display */
.dp-ratio-display {
    display: flex;
    align-items: center;
    margin-top: 10px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 14px;
}

.dp-ratio-bar {
    flex-grow: 1;
    height: 8px;
    background: linear-gradient(to right, #ef4444 0%, #f59e0b 50%, #22c55e 100%);
    border-radius: 4px;
    margin: 0 10px;
    position: relative;
}

.dp-ratio-marker {
    position: absolute;
    top: -5px;
    width: 2px;
    height: 18px;
    background: #1e293b;
}

.dp-ratio-value {
    font-weight: 600;
    color: #1e293b;
}

/* Phone field wrapper */
.phone-field-wrapper {
    display: block;
    width: 100%;
    position: relative;
}

/* Status indicator styling */
.dp-status-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 99;
    background: transparent;
}

.dp-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    animation: fadeIn 0.3s ease-out;
}

.dp-status-icon.success {
    color: #22c55e;
}

.dp-status-icon.error {
    color: #ef4444;
}

.dp-status-icon.warning {
    color: #f59e0b;
}

.dp-checking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dp-spinner {
    animation: spin 1s linear infinite;
}

/* Phone field styling */
#billing_phone {
    padding-right: 35px;
    transition: all 0.3s ease;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Smart Order Filter Popup */
.orderguard-dp-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.3s ease-out;
}

.orderguard-dp-popup-content {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

.orderguard-dp-popup-header {
    background-color: #ef4444;
    color: #fff;
    padding: 20px;
    text-align: center;
    position: relative;
}

.orderguard-dp-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.orderguard-dp-popup-body {
    padding: 25px;
}

.orderguard-dp-popup-icon {
    width: 60px;
    height: 60px;
    background-color: #fef2f2;
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orderguard-dp-popup-icon svg {
    width: 32px;
    height: 32px;
    fill: #ef4444;
}

.orderguard-dp-popup-message {
    text-align: center;
    margin-bottom: 30px;
    color: #374151;
    font-size: 16px;
    line-height: 1.5;
    padding: 0 15px;
    font-weight: 500;
}

.orderguard-dp-popup-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.orderguard-dp-popup-button {
    padding: 12px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    border: none;
    outline: none;
}

.orderguard-dp-popup-button.primary {
    background-color: #ef4444;
    color: #fff;
}

.orderguard-dp-popup-button.primary:hover {
    background-color: #dc2626;
}

.orderguard-dp-popup-support {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.orderguard-dp-popup-support a {
    color: #ef4444;
    text-decoration: none;
    font-weight: 500;
}

.orderguard-dp-popup-support a:hover {
    text-decoration: underline;
}

/* Warning popup variant */
.orderguard-dp-popup.warning .orderguard-dp-popup-header {
    background-color: #f59e0b;
}

.orderguard-dp-popup.warning .orderguard-dp-popup-icon {
    background-color: #fffbeb;
}

.orderguard-dp-popup.warning .orderguard-dp-popup-icon svg {
    fill: #f59e0b;
}

.orderguard-dp-popup.warning .orderguard-dp-popup-button.primary {
    background-color: #f59e0b;
}

.orderguard-dp-popup.warning .orderguard-dp-popup-button.primary:hover {
    background-color: #d97706;
}

.orderguard-dp-popup.warning .orderguard-dp-popup-support a {
    color: #f59e0b;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Status indicator styling for phone field */
.phone-field-wrapper {
    position: relative;
    width: 100%;
}

.dp-status-indicator {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 99;
}

.dp-status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    animation: fadeIn 0.3s ease-out;
}

.dp-checking-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dp-spinner {
    animation: spin 1s linear infinite;
}

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