/* CSS cho Real-time Validation - Register Form */

/* Border styles cho các trạng thái validation */
.border-error {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.border-success {
    border: 1px solid #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.border-loading {
    border: 1px solid #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background-image: linear-gradient(45deg, transparent 33%, rgba(0, 123, 255, 0.1) 33%, rgba(0, 123, 255, 0.1) 66%, transparent 66%);
    background-size: 30px 30px;
    animation: loading-stripes 1s linear infinite;
}

/* Animation cho loading state */
@keyframes loading-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 30px 0;
    }
}

/* Styling cho error messages */
.error {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.error img {
    margin-right: 5px;
    width: 16px;
    height: 16px;
}

/* Success indicator */
.field-success::after {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Loading indicator */
.field-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Input container positioning for indicators */
.input-container {
    position: relative;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .border-error,
    .border-success,
    .border-loading {
        box-shadow: 0 0 0 0.1rem rgba(0, 123, 255, 0.25) !important;
    }
    
    .error {
        font-size: 12px;
    }
    
    .field-success::after,
    .field-loading::after {
        right: 8px;
    }
}

/* Override existing border classes */
.Email-border.border-error,
.Username-border.border-error,
.Password-border.border-error,
.FirstName-border.border-error,
.LastName-border.border-error,
.FullName-border.border-error {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.Email-border.border-success,
.Username-border.border-success,
.Password-border.border-success,
.FirstName-border.border-success,
.LastName-border.border-success,
.FullName-border.border-success {
    border: 1px solid #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.Email-border.border-loading,
.Username-border.border-loading,
.Password-border.border-loading,
.FirstName-border.border-loading,
.LastName-border.border-loading,
.FullName-border.border-loading {
    border: 1px solid #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background-image: linear-gradient(45deg, transparent 33%, rgba(0, 123, 255, 0.1) 33%, rgba(0, 123, 255, 0.1) 66%, transparent 66%);
    background-size: 30px 30px;
    animation: loading-stripes 1s linear infinite;
}

/* Transition effects */
.txt-input-misaid,
.Email-border,
.Username-border,
.Password-border,
.FirstName-border,
.LastName-border,
.FullName-border {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Focus states */
.txt-input-misaid:focus,
.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Error message container styling */
.label-error-d-none {
    display: none !important;
}

/* Success message for real-time validation */
.validation-success {
    color: #28a745;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.validation-success::before {
    content: "✓";
    margin-right: 5px;
    font-weight: bold;
}

/* Loading message for real-time validation */
.validation-loading {
    color: #007bff;
    font-size: 13px;
    margin-top: 5px;
    display: flex;
    align-items: center;
}

.validation-loading::before {
    content: "";
    width: 12px;
    height: 12px;
    border: 1px solid #f3f3f3;
    border-top: 1px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 5px;
}

/* Specific styling for AutoSales form */
.txt-input-misaid-autosales.border-error {
    border: 1px solid #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.txt-input-misaid-autosales.border-success {
    border: 1px solid #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

.txt-input-misaid-autosales.border-loading {
    border: 1px solid #007bff !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
    background-image: linear-gradient(45deg, transparent 33%, rgba(0, 123, 255, 0.1) 33%, rgba(0, 123, 255, 0.1) 66%, transparent 66%);
    background-size: 30px 30px;
    animation: loading-stripes 1s linear infinite;
}

/* Error styling for AutoSales */
.error-autosales {
    color: #dc3545;
    font-size: 12px;
    margin-top: 3px;
    display: flex;
    align-items: center;
}

.error-autosales img {
    margin-right: 3px;
    width: 14px;
    height: 14px;
}
