/* Specific styles for the vital signs form */
#vital-signs-form-container {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#vital-signs-form-container h2,
#vital-signs-form-container h3 {
    color: #2c3e50;
}

/* Form Styles */
#dietary-form {
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 5px;
}

/* Shift Selection Styles */
#dietary-form .shift-selection {
    margin-bottom: 20px;
}

#dietary-form .shift-selection label {
    margin-right: 15px;
}

/* Patient Section Styles */
#dietary-form .patient-section {
    margin-bottom: 30px;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Table Styles */
#dietary-form table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

#dietary-form th,
#dietary-form td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: left;
}

#dietary-form th {
    background-color: #f2f2f2;
}

/* Input Styles */
#dietary-form input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Button Styles */
#dietary-form button {
    background-color: #3498db;
    color: #fff;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#dietary-form button:hover {
    background-color: #2980b9;
}

#dietary-form #submitForm {
    background-color: #2ecc71;
    font-size: 1.1em;
    margin-top: 20px;
}

#dietary-form #submitForm:hover {
    background-color: #27ae60;
}

/* Error Message Styles */
#dietary-form [id$="-error-messages"] {
    color: #e74c3c;
    margin-top: 10px;
}

/* Modal Styles */
#vital-signs-form-container .modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

#vital-signs-form-container .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 5px;
}

#vital-signs-form-container #closeModal {
    background-color: #e74c3c;
}

#vital-signs-form-container #closeModal:hover {
    background-color: #c0392b;
}

/* Change "Report to Nurse" button color to red */
#dietary-form button[id^="report"] {
    background-color: #dc3545;
}

#dietary-form button[id^="report"]:hover {
    background-color: #c82333;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #vital-signs-form-container {
        padding: 10px;
        font-size: 14px;
        /* Slightly reduce font size on mobile */
    }

    #dietary-form {
        padding: 10px;
    }

    #dietary-form table,
    #dietary-form thead,
    #dietary-form tbody,
    #dietary-form th,
    #dietary-form td,
    #dietary-form tr {
        display: block;
    }

    #dietary-form thead tr {
        position: absolute;
        
    }

    #dietary-form tr {
        margin-bottom: 10px;
    }

    #dietary-form td {
        border: none;
        position: relative;
        padding: 5px 5px 5px 50%;
        text-align: left;
    }

    #dietary-form td:before {
        content: attr(data-label);
        position: absolute;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }

    #dietary-form input[type="text"] {
        width: 100%;
        padding: 5px;
        font-size: 14px;
    }

    #dietary-form button {
        width: 100%;
        margin: 5px 0;
        padding: 10px;
        font-size: 14px;
    }

    /* Adjust shift selection for mobile */
    #dietary-form .shift-selection {
        display: flex;
        flex-direction: column;
    }

    #dietary-form .shift-selection label {
        margin-bottom: 10px;
    }
}

/* Add some extra padding to the bottom of the form for mobile */
@media screen and (max-width: 768px) {
    #dietary-form {
        padding-bottom: 60px;
    }
}

/* Modal styles */
.vital-signs-modal.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    /* Ensure it's above other content */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.vital-signs-modal .modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 5px;
    z-index: 1050;
}

/* Table styles */
.vital-signs-modal #summaryContent table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-family: Arial, sans-serif;
}

.vital-signs-modal #summaryContent th,
.vital-signs-modal #summaryContent td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.vital-signs-modal #summaryContent th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: #333;
}

.vital-signs-modal #summaryContent tr:nth-child(even) {
    background-color: #f9f9f9;
}

.vital-signs-modal #summaryContent tr:hover {
    background-color: #f5f5f5;
}

/* Feedback column styles */
.vital-signs-modal #summaryContent td:last-child {
    font-weight: bold;
}

.vital-signs-modal #summaryContent td:last-child:contains('Correct') {
    color: #28a745;
}

.vital-signs-modal #summaryContent td:last-child:contains('Outside normal range'),
.vital-signs-modal #summaryContent td:last-child:contains('Differs from expected value') {
    color: #dc3545;
}

.vital-signs-modal #summaryContent td:last-child:contains('No data entered') {
    color: #ffc107;
}

/* Close button style */
.vital-signs-modal #closeModal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.vital-signs-modal #closeModal:hover,
.vital-signs-modal #closeModal:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

/* Responsive design for smaller screens */
@media screen and (max-width: 600px) {
    .vital-signs-modal .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .vital-signs-modal #summaryContent table,
    .vital-signs-modal #summaryContent thead,
    .vital-signs-modal #summaryContent tbody,
    .vital-signs-modal #summaryContent th,
    .vital-signs-modal #summaryContent td,
    .vital-signs-modal #summaryContent tr {
        display: block;
    }

    .vital-signs-modal #summaryContent thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .vital-signs-modal #summaryContent tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    .vital-signs-modal #summaryContent td {
        border: none;
        position: relative;
        padding-left: 50%;
    }

    .vital-signs-modal #summaryContent td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
        font-weight: bold;
    }
}