/* File: tornpas-big-brother.css */

/* ==========================================================================
   Base Styles for TornPAs Big Brother Page
   ========================================================================== */

.page-specific-content-area {
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    color: #f0f0f0;
    position: relative;
}

.download-table-preview {
  table-layout: fixed;
  width: 100%; /* Ensure it respects the container's width */
}

/* This targets the cells inside the download table specifically */
.download-table-preview td,
.download-table-preview th {
  overflow-wrap: break-word; /* Allows long numbers to wrap if needed */
  word-wrap: break-word; /* Fallback for older browsers */
}

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 Styles
   ========================================================================== */

.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;
}

/* Tab Content Container */
.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: -16px;
}

/* Individual Tab Panes */
.tab-pane-bb {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    padding-right: 5px;
}

.tab-pane-bb.active {
    display: block;
}

/* ==========================================================================
   Table Container & Table Styles
   ========================================================================== */

.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;
}

#loading-message-container {
    text-align: center;
    padding: 20px;
    color: #bbb;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.friendly-members-table,
.gains-overview-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,
.gains-overview-table thead th {
    background-color: #00a8ff;
    color: #1e1e1e;
    font-weight: bold;
    text-align: center;
    padding: 10px 8px;
    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:last-child,
.gains-overview-table thead th:last-child {
    border-right: none;
}

.friendly-members-table tbody td,
.gains-overview-table tbody td {
    padding: 8px 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;
}

.friendly-members-table tbody td:last-child,
.gains-overview-table tbody td:last-child {
    border-right: none;
}

.friendly-members-table tbody tr:last-child td,
.gains-overview-table tbody tr:last-child td {
    border-bottom: none;
}

.friendly-members-table tbody tr:hover,
.gains-overview-table tbody tr:hover {
    background-color: #38383e;
}

.friendly-members-table a,
.gains-overview-table a {
    color: #f0f0f0;
    text-decoration: none;
}

.friendly-members-table a:hover,
.gains-overview-table a:hover {
    text-decoration: underline;
    color: #8ab4f8;
}

.admin-controls-placeholder {
    position: absolute;
    top: -55px;
    left: 0px;
    z-index: 10;
}

/* This is the style for the button itself, matching your download button */
#showDiscordSettingsBtn {
    padding: 8px 15px;
    background-color: #5865F2; /* Discord's brand color */
    color: black; /* White text for contrast on the dark blue */
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

#showDiscordSettingsBtn:hover {
    background-color: #4f5bce; /* A slightly darker blue on hover */
}


/* ==========================================================================
   Download Button Styles
   ========================================================================== */
.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;
}

/* ==========================================================================
   Specific Column Widths (for on-screen tables)
   ========================================================================== */

.friendly-members-table th:nth-child(1), .friendly-members-table td:nth-child(1) { width: 12%; }
.friendly-members-table th:nth-child(2), .friendly-members-table td:nth-child(2) { width: 9%; }
.friendly-members-table th:nth-child(3), .friendly-members-table td:nth-child(3) { width: 9%; }
.friendly-members-table th:nth-child(4), .friendly-members-table td:nth-child(4) { width: 9%; }
.friendly-members-table th:nth-child(5), .friendly-members-table td:nth-child(5) { width: 9%; }
.friendly-members-table th:nth-child(6), .friendly-members-table td:nth-child(6) { width: 9%; }
.friendly-members-table th:nth-child(7), .friendly-members-table td:nth-child(7) { width: 8%; }
.friendly-members-table th:nth-child(8), .friendly-members-table td:nth-child(8) { width: 13%; }
.friendly-members-table th:nth-child(9), .friendly-members-table td:nth-child(9) { width: 8%; }
.friendly-members-table th:nth-child(10), .friendly-members-table td:nth-child(10) { width: 8%; }
.friendly-members-table th:nth-child(11), .friendly-members-table td:nth-child(11) { width: 8%; }

.gains-overview-table th:nth-child(1), .gains-overview-table td:nth-child(1) { width: 25%; }
.gains-overview-table th:nth-child(2), .gains-overview-table td:nth-child(2) { width: 15%; }
.gains-overview-table th:nth-child(3), .gains-overview-table td:nth-child(3) { width: 15%; }
.gains-overview-table th:nth-child(4), .gains-overview-table td:nth-child(4) { width: 15%; }
.gains-overview-table th:nth-child(5), .gains-overview-table td:nth-child(5) { width: 15%; }
.gains-overview-table th:nth-child(6), .gains-overview-table td:nth-child(6) { width: 15%; }


/* ==========================================================================
   Dynamic Cell Styling (Status, Nerve, Energy, Drug CD, Battle Stats Color Coding)
   ========================================================================== */

.friendly-members-table td.stat-cell {
    color: black !important;
    font-weight: bold;
}

/* --- STYLES FOR INDIVIDUAL BATTLE STATS (14 Tiers) --- */

/* Default State */
.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; }

/* Hover State */
.table-striped tbody tr:hover td.stat-tier-1 { background: #a0bfcc; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-2 { background: #90b6cc; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-3 { background: #82adcc; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-4 { background: #73a4cc; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-5 { background: #709ac3; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-6 { background: #7c8eb1; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-7 { background: #88809d; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-8 { background: #967187; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-9 { background: #aa5c68; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-10 { background: #b64548; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-11 { background: #af393c; color: #000000; }
.table-striped tbody tr:hover td.stat-tier-12 { background: #a82d30; color: #FFFFFF; }
.table-striped tbody tr:hover td.stat-tier-13 { background: #9f2023; color: #FFFFFF; }
.table-striped tbody tr:hover td.stat-tier-14 { background: #961114; 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;
}

.friendly-members-table td.status-okay {
    color: #28a745;
}
.friendly-members-table td.status-other {
    color: #ffb86c;
}
.friendly-members-table td.status-hospital {
    color: #dc3545;
}

/* Styling for the new Nudge button in the drug cooldown column */
.nudge-btn {
    background-color: #f39c12; /* A vibrant orange */
    color: #000;
    font-weight: bold;
    border: 1px solid #c87600;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s, opacity 0.2s;
    white-space: nowrap;
}

.nudge-btn:hover {
    background-color: #e67e22; /* Slightly darker on hover */
}

.nudge-btn.disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
    border: 1px solid #444;
}


/* ==========================================================================
   Gains Tracking Tab Styles
   ========================================================================== */

.gains-tracking-controls {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
    color: #f0f0f0;
}

.gains-tracking-controls p {
    margin-bottom: 10px;
    font-size: 0.9em;
}

#trackingStatus {
    font-weight: bold;
    color: #e0a71a;
    margin-top: 10px;
    font-size: 1.1em;
}

#gainsStartedAt {
    font-size: 0.85em;
    color: #bbb;
    margin-top: 5px;
}

.action-btn-bb {
    background-color: #007bff;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
    margin: 5px;
}

.action-btn-bb:hover {
    background-color: #0056b3;
}

.action-btn-bb.stop-tracking {
    background-color: #dc3545;
}

.action-btn-bb.stop-tracking:hover {
    background-color: #c82333;
}

.hidden {
    display: none !important;
}

.gain-positive {
    color: #4CAF50;
    font-weight: bold;
}

.gain-negative {
    color: #dc3545;
    font-weight: bold;
}

.gain-neutral {
    color: #f0f0f0;
}

.gains-overview-table .new-member-gain {
    background-color: rgba(0, 168, 255, 0.1);
}
.gains-overview-table .new-member-gain a {
    color: #00a8ff;
}


/* ==========================================================================
   Styles for Temporary Download Table (to make rows tighter AND columns precise)
   ========================================================================== */

.download-table-preview {
    width: 100%; /* Will take 100% of tempContainer's fixed width */
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    color: #ddd;
    table-layout: fixed; /* Reverted to fixed for precise control */
}

/* Explicit pixel widths for the 6 columns for the downloaded image */
/* Adjust these pixel values as needed until they look good together and sum to 800px */
.download-table-preview th:nth-child(1), .download-table-preview td:nth-child(1) { width: 100px; } /* Name */
.download-table-preview th:nth-child(2), .download-table-preview td:nth-child(2) { width: 130px; } /* Strength / Strength Gain */
.download-table-preview th:nth-child(3), .download-table-preview td:nth-child(3) { width: 130px; } /* Dexterity / Dexterity Gain */
.download-table-preview th:nth-child(4), .download-table-preview td:nth-child(4) { width: 130px; } /* Speed / Speed Gain */
.download-table-preview th:nth-child(5), .download-table-preview td:nth-child(5) { width: 130px; } /* Defense / Defense Gain */
.download-table-preview th:nth-child(6), .download-table-preview td:nth-child(6) { width: 130px; } /* Total / Total Gain */


.download-table-preview thead th {
    padding: 6px 8px; /* Reduced vertical padding for headers */
    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 thead th:last-child {
    border-right: none;
}

.download-table-preview tbody td {
    padding: 4px 8px; /* Reduced vertical padding for data cells */
    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;
}

.download-table-preview tbody td:last-child {
    border-right: none;
}

.download-table-preview tbody tr:last-child td {
    border-bottom: none;
}

.download-table-preview tbody tr:hover {
    background-color: #38383e;
}

.download-table-preview a {
    color: #f0f0f0;
    text-decoration: none;
}

.download-table-preview a:hover {
    text-decoration: underline;
    color: #8ab4f8;
}

/* --- NEW MODAL STYLES --- */

/* 1. Backdrop Overlay: Made darker and more opaque as requested. */
#discordSettingsModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Using a dark, near-opaque color for the background */
    background-color: rgba(10, 15, 20, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#discordSettingsModalOverlay:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* 2. The Modal Box: Overhauled with new colors, border, and shadow. */
#discordSettingsModal {
    position: relative; /* Needed to position the close button */
    background-color: #1e1e1e; /* Darker background */
    color: #f0f0f0;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    /* Added a blue border and glow to match your site */
    border: 1px solid #00bfff;
    box-shadow: 0 4px 30px rgba(0, 191, 255, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

#discordSettingsModalOverlay:not(.hidden) #discordSettingsModal {
    transform: translateY(0);
}

/* 3. Modal Sections: Better spacing and dividers */
.modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid #00bfff;
}
.modal-header h4 {
    color: #00bfff; /* Blue title text */
    margin: 0;
    font-size: 1.2em;
}
.modal-body {
    padding: 20px 25px;
}
.modal-footer {
    padding: 15px 25px;
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid #333;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    display: flex;
    justify-content: flex-end; /* Aligns buttons to the right */
    gap: 10px; /* Adds space between buttons */
}

/* 4. Close 'X' Button: Repositioned and styled to be a blue 'X'. */
#closeDiscordSettingsBtn {
    position: absolute;
    top: 5px;
    right: 15px;
    color: #00bfff; /* THE BLUE 'X' */
    font-size: 2.5em; /* Bigger */
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}
#closeDiscordSettingsBtn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* 5. Form Styling: Cleaned up the input fields. */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 0.9em;
}
.form-group input {
    width: 100%;
    padding: 10px;
    background-color: #333;
    border: 1px solid #555;
    border-radius: 4px;
    color: #fff;
    box-sizing: border-box; /* Important for width calculation */
}
.form-group input:focus {
    outline: none;
    border-color: #00bfff;
}

/* 6. Action Buttons: Completely restyled. */
.modal-footer .action-btn {
    padding: 10px 20px;
    border-radius: 5px;
    border: 1px solid transparent;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
/* Save Button (Primary) */
#saveDiscordSettingsBtn {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}
#saveDiscordSettingsBtn:hover {
    background-color: #009fff;
    border-color: #009fff;
    transform: translateY(-2px);
}
/* Cancel Button (Secondary) */
#cancelDiscordSettingsBtn {
    background-color: #444;
    color: #ccc;
    border-color: #555;
}
#cancelDiscordSettingsBtn:hover {
    background-color: #555;
    color: white;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 992px) {
    .page-specific-content-area {
        padding: 15px;
        margin: 15px auto;
    }
    .tab-button-bb {
        padding: 8px 10px;
        min-width: 120px;
    }
    .friendly-members-table thead th,
    .friendly-members-table tbody td,
    .gains-overview-table thead th,
    .gains-overview-table tbody td {
        font-size: 0.8em;
        padding: 6px 4px;
    }

    .friendly-members-table th:nth-child(1), .friendly-members-table td:nth-child(1) { width: 14%; }
    .friendly-members-table th:nth-child(2), .friendly-members-table td:nth-child(2) { width: 9%; }
    .friendly-members-table th:nth-child(3), .friendly-members-table td:nth-child(3) { width: 9%; }
    .friendly-members-table th:nth-child(4), .friendly-members-table td:nth-child(4) { width: 9%; }
    .friendly-members-table th:nth-child(5), .friendly-members-table td:nth-child(5) { width: 9%; }
    .friendly-members-table th:nth-child(6), .friendly-members-table td:nth-child(6) { width: 9%; }
    .friendly-members-table th:nth-child(7), .friendly-members-table td:nth-child(7) { width: 8%; }
    .friendly-members-table th:nth-child(8), .friendly-members-table td:nth-child(8) { width: 12%; }
    .friendly-members-table th:nth-child(9), .friendly-members-table td:nth-child(9) { width: 8%; }
    .friendly-members-table th:nth-child(10), .friendly-members-table td:nth-child(10) { width: 8%; }
    .friendly-members-table th:nth-child(11), .friendly-members-table td:nth-child(11) { width: 8%; }

    .gains-overview-table th:nth-child(1), .gains-overview-table td:nth-child(1) { width: 25%; }
    .gains-overview-table th:nth-child(2), .gains-overview-table td:nth-child(2) { width: 15%; }
    .gains-overview-table th:nth-child(3), .gains-overview-table td:nth-child(3) { width: 15%; }
    .gains-overview-table th:nth-child(4), .gains-overview-table td:nth-child(4) { width: 15%; }
    .gains-overview-table th:nth-child(5), .gains-overview-table td:nth-child(5) { width: 15%; }
    .gains-overview-table th:nth-child(6), .gains-overview-table td:nth-child(6) { width: 15%; }
}

@media (max-width: 768px) {
    .tab-navigation-bb {
        flex-direction: column;
    }
    .tab-button-bb {
        border-radius: 5px;
        margin-bottom: 5px;
    }
    .table-container {
        overflow-x: auto;
    }
    .friendly-members-table,
    .gains-overview-table {
        min-width: 700px;
        table-layout: auto;
    }
    .friendly-members-table thead th,
    .friendly-members-table tbody td,
    .gains-overview-table thead th,
    .gains-overview-table tbody td {
        font-size: 0.75em;
        padding: 5px 3px;
    }
}

@media (max-width: 480px) {
    h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
    .friendly-members-table,
    .gains-overview-table {
        min-width: 600px;
    }
    .friendly-members-table thead th,
    .friendly-members-table tbody td,
    .gains-overview-table thead th,
    .gains-overview-table tbody td {
        font-size: 0.7em;
        padding: 4px 2px;
    }
    .action-btn-bb {
        padding: 6px 10px;
        font-size: 0.8em;
    }
}

@media screen and (max-width: 768px) {
  .friendly-members-table .hide-on-mobile {
    display: none !important;
  }
}

@media (max-width: 380px) {
    .friendly-members-table thead th,
    .friendly-members-table tbody td {
        font-size: 0.6em; /* Even smaller font size */
        padding: 1px 1px; /* Even less padding */
    }
}

.force-landscape-view {
  transform: rotate(90deg);
  transform-origin: left top;
  width: 100vh;
  height: 100vw;
  position: absolute;
  top: 100%;
  left: 0;
}

@media (orientation: landscape) and (max-width: 850px) {
    /* Hide the chat box button when in landscape on a small screen */
    .chat-box-button {
        display: none;
    }
}
@media (orientation: landscape) and (max-width: 850px) {
    .page-specific-content-area {
        padding-top: 20px !important;
    }
}