/**
 * Rails Validation Styles
 * Styling for rail quantity validation error messages
 */

/* Hide error by default */
.visuallyhidden {
    display: none !important;
}

/* Rails error message styling */
#railsqtyerror {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 15px;
    border: 2px solid #dc3545;
    background-color: #fff3cd;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    color: #721c24;
    animation: shake 0.5s;
}

#railsqtyerror img {
    vertical-align: middle;
    margin-right: 10px;
}

#railsqtyerror span {
    color: #dc3545;
    font-weight: bold;
    font-size: 18px;
}

/* Shake animation for error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Rail listing table styling improvements */
.rail-listing-div {
    margin-bottom: 20px;
}

.rail-listing {
    width: 100%;
    border-collapse: collapse;
}

.rail-listing td {
    padding: 10px;
    border: 1px solid #dee2e6;
}

.rail-listing .dark {
    background-color: #343a40;
    color: white;
    font-weight: bold;
}

.rail-listing .header-text-center-h4 {
    text-align: center;
    font-size: 1.2rem;
    padding: 15px;
}

/* Make rail quantity inputs more visible */
.rail-listing input[type="text"],
.rail-listing input[type="number"] {
    width: 80px !important;
    padding: 5px;
    border: 2px solid #ced4da;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.rail-listing input[type="text"]:focus,
.rail-listing input[type="number"]:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Highlight rail inputs when error is shown */
#railsqtyerror:not(.visuallyhidden) ~ * .rail-listing input {
    border-color: #dc3545;
}
