/* Global box-sizing reset */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal scrolling */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Background with diagonal gradient */
body {
    font-family: 'Calibri', sans-serif;
    background: linear-gradient(45deg, #e6eef4 25%, transparent 25%, transparent 75%, #e6eef4 75%, #e6eef4),
                linear-gradient(45deg, #e6eef4 25%, transparent 25%, transparent 75%, #e6eef4 75%, #e6eef4);
    background-size: 60px 60px;
    background-position: 0 0, 30px 30px;
    margin: 0;
    padding: 0;
}

/* Container */
#container {
    background-color: white;
    border-radius: 15px; /* Rounded corners */
    padding: 0;
    margin: 20px auto 40px auto; /* Extra bottom margin to reveal the checkered background */
    width: calc(100% - 40px);
    max-width: 95%;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

#MainPage {
    flex: 1;
}

/* Header styles */
header {
    text-align: center;
    z-index: 1;
    width: 100%;
    padding: 20px;
    margin-top: 0; /* Removed negative margin */
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f1f1f1;
}

/* Responsive header adjustments for portrait mode */
@media (orientation: portrait) {
    #container {
        max-width: 95%;
        margin: 10px auto;
    }
    header {
        flex-direction: column;
        text-align: center;
    }
    header img {
        width: 40%;
        margin: 10px 0;
    }
    nav button {
        padding: 8px 16px;
        font-size: 16px;
    }
}


/* Header title styling */
header h1 {
    font-size: 38px;
    margin: 0;
    padding: 20px;
}

/* Header image default styling */
header img {
    width: 15%;
    margin: 0 20px;
}

/* Navigation button styles */
nav button {
    padding: 10px 20px;
    font-size: 18px;
    background-color: #0069B4;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

nav button:hover {
    background-color: lightgray;
}

/* Top banner styling */
#topBanner {
    display: flex;
    border-radius: 15px 15px 0 0;
    z-index: 1;
    width: 100%;
    padding-left: 20px;
    padding-right: 20px;
    justify-content: space-around;
    align-items: center;
    background-color: #f1f1f1;
}

.topButton {
    background: transparent;
    border: none;
    color: #0069B4;
    font-size: 16px;
    cursor: pointer;
    padding: 10px 20px;
}

.topButton:hover {
    background-color: #f1f1f1;
}

/* Modal styling */
.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);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 30%;
    border-radius: 10px;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    margin: 0;
    padding: 0;
}

/* Success modal content */
.successModal-content {
    text-align: center;
    padding: 20px;
}

.successModal-content p {
    font-size: 20px;
    font-weight: bold;
    color: #4CAF50;
    margin: 20px 0;
}

.successModal-content button {
    padding: 10px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.successModal-content button:hover {
    background-color: #45a049;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

label {
    display: block;
    margin-bottom: 10px;
}

input[type="text"], input[type="password"] {
    width: 90%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
th {
    text-align: left;
    padding: 12px;
    border: 2px solid #ddd;
    background-color: #0069B4;
    color: white;
    line-height: 1.5;
}
td {
    text-align: left;
    padding: 8px;
    border: 1px solid #ddd;
    line-height: 1.5;
}
th:last-child, td:last-child {
    width: 50%; /* Double width for the last column */
}
th:nth-child(2), td:nth-child(2) {
    width: 90px;
}
tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Sticky header for tables */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1;
}

.scrollable-content {
    margin: 0;
    border: none;
    max-height: 600px; /* Maximum height for scrollable area */
    overflow-y: auto;
    margin-bottom: 20px;
    display: inline-block; /* Ensure full rows are visible */
}

.table-container {
    max-height: 600px;
    width: 100%;
    overflow: auto;
    display: inline-block;
}

#myTable {
    width: 100%;
}

.title {
    font-size: 24px;
    text-align: left;
    padding-left: 20px;
}

/* Specific styles for the SIDS page layout */
.form-and-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.form-container,
.chart-container {
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
}

/* Ensure the chart stays inside its container */
.chart-container {
    overflow: hidden;
    position: relative;
}

/* Pagination buttons */
.pagination-buttons {
    text-align: center;
}

.day-button {
    width: 100%;
    margin-bottom: 10px;
}

.day-button:hover {
    background-color: lightgray;
}

.light-gray-row {
    color: #6f706d;
}

.light-blue-row {
    color: #4475b1;
}

.light-green-row {
    color: #37b170;
}

/* Mobile adjustments */
@media (max-width: 600px) {
    body { font-size: 14px; }
    header h1 { font-size: 28px; padding: 10px; }
    nav button { font-size: 14px; padding: 8px 12px; }
    th { padding: 8px; }
    td { padding: 4px; }
}

/* Footer styling */
footer {
    background-color: #f1f1f1;  /* Same as header */
    color: #0069B4;             /* Blue text */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px;          /* Slim padding */
    font-size: 10x;            /* Small font size */
    margin-top: 20px;           /* Space above the footer */
    border-bottom-left-radius: 15px;  /* Rounded bottom corners to match container */
    border-bottom-right-radius: 15px;
  }
  

.footer-left {
    display: flex;
    align-items: center;
}

.footer-logo {
    height: 30px;  /* Logo occupies about half the footer's height */
    margin-right: 20px;
}

.footer-right {
    display: flex;
    align-items: center;
}

/* Use percentage margins for responsiveness */
.footer-right a {
    margin-right: 20px;  
    text-decoration: none;
    color: #0069B4;
}

.footer-icon {
    height: 20px;  
    vertical-align: middle;
    margin-right: 10px;
}