/* ./public/css/feedbackSubmission.css */

/* Style for Likert Scale */
.likert-scale {
    display: flex;
    flex-direction: column;
    padding: 12px;
    background-color: #f5f5f5;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(11, 10, 10, 0.1);
    margin-bottom: 15px;
}

.likert-scale:first-of-type {
    margin-top: 0;  /* Remove space after header */
}

.likert-scale h3 {
    /*text-align: center;*/
    margin-bottom: 20px;
    color: #333;
}

.statement {
    margin: 2px 0 5px 0;
    font-weight: bold;
    color: #333;
}

.options {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 2px;
}

/* Ensure input is invisible but focusable */
.options input[type="radio"] {
    opacity: 0; /* Make the radio button invisible */
    position: absolute; /* Remove from the visual flow */
    left: 0; /* Ensure it's properly aligned for focusability */
    z-index: -1; /* Prevent accidental clicks */
}

/* Style for label replacing input */
.options label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 6px;  /* Reduced top/bottom padding */
    border: 1px solid #d3d3d3;
    border-radius: 4px;
    text-align: center;
    font-size: 13px;  /* Slightly smaller font */
    cursor: pointer;
    color: #333;
    min-width: 45px;  /* Slightly reduced min-width */
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
    user-select: none;
    background-color: #e6f2ff;
}

/* Color coding for each choice when selected */
.options input[type="radio"]:checked + label.strongly-disagree {
    background-color: #ff4c4c;
    border-color: #ff4c4c;
    color: white;
}

.options input[type="radio"]:checked + label.disagree {
    background-color: #ff9900;
    border-color: #ff9900;
    color: white;
}

.options input[type="radio"]:checked + label.neutral {
    background-color: #ffd700;
    border-color: #ffd700;
    color: white;
}

.options input[type="radio"]:checked + label.agree {
    background-color: #9acd32;
    border-color: #9acd32;
    color: white;
}

.options input[type="radio"]:checked + label.strongly-agree {
    background-color: #4caf50;
    border-color: #4caf50;
    color: white;
}

.options input[type="radio"]:checked + label.rarely {
    background-color: #ff9900; /* Orange - same as disagree */
    border-color: #ff9900;
    color: white;
}

.options input[type="radio"]:checked + label.occasionally {
    background-color: #ff9900; /* Orange */
    border-color: #ff9900;
    color: white;
}

.options input[type="radio"]:checked + label.sometimes {
    background-color: #ffd700; /* Yellow */
    border-color: #ffd700;
    color: white;
}

.options input[type="radio"]:checked + label.often {
    background-color: #9acd32; /* Light Green */
    border-color: #9acd32;
    color: white;
}

.options input[type="radio"]:checked + label.usually {
    background-color: #4caf50; /* Green */
    border-color: #4caf50;
    color: white;
}

.options input[type="radio"]:checked + label.never {
    background-color: #ff4c4c; /* Red - same as rarely */
    border-color: #ff4c4c;
    color: white;
}

.options input[type="radio"]:checked + label.always {
    background-color: #4caf50; /* Strong Green - same as usually */
    border-color: #4caf50;
    color: white;
}

/* Hover effect for unselected labels */
.options label:hover {
    background-color: #d1eaff;
}

/* Header Styles */
.text-center h1 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.text-center .lead {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: #6c757d;
    max-width: 100%;
    padding: 0 12px;
}

.text-center.mb-1 {
    max-width: 100%;
    padding: 12px;
    margin: 0 auto;
}

.d-flex.justify-content-center {
    max-width: 100%;
    text-align: left;
    padding: 0;
}

/* Main content wrapper */
main.container {
    min-height: calc(100vh - 160px);
    padding-bottom: 40px; /* Reduced from 120px */
    position: relative;
}

/* Navigation Buttons */
.navigation-buttons {
    width: 100%;
    background: white;
    padding: 10px 0;
    margin-top: 10px;
}

.navigation-buttons > div {
    max-width: 1140px; /* Match Bootstrap container */
    margin: 0 auto;
    padding: 0 15px;
}

.navigation-buttons button {
    min-width: 120px;
}

/* Form group spacing */
.form-group.mt-3 {
    margin-top: 1rem !important; /* Reduce from Bootstrap's mt-3 */
}

/* Remove the fixed padding since buttons are no longer fixed */
.likert-scale:last-child {
    margin-bottom: 0; /* Remove bottom margin from last likert scale */
}

/* Section Visibility */
.feedback-section {
    display: block;
    transition: opacity 0.3s ease-in-out;
}

.feedback-section.hidden {
    display: none;
}

.feedback-section.visible {
    display: block;
}

/* Validation Styles */
.form-group.mt-2 {
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease-in-out;
    margin-bottom: 0.6rem;  /* Reduced from 1.2rem */
    position: relative;
    min-height: 84px; /* Ensure consistent height */
}

.form-group.mt-2.is-invalid {
    border: 2px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
    padding-bottom: 0px; /* Keep padding consistent */
    animation: shake 0.5s;
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875em;
    position: absolute;
    bottom: -20px;
    left: 8px;
    margin: 0;
    padding: 0;
}

.form-group.is-invalid .invalid-feedback {
    display: block;
}

/* Ensure consistent spacing between questions */
.form-group.mt-2:not(:last-child) {
    margin-bottom: 1.5rem;  /* Reduced from 1.75rem */
}

/* Space between sections */
.likert-scale + .likert-scale {
    margin-top: 1rem;
}

/* Shake animation for invalid next button */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
    100% { transform: translateX(0); }
}

.shake-button {
    animation: shake 0.5s;
}

.btn.shake-button:focus {
    box-shadow: none;
}

/* Responsive adjustments for mobile devices */
@media (max-width: 576px) {
    .options {
        flex-direction: column;
        align-items: center;
        gap: 4px;  /* Reduced gap */
        padding-bottom: 8px;
    }

    .options label {
        padding: 8px;  /* Reduced padding for mobile */
        font-size: 14px;
        width: 65%;
    }

    .form-group.mt-2 {
        min-height: auto;
        padding: 4px 8px 12px 8px;
        margin-bottom: 2rem;
    }

    .form-group.mt-2.is-invalid {
        padding-bottom: 12px;
    }

    .invalid-feedback {
        bottom: -20px;
        top: auto;
        left: 8px;
        right: auto;
    }

    .likert-scale {
        padding: 12px;
    }

    .navigation-buttons {
        padding: 10px;
    }
    
    .navigation-buttons > div {
        padding: 0 10px;
    }

    footer.bg-light {
        padding: 8px 0;
    }
}

.float-right {
    float: right;
}