/* General styles for the body */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

/* Header styling */
header {
    background-color: #4CAF50;
    color: white;
    padding: 20px;
    text-align: center;
    font-size: 24px;
}

/* Footer styling */
footer {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 10px;
    position: fixed;
    width: 100%;
    bottom: 0;
}

/* Table styling */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for touch devices */
    background-color: #f4f4f4; /* Prevent scroll background color from looking odd */
    padding: 10px;
}

/* Ensure table is displayed correctly within the container */
.details_table {
    width: auto;
    min-width: 600px; /* Set a minimum width for the table */
    overflow: hidden;
    margin: auto; /* Center the table */
	border-collapse: collapse;
    font-size: 16px; /* Default font size */
}

/* Ensure table is displayed correctly within the container */
.main_table {
    width: auto;
    min-width: 600px; /* Set a minimum width for the table */
    overflow: hidden;
    margin: auto; /* Center the table */
	border-collapse: collapse;
    font-size: 16px; /* Default font size */
}

th, td {
    padding: 8px; /* Add padding for readability */
    text-align: left; /* Align text to the left */
    border: 1px solid #ddd; /* Light border for separation */
}

th {
    background-color: #4CAF50; /* Green header background */
    color: white; /* White text in header */
}

/* Row background color for table cells */
td {
    background-color: #f9f9f9; /* Light background for rows */
}

/* Alternate row background color */
tr:nth-child(even) td {
    background-color: #f1f1f1; /* Slightly darker background for alternate rows */
}

/* Highlight row on hover */
tr:hover td {
    background-color: #e8f5e9; /* Highlight row with a subtle green tint */
    cursor: pointer; /* Change cursor to pointer on hover */
}

/* Make the table responsive */
@media (max-width: 768px) {
    .details_table {
        font-size: 14px; /* Reduce font size */
    }

    .details_table th, .details_table td {
        padding: 6px; /* Reduce padding */
    }
}

/* Even more adjustment for mobile screens */
@media (max-width: 480px) {
    .details_table {
        font-size: 12px; /* Reduce font size further */
    }

    .details_table th, .details_table td {
        padding: 4px; /* Adjust padding */
    }
}

/* Button styling */
button, input[type="submit"] {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
}

.chart-nav {
    text-align: center;
    margin: 20px 0;
    font-size: 18px; /* Increase font size for readability */
}

.chart-nav .nav-btn {
    padding: 5px 15px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 10px;
    font-size: 14px;
}

.chart-nav .nav-btn:hover {
    background-color: #45a049; /* Slight hover effect */
}

.chart-nav .date-display {
    font-size: 14px;
    padding: 5px;
    background-color: #f4f4f4;
    border: 1px solid #ddd;
    border-radius: 5px;
    display: inline-block;
    min-width: 140px;
}

button:hover, input[type="submit"]:hover {
    background-color: #45a049;
}

/* Form styling */
form {
    width: 50%;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 10px;
}

label {
    font-weight: bold;
}

input[type="text"], input[type="password"] {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

a {
    color: #4CAF50;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Content styling */
.content {
    padding: 20px;
    margin: auto;
    max-width: 1200px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Chart styling */
canvas {
    width: 780px;
    height: 380px;
    margin: 0 auto;
}

/* Style for the tab container */
.tab {
    display: flex;
    justify-content: center; /* Centers the buttons */
    margin-top: 20px;
    gap: 10px; /* Adds space between the buttons */
}

/* Back to Meter List Link */
.back-link {
    position: absolute;
    left: 30%;
    font-size: 14px;
    color: white;
    background-color: #4CAF50;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #45a049;
    display: inline-block;
    margin-bottom: 20px;
}

.back-link:hover {
    background-color: #45a049;
    border-color: #3e8e41;
}

/* Responsive Design for Smaller Screens */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    /* Make header, content, and buttons responsive */
    header, .content, footer {
        width: 100%;
        text-align: center;
    }
    
    /* Responsive buttons */
    .chart-nav .nav-btn {
        padding: 10px;
        font-size: 16px;
        width: 40%;
        margin: 5px 0;
    }
    
    /* Responsive charts */
    canvas {
        width: 100% !important;
        height: auto !important;
    }
    
    /* Responsive navigation link */
    .back-link {
        padding: 8px 16px;
        font-size: 16px;
        display: block;
        margin: 10px auto;
    }
}

/* Even more responsive for mobile screens */
@media (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .chart-nav .nav-btn {
        width: 80%;
        font-size: 14px;
    }

    canvas {
        width: 100% !important;
    }
    
    .back-link {
        width: 100%;
        font-size: 14px;
    }
}
