/* ---------------------------------------------------- */
/* --- Text Input Component Styles --- */
/* ---------------------------------------------------- */

.text-input-field {
    padding: 7px 8px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    background-color: var(--color-background);
    color: var(--color-text-dark);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
}

.text-input-field:focus {
    border-color: var(--color-primary);
}

.text-input-field.text-input-error {
    border-color: var(--color-warning-error);
}

.text-input-field.text-input-error:focus {
    border-color: var(--color-warning-error);
}

.text-input-field::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.6;
}

/* Animation for invalid input rejection */
@keyframes input-rejection-flash {
    0% { border-color: var(--color-border-light); }
    50% { border-color: var(--color-warning-error); box-shadow: 0 0 5px var(--color-warning-error); }
    100% { border-color: var(--color-border-light); }
}

.text-input-field.text-input-rejected {
    animation: input-rejection-flash 0.4s ease;
}

/* Container for input + error message */
.text-input-container {
    position: relative;
    width: 100%;
}

/* Error message that appears on rejection */
.text-input-rejection-message {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 2px;
    padding: 4px 8px;
    background-color: var(--color-warning-error);
    color: white;
    font-size: 12px;
    border-radius: 3px;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    z-index: 1000;
}

@keyframes fade-in-out {
    0% { opacity: 0; transform: translateY(-5px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-5px); }
}

.text-input-rejection-message.show {
    animation: fade-in-out 1.5s ease;
}
