/* Validation and Error Styling */

/* Required indicator styling */
.required-indicator {
    color: var(--error);
    font-weight: normal;
}

/* Error styling for form elements */
.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Ensure textarea error styling works */
textarea.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Ensure product row inputs show error styling */
.product-row input.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Ensure product line name input shows error styling */
.product-line-name-input.error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* Error Summary Box */
#error-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #ffe0e0;
    border-top: 3px solid var(--error);
    padding: 1.5rem;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 50vh;
    overflow-y: auto;
    text-align: center;
}

#error-summary h3 {
    color: var(--error);
    margin: 0 0 1rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
}

#error-summary ul {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    display: inline-block;
    text-align: left;
}

#error-summary li {
    color: #721c24;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

#error-summary li:last-child {
    border-bottom: none;
}

#error-summary button {
    background-color: var(--error);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#error-summary button:hover {
    background-color: #c82333;
}

/* Error Summary responsive styles */
@media (max-width: 768px) {
    #error-summary {
        padding: 1rem;
        max-height: 40vh;
    }

    #error-summary h3 {
        font-size: 1rem;
    }

    #error-summary li {
        font-size: 0.9rem;
    }

    #error-summary button {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Highlight upload field */
.highlight-upload {
    border: 2px solid var(--error) !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
    animation: pulse-border 1s ease-in-out 3;
}

@keyframes pulse-border {
    0% {
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.4);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
    }
}
