.page-specific-content-area {
    padding: 20px;
    max-width: 1725px;
    margin: 27px auto;
    background-color: #1e1e1e;
    border-radius: 8px;
    color: #f0f0f0;
    position: relative;
    border: 2px solid #000;
}

.page-specific-content-area.wide-mode {
    max-width: none;
    display: table;
}

.download-table-preview {
    table-layout: fixed;
    width: 100%;
}

.download-table-preview td,
.download-table-preview th {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

h2 {
    color: #00a8ff;
    text-align: center;
    margin-bottom: 5px;
    margin-top: 5px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.main-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tab-navigation-bb {
    display: flex;
    justify-content: space-around;
    border-bottom: none;
    flex-wrap: wrap;
    margin-bottom: -1px;
}

.tab-button-bb {
    background-color: #333;
    color: #f0f0f0;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border-radius: 8px 8px 0 0;
    flex-grow: 1;
    min-width: 150px;
    text-align: center;
    font-weight: bold;
    border: 1px solid transparent;
    border-bottom: none;
    box-sizing: border-box;
    outline: none;
}

.tab-button-bb:hover {
    background-color: #555;
    color: #00a8ff;
}

.tab-button-bb.active {
    background-color: #222;
    color: #00a8ff;
    border-color: black;
    border-bottom: 1px solid #222;
    cursor: default;
    pointer-events: none;
}

.tab-content-container-bb {
    background-color: #222;
    border: 1px solid black;
    border-radius: 8px;
    padding: 15px;
    flex-grow: 1;
    min-height: 400px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-top: -14px;
}

.table-container {
    background-color: #222;
    border: 1px solid black;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.friendly-members-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    color: #ddd;
    table-layout: fixed;
    flex-grow: 1;
    display: table;
}

.friendly-members-table thead th {
    background-color: #00a8ff;
    color: #1e1e1e;
    font-weight: bold;
    text-align: center;
    padding: 3px 6px;
    border-bottom: 2px solid #1e1e1e;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid #303030;
}

.friendly-members-table thead th.col-name {
    width: 175px;
}

.friendly-members-table thead th.col-last-action {
    width: 125px;
}

.friendly-members-table thead th:last-child {
    border-right: none;
}

.friendly-members-table tbody td {
    padding: 4px 5px !important;
    border-bottom: 1px solid #3a3a40;
    vertical-align: middle !important;
    font-size: 0.85em;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border-right: 1px solid #303030;
    font-weight: bold;
}

.friendly-members-table tbody td:last-child {
    border-right: none;
}

.friendly-members-table tbody tr:last-child td {
    border-bottom: none;
}

.friendly-members-table tbody tr:hover {
    background-color: #38383e;
}

.friendly-members-table a,
.download-table-preview a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: bold !important;
}

.friendly-members-table a:hover,
.download-table-preview a:hover {
    text-decoration: underline !important;
    color: #8ab4f8 !important;
}

.download-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 8px 15px;
    background-color: #4CAF50;
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
    z-index: 10;
}

.download-button:hover {
    background-color: #45a049;
}

.hidden {
    display: none !important;
}

.friendly-members-table td.stat-cell {
    color: black !important;
    font-weight: bold;
}

.table-striped > tbody > tr > td.stat-tier-1 { background: #c8efff; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-2 { background: #b5e4ff; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-3 { background: #a3d9ff; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-4 { background: #90ceff; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-5 { background: #8dc1f4; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-6 { background: #9bb2de; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-7 { background: #aaa1c5; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-8 { background: #bc8ea9; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-9 { background: #d57482; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-10 { background: #e4575a; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-11 { background: #db484c; color: #000000; }
.table-striped > tbody > tr > td.stat-tier-12 { background: #d2393d; color: #FFFFFF; }
.table-striped > tbody > tr > td.stat-tier-13 { background: #c7292c; color: #FFFFFF; }
.table-striped > tbody > tr > td.stat-tier-14 { background: #bc161a; color: #FFFFFF; }

.friendly-members-table tbody td.status-okay { color: #28a745 !important; }
.friendly-members-table tbody td.status-hospital { color: #dc3545 !important; }
.friendly-members-table tbody td.status-jail { color: #ffc107 !important; }
.friendly-members-table tbody td.status-traveling { color: #17a2b8 !important; }
.friendly-members-table tbody td.status-abroad { color: #17a2b8 !important; }
.friendly-members-table tbody td.status-other { color: #ffb86c !important; }

.friendly-members-table td.nerve-text { color: #d32f2f; }
.friendly-members-table td.energy-text { color: #28a745; }

.gain-positive { color: #4CAF50; font-weight: bold; }
.gain-negative { color: #dc3545; font-weight: bold; }
.gain-neutral { color: #f0f0f0; }

.download-table-preview th:nth-child(1), .download-table-preview td:nth-child(1) { width: 170px; }
.download-table-preview th:nth-child(2), .download-table-preview td:nth-child(2) { width: 136px; }
.download-table-preview th:nth-child(3), .download-table-preview td:nth-child(3) { width: 136px; }
.download-table-preview th:nth-child(4), .download-table-preview td:nth-child(4) { width: 136px; }
.download-table-preview th:nth-child(5), .download-table-preview td:nth-child(5) { width: 136px; }
.download-table-preview th:nth-child(6), .download-table-preview td:nth-child(6) { width: 136px; }

.download-table-preview thead th {
    padding: 6px 8px;
    background-color: #00a8ff;
    color: #1e1e1e;
    font-weight: bold;
    text-align: center;
    border-bottom: 2px solid #1e1e1e;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid #303030;
}

.download-table-preview tbody td {
    padding: 4px 8px;
    border-bottom: 1px solid #3a3a40;
    vertical-align: middle;
    font-size: 0.85em;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border-right: 1px solid #303030;
}

@media (max-width: 992px) {
    .page-specific-content-area {
        padding: 15px;
        margin: 15px auto;
        margin-top: 100px;
    }
    .tab-button-bb {
        padding: 8px 10px;
        min-width: 120px;
    }
    .friendly-members-table thead th,
    .friendly-members-table tbody td {
        font-size: 0.8em;
        padding: 3px 5px;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    .friendly-members-table {
        min-width: 600px;
    }
    .friendly-members-table thead th,
    .friendly-members-table tbody td {
        font-size: 0.7em;
        padding: 4px 2px;
    }
}