/* General Body & Theme */
:root {
    --primary-green: #1f8a38; /* UABC Green */
    --light-green: #e9f5ec;
    --dark-green: #1a752f; /* Darker shade for contrast */
    --text-color: #343a40; /* Keeping a dark neutral for general text */
    --light-gray: #f8f9fa;
}

body {
    background-color: var(--light-gray);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navbar Customization */
.navbar-custom {
    background-color: var(--primary-green); /* Navbar background now green */
    color: #ffffff; /* Text color for navbar */
}

.navbar-custom .navbar-brand,
.navbar-custom .nav-link {
    color: #ffffff; /* Ensure brand and links are white */
}

.navbar-custom .nav-link:hover {
    color: rgba(255, 255, 255, 0.75); /* Lighter on hover */
}

/* Main Title */
h1 {
    color: var(--text-color); /* Keeping a dark neutral for general text */
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.btn-primary:hover {
    background-color: var(--dark-green);
    border-color: var(--dark-green);
}

/* Accordion Filters */
.accordion-item {
    border: none;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.accordion-button {
    font-weight: 600;
    color: var(--text-color);
    background-color: #ffffff;
    border-radius: 5px !important;
    transition: background-color 0.2s ease-in-out;
}

.accordion-button:not(.collapsed) {
    background-color: var(--light-green);
    color: var(--primary-green);
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: transparent;
}

.accordion-body {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(0,0,0,.125);
}

.accordion-body h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Switches for checkboxes */
.form-switch .form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

/* Active Filter Badges */
.active-filters .badge {
    font-size: 0.8rem;
    padding: 0.4em 0.7em;
    display: inline-flex;
    align-items: center;
}

.active-filters .badge .btn-close {
    margin-left: 0.5rem;
    font-size: 0.6rem;
}

/* Table Styling */
.table {
    border-collapse: separate;
    border-spacing: 0 8px; /* Add space between rows */
}

.table thead.thead-dark th {
    background-color: var(--dark-green); /* Changed from dark-gray to dark-green */
    color: #ffffff;
    border: none;
}

.table tbody tr {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 5px;
}

.table tbody td {
    border-top: 1px solid #dee2e6;
}

.table tbody tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease-in-out;
}

/* Action buttons in table */
.btn-group .btn {
    border-radius: 50%; /* Circular buttons */
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0 2px;
}

/* Responsive Card Layout for Table on Small Screens */
@media (max-width: 768px) {
    .table thead {
        display: none; /* Hide table header on mobile */
    }

    .table tbody, .table tr, .table td {
        display: block;
        width: 100%;
    }

    .table tr {
        margin-bottom: 1rem;
        border: 1px solid #dee2e6;
        border-radius: .25rem;
    }

    .table td {
        text-align: right; /* Align content to the right */
        padding-left: 50%; /* Create space for the label */
        position: relative;
        border: none;
        border-bottom: 1px solid #eee;
    }

    .table td::before {
        content: attr(data-label); /* Use data-label for the heading */
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 1rem;
        font-weight: bold;
        text-align: left;
    }

    .table td:last-child {
        border-bottom: 0;
    }

    .table td.text-center {
        text-align: right; /* Override center alignment for actions */
    }

    .btn-group {
        width: 100%;
        display: flex;
        justify-content: flex-end; /* Align buttons to the right */
    }
}

/* Graphs Container */
.graphs-container {
    display: flex;
    flex-wrap: nowrap; /* Ensure items don't wrap */
    overflow-x: auto; /* Use auto instead of scroll for better UX */
    padding: 10px;
    border: 1px solid #ccc;
    gap: 20px; /* Add some space between graphs */
    align-items: flex-start; /* Align items to the start of the cross axis */
}

.graphs-container canvas {
    flex-shrink: 0; /* Prevent canvases from shrinking */
    width: 400px; /* Give them a default width, adjust as needed */
    max-width: 100%; /* Ensure they don't overflow on very small screens */
    height: 300px; /* Maintain aspect ratio or set a fixed height */
    background-color: #fff; /* Ensure background is white */
    border: 1px solid #eee; /* Subtle border */
    border-radius: 5px; /* Rounded corners */
}
