/* Table Container */
.table-container {
    width: 100%;
    overflow-x: auto; /* Enables horizontal scrolling on small screens */
    margin-top: 15px;
}

/* Styled Table */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0px 2px 5px var(--shadow-color);
}

/* Table Header */
.styled-table thead {
    background: var(--table-header);
    color: var(--light-text-color);
    font-weight: bold;
}

.styled-table thead th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

/* Table Body */
.styled-table tbody tr {
    transition: background 0.3s ease;
}

.styled-table tbody tr:nth-child(even) {
    background: var(--modal-background-color);
}

/* Hover Effect */
.styled-table tbody tr:hover {
    background: var(--table-hover);
}

/* Table Cells */
.styled-table td, .styled-table th {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* Links inside the Table */
.styled-table td a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

.styled-table td a:hover {
    color: var(--text-light);
    text-decoration: underline;
}

/* Style for summary rows */
.styled-table tbody tr.summary-row {
    background-color: var(--accent-color); /* Match header color or use a subtle highlight */
    font-weight: bold;
    border-top: 2px solid var(--primary-color); /* Add a stronger separation */
}

/* Align summary row text properly */
.styled-table tbody tr.summary-row td {
    text-align: center;
    padding: 10px;
}

/* Optional: Make the total column text stand out */
.styled-table tbody tr.summary-row td:nth-child(3),
.styled-table tbody tr.summary-row td:nth-child(4) {
    color: var(--light-text-color);
}

/* Responsive Table */
@media screen and (max-width: 768px) {
    .styled-table thead {
        display: none; /* Hide headers on small screens */
    }

    .styled-table tbody tr {
        display: block;
        margin-bottom: 10px;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px;
        background: var(--primary-color);
    }

    .styled-table tbody tr td {
        display: flex;
        justify-content: space-between;
        padding: 8px;
        border-bottom: none;
    }

    .styled-table tbody tr td::before {
        content: attr(data-label); /* Uses the data-label attribute as a label */
        font-weight: bold;
        color: var(--light-text-color);
    }
}
