/* ==========================================================================
   War Page Hub Specific Styles (war_page_hub.css)
   ========================================================================== */

#factionWarHubTitle {
    grid-area: title; /* Assign title to its grid area */
}

/* Overall Container for the War Page Hub */
#warPageHubContainer {
    background-color: #1e1e1e;
    color: #f0f0f0;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    margin-bottom: 60px; /* Changed -50px to a positive value */
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    width: 98%;
    max-width: 1800px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0px;
    min-height: calc(100vh - 240px);
    border: 3px solid black;
}
#factionWarHubTitle {
    grid-area: title; /* Assignts grid area */
}

.tab-navigation {
    grid-area: tabs; /* Assign tab navigation to its grid area */
    margin-bottom: 0; /* Keep this if you want no margin below the tabs */
}

.tab-content-container {
    grid-area: content; /* Assign tab content to its grid area */
    /* Remove any width or flex-grow properties here if they conflict with grid-area */
    flex-grow: unset; /* Override flex-grow as grid handles sizing */
    height: auto; /* Allow height to be determined by grid */
    min-height: 400px; /* Keep minimum height for content */
}

/* Script Title */
.script-title {
    /* Styles for the main title */
    color: #00a8ff; /* NEW: Changed to blue theme color */
    text-align: center;
    margin-bottom: 10px; /* NEW: Reduced bottom margin */
    margin-top: 5px; /* NEW: Reduced top margin to move higher */
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}


/* This makes the 'Live Faction Activity' tab scrollable */
#live-faction-activity-tab {
    max-height: 70vh; /* Sets a max height (70% of the browser window) */
    overflow-y: auto; /* Adds a scrollbar only when the table is taller than the max height */
}


/* Tab Navigation Styles */
.tab-navigation {
    /* Styles for the tab buttons container */
    display: flex;
    justify-content: space-around;
    margin-bottom: 0; /* NEW: Reduced bottom margin */
    border-bottom: none; /* REMOVED separating border */
    flex-wrap: wrap;
    margin-top: 0;
}

.tab-button {
    /* Styles for individual tab buttons */
    background-color: #333;
    color: #f0f0f0;
    padding: 8px 12px; /* NEW: Slightly reduced padding */
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease; /* Add color and border-color to transition */
    border-radius: 5px 5px 0 0; /* Rounded top corners */
    flex-grow: 1; /* Make buttons grow to fill space */
    min-width: 120px; /* Minimum width for each tab */
    text-align: center;
	font-weight: bold;
}


.tab-button:hover {
    background-color: #555; /* NEW: A slightly different hover color for non-active */
    color: #f0f0f0;
    border-color: #00a8ff; /* Highlight border on hover */
}

.tab-button.active {
    /* Active state */
    background-color: #00a8ff; /* NEW: Changed to blue theme color */
    color: #1e1e1e; /* Dark text on blue */
    border-color: #00a8ff; /* Active border color */
}

/* Tab Content Container */
.tab-content-container {
    /* Styles for the container holding tab contents */
    padding: 15px; /* NEW: Reduced padding */
    border-radius: 0 0 8px 8px;
    background-color: #333;
    flex-grow: 1;
    height: auto;
    overflow-y: auto; /* CHANGE THIS: Will add a scrollbar if content overflows vertically */
    box-sizing: border-box;
    margin-top: 0;
    padding-top: 0;
    min-height: 400px; /* OPTIONAL: Ensures a minimum height, adjust px as needed */
}
.tab-pane {
    /* Styles for individual tab content areas */
    display: none;
    height: auto; /* IMPORTANT CHANGE: Allow height to be determined by content */
    overflow-y: visible; /* IMPORTANT CHANGE: Prevent internal vertical scrollbars */
}

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


/* Styles for the Leader Config Tab's content pane (the one with id="leader-config-tab" in your HTML) */
#leader-config-tab.active {
    /* This rule defines properties for the *overall tab pane*, not its internal grid */
    padding: 10px; 
    box-sizing: border-box; 
    /* The grid properties have been removed from here to prevent conflict */
}

/* CORRECTED: Apply grid to the .config-grid class which is the direct parent of your sections */
.config-grid {
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; /* Three equal-width columns for desktop */
    gap: 20px; 
    padding: 0; /* Adjust as needed, typically 0 here as sections have padding */
    box-sizing: border-box;
    max-width: 1750px; /* Max-width for the grid content */
    margin: 0 auto; /* Center the grid container horizontally */
}

/* Ensure the "Designate Tab 4 Admins" section stays in one column (no full width) */
.config-section.designate-admins-section {
    grid-column: auto;
	
}

/* --- END LEADER CONFIG TAB SPECIFIC STYLES --- */

/* You will also need to ensure this rule is correctly placed inside your @media (max-width: 992px) block: */
@media (max-width: 992px) {
    /* ... (your other existing rules in this media query) ... */

    /* CORRECTED: This now targets .config-grid for responsive stacking */
    .config-grid {
        grid-template-columns: 1fr; /* Stack columns vertically on medium screens */
        max-width: 600px; /* Limit width similar to other responsive sections */
    }
}

/* War Announcement Section (Tab 1) */
.war-announcement-section {
    margin-bottom: 15px; /* NEW: Reduced margin */
    padding: 10px; /* NEW: Reduced padding */
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #222;
    text-align: left;
}

.war-announcement-section h3 {
    color: #00a8ff; /* NEW: Changed to blue theme color */
    margin-bottom: 8px; /* NEW: Reduced margin */
    margin-top: 0; /* NEW: Remove top margin */
    text-align: center;
    font-size: 1.5em; /* NEW: Slightly adjusted font size */
}
/* Styling for the new grid layout in the Announcements tab */
.announcements-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid for 3 columns */
    gap: 20px; /* Space between the three containers */
    padding: 10px; /* Optional: internal padding for the grid */
    box-sizing: border-box;
    width: 100%; /* Ensure it takes full width of its parent */
    max-width: 1750px; /* Adjust to match your overall max-width if desired */
    margin: 0 auto; /* Center the grid if it's narrower than its parent */
}
.announcements-grid-container > .announcement-section-item:nth-child(2) {
    align-self: start;
}

/* Style for each individual container within the announcements grid */
.announcement-section-item {
    display: flex; /* Make it a flex container to align its inner content (the war-announcement-section) */
    flex-direction: column; /* Stack content vertically */
    /* flex-grow: 1; /* Uncomment if you want items to grow and fill available space */
}

/* Ensure the .war-announcement-section inside this grid also fills its space */
.announcement-section-item .war-announcement-section {
    flex-grow: 1; /* Make the inner content grow to fill the container height if items are stretched */
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack its own content vertically */
    justify-content: space-between; /* Distribute space between header, content, and button */

    /* Apply box styling similar to .config-section */
    border: 1px solid black; /* Matching the border from .config-section */
    border-radius: 8px; /* Matching the border-radius from .config-section */
    background-color: #222; /* Matching the background from .config-section */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Add shadow for depth like other boxes */
    padding: 10px; /* Adjust internal padding to match .config-section */
    box-sizing: border-box;
}

/* Styling for the new scrollable checkbox containers */
/* Styling for the new scrollable checkbox containers */
.member-checkbox-list {
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    max-height: 150px; /* Keeps the scroll behavior */
    overflow-y: auto; /* Enables vertical scrolling */
    padding: 8px; /* Internal padding for the list */
    box-sizing: border-box;

    /* NEW ADAPTATIONS: Two columns of names */
    display: grid; /* Changed from flex to grid */
    grid-template-columns: 150px 150px 150px;
    gap: 13px 15px; /* Vertical gap 8px, Horizontal gap 15px between items */

    margin-bottom: 8px; /* Space below the list, similar to inputs */
}


.active-ops-main-content-row {
    display: flex; /* Makes its children (left & right panels) go side-by-side */
    flex-grow: 1; /* Allows this row to take up remaining vertical space */
    gap: 20px; /* Space between the left and right panels */
    width: 100%; /* Ensures it spans the full width of its parent */
    align-items: flex-start; /* Aligns content to the top within the row */
    flex-wrap: wrap; /* Allows wrapping to column layout on smaller screens */
}

.chat-tab:hover {
background-color: #555;
color: #00a8ff; /* Highlight on hover */
}

.chat-tab:last-child {
border-right: none; /* No border on the very last tab */
}

.chat-tab.active {
    background-color: #00a8ff; /* This makes the tab blue */
    color: #1e1e1e; /* This makes the text dark for contrast */
    border-color: #00a8ff; /* Adds a blue border to match */
}
.active-ops-left-panel {
display: flex;
flex-direction: column;
flex: 1; /* Allows it to grow and shrink */
min-width: 450px;

}


/* Right Panel: Holds the chatbox */
.active-ops-right-panel {
display: flex;
flex-direction: column; /* Stack chat elements vertically */
flex: 1; /* Allows it to grow and shrink */
min-width: 300px; /* Minimum width for the chatbox side */

}

.chat-container {
 
background-color: #222;
border: 1px solid black;
border-radius: 8px;
display: flex;
flex-direction: column; /* Stack tabs, display, inpvertically */
height: 100%; /* MODIFIED: Fill the parent panel's new height */
overflow: hidden; /* Ensures content stays within rounded borders */
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Add shadow for depth */
}

.enemy-targets-list-section {
  max-width: 900px; 
  background-color: #222;
  border: 1px solid black;
  border-radius: 8px;
  overflow: hidden; 
  height: 475px; /* This makes it match the chat box height */
  display: flex; /* Add flex to help center the placeholder text */
  flex-direction: column; /* Stack content vertically */
}

/* ==================================================================
   War History Log Styles
   ================================================================== */

.war-history-container {
    padding: 10px 15px;
    box-sizing: border-box;
    height: 100%; /* Make container fill the panel height */
    display: flex;
    flex-direction: column;
}

.war-history-container h4 {
    color: #e0a71a;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.war-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px; /* Space between each war entry */
    overflow-y: auto; /* Add scrollbar if content overflows */
    padding-right: 5px; /* Space for the scrollbar */
}

.war-history-item {
    display: grid;
    /* 4 columns: Opponent, Result, Score, Time */
    grid-template-columns: 2.5fr 0.5fr 1.5fr 1fr; 
    align-items: center;
    gap: 15px; /* Space between columns */
    padding: 12px 15px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a40;
    border-radius: 5px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.war-history-item:hover {
    background-color: #38383e;
    border-color: #555;
}

.war-history-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.war-history-item .opponent-name {
    font-weight: bold;
    color: #f0f0f0;
    text-align: left; /* Align opponent name to the left for readability */
}

.war-history-item .war-result {
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
}

.war-history-item .war-result-win {
    color: #4CAF50; /* Green for Win */
}

.war-history-item .war-result-loss {
    color: #d9534f; /* Red for Loss */
}

.war-history-item .war-score {
    font-family: 'Courier New', Courier, monospace;
    color: #ccc;
    text-align: center;
}

.war-history-item .war-time {
    font-size: 0.9em;
    color: #999;
    text-align: right; /* Align time to the right */
}

/* ==================================================================
   War History Header & W/L Ratio Box Styles
   ================================================================== */

/* This new container holds the title and the ratio box */
.war-history-header {
    display: flex;
    justify-content: space-between; 
    align-items: center;
    position: relative; /* This is needed for centering to work */
    margin-bottom: -15px;
    padding-bottom: 10px;
}

/* We need to remove the border from the h4 itself so it doesn't double up */
.war-history-header h4 {
    margin: 0;
    padding: 0;
    border: none;
    /* --- These lines do the centering --- */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* This is the "nice little box" for the ratio */
.win-loss-ratio-box {
    display: flex;
    flex-direction: column; /* Stacks the label and numbers vertically */
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 4px 12px;
    flex-shrink: 0; /* Prevents the box from shrinking */
}

/* The "W/L (Last X)" label */
.win-loss-ratio-box span:first-child {
    font-size: 0.7em;
    font-weight: bold;
    color: #e0a71a; /* Gold theme color */
    text-transform: uppercase;
    white-space: nowrap;
}

/* The "10 / 5" numbers */
.win-loss-ratio-box .ratio-value {
    font-size: 1.2em;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    color: #f0f0f0;
    line-height: 1.1;
}

/* ==================================================================
   War History Panel Additions (Respect & Top Hitters)
   ================================================================== */

/* --- Respect Gained Box --- */
.respect-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid #555;
    border-radius: 6px;
    padding: 4px 12px;
    flex-shrink: 0;
    text-align: center;
}

.respect-box span:first-child {
    font-size: 0.7em;
    font-weight: bold;
    color: #e0a71a; /* Gold theme color */
    text-transform: uppercase;
}

.respect-box .respect-line {
    font-size: 0.85em;
    font-family: 'Courier New', Courier, monospace;
    color: #f0f0f0;
    white-space: nowrap;
}

.respect-box .respect-line strong {
    color: #8ab4f8; /* Light blue for the numbers */
}

/* --- Top Hitters Podium --- */
.top-hitters-container {
    padding: 15px 0;
    margin-top: 15px;
    border-top: 1px solid #444;
    border-bottom: 1px solid #444;
}

.top-hitters-container h5 {
    color: #e0a71a;
    text-align: center;
    margin: 0 0 15px 0;
    font-size: 1.3em;
}

.top-hitters-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: flex-end; /* This makes the podium steps have different heights */
    flex-wrap: wrap; /* Allows wrapping on small screens */
}

.top-hitter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border-width: 2px;
    border-style: solid;
    border-radius: 8px;
    background: linear-gradient(145deg, #333, #222);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    flex-basis: 200px; /* Give a base width to each item */
    flex-grow: 1;
    max-width: 250px;
}

/* Podium Rank Colors & Sizing */
.top-hitter-item.rank-1 {
    border-color: #ffd700; /* Gold */
    padding-top: 25px; 
    padding-bottom: 25px;
    order: 2; /* Middle item */
}
.top-hitter-item.rank-2 {
    border-color: #c0c0c0; /* Silver */
    order: 1; /* Left item */
}
.top-hitter-item.rank-3 {
    border-color: #cd7f32; /* Bronze */
    order: 3; /* Right item */
}

/* Content inside each podium box */
.top-hitter-item .hitter-rank {
    font-size: 1.8em;
    font-weight: bold;
    line-height: 1;
}
.top-hitter-item.rank-1 .hitter-rank { color: #ffd700; }
.top-hitter-item.rank-2 .hitter-rank { color: #c0c0c0; }
.top-hitter-item.rank-3 .hitter-rank { color: #cd7f32; }

.top-hitter-item .hitter-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #f0f0f0;
    margin: 5px 0;
}

.top-hitter-item .hitter-score {
    font-size: 1em;
    color: #ccc;
}

.chat-tab {
 padding: 8px 10px; /* MODIFIED PADDING */
 background-color: #333;
 color: #f0f0f0;
 font-weight: bold;
 font-size: 0.9em; /* ADDED FONT-SIZE TO MATCH TABLE HEADER */
 text-align: center;
 cursor: pointer;
 flex-grow: 1;
 white-space: nowrap;
 border-bottom: none; /* Remove bottom border to blend with container */
 border-right-width: 0; /* Temporarily remove right border */
 border-radius: 5px 5px 0 0;
 transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Top row of smaller buttons (siren, blank) */
.chat-input-buttons-top {
display: flex;
justify-content: flex-start; /* Align buttons to the left */
gap: 5px; /* Space between buttons */ 
margin-top: 5px; /* This will pull the circular buttons up. Adjust the value (e.g., -5px for less, -15px for more) as needed. */
padding-bottom: 0; /* Ensures no extra padding pushes them down */
}


/* Small action buttons (siren, blank) */
.chat-action-btn {
width: 35px; /* Small fixed width */
height: 35px; /* Small fixed height */
line-height: 35px;
padding: 0; /* Remove default padding */
border: 1px solid #00a8ff;
border-radius: 50%; /* Make them circular */
background-color: #1e1e1e;
color: #f0f0f0;
font-size: 1.2em; /* Adjust icon size */
cursor: pointer;
display: flex;
justify-content: center;
align-items: center;
transition: background-color 0.2s ease, border-color 0.2s ease;
flex-shrink: 0; /* Prevent shrinking */
}

.chat-action-btn.siren-btn {
    color: #ff0000; /* Red for siren */
}

.chat-action-btn:hover {
    background-color: #00a8ff;
    border-color: #00e0ff;
    color: #1e1e1e; /* Darken icon on hover */
}

.chat-input-text-send {
display: flex;
gap: 10px; /* Space between input and send button */
width: 100%;
padding-top: 0;
margin-top: 15px; 
}

.chat-text-input {
flex-grow: 1; /* Input field takes up available space */
padding: 8px 10px;
border: 1px solid #555;
border-radius: 4px;
background-color: #1e1e1e;
color: #f0f0f0;
font-size: 0.9em;
box-sizing: border-box;
}


.chat-send-btn {
flex-shrink: 0; /* Prevent button from shrinking */
padding: 8px 15px;
border: 2px solid black;
border-radius: 4px;
background-color: #007bff; /* Blue send button */
color: black;
font-size: 0.9em;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s ease;
}

.chat-send-btn:hover {
  background-color: #00a8ff;
}

.chat-message {
    color: #f0f0f0; /* A light, visible color for the main message text */
    font-size: 0.9em; /* Adjust font size as needed for readability */
    word-wrap: break-word; /* Ensures long words break and wrap */
    overflow-wrap: break-word; /* Modern equivalent */
	white-space: normal;
}

.chat-timestamp {
    color: #a0a0a0; /* Slightly lighter gray for timestamps */
    font-size: 0.75em;
    margin-right: 5px;
    white-space: nowrap; /* Prevent timestamp from wrapping */
}

.chat-sender {
    color: #00a8ff; /* Your theme's blue for sender names */
    font-weight: bold;
    margin-right: 5px;
    white-space: nowrap; /* Prevent sender name from wrapping */
}
/* Optional: Add some padding to chat display area if messages look too cramped */
.chat-display-area {
    padding: 5px; /* Adds a little breathing room inside the chat box */
}

/* Ensure the main chat text also picks up the color if not inherited */
.chat-text {
    color: #f0f0f0; /* Explicitly set main text color */
	word-break: break-word; /* NEW: Forces long words to break and wrap onto the next line */
    overflow-wrap: break-word; /* NEW: Modern equivalent for better browser compatibility */
    white-space: normal; /* NEW: Ensures normal text wrapping (should already be there or inherited) */
}

#warChatBox {
    display: flex;
    flex-direction: column; /* Stack children vertically */
    flex-grow: 1; /* Allows it to fill the height of its parent (.active-ops-chat-panel) */
    height: 100%; /* Explicitly take 100% of its parent's height */
    overflow: hidden; /* CRUCIAL: Ensures content stays within its rounded borders and clips children */
    box-sizing: border-box; /* Include padding/border in total dimensions */

    /* Keep existing visual styles for #warChatBox frame if they were here */
    background-color: #222; /* Example: Dark background */
    border: 1px solid black; /* Example: Border */
    border-radius: 8px; /* Example: Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Example: Shadow */
}

/* Container for chat tabs (e.g., Faction Chat, Private Chat) */
.chat-tabs-container {
    display: flex;
    flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
    flex-shrink: 0; /* CRITICAL: Prevent this area from shrinking */
    border-bottom: 2px black; /* Separator below tabs */
    background-color: #333; /* Slightly lighter background for tabs bar */
    border-radius: 8px 8px 0 0; /* Rounded top corners to match container */
    overflow-x: auto; /* Allow horizontal scrolling if tabs overflow */
    white-space: nowrap; /* Keep tabs in a single line if overflowing */
    box-sizing: border-box; /* Include padding/border */
}


/* Styles for the actual chat messages display area, *inside* the scroll wrapper */
/* This div should NOT control its own height or overflow; its parent wrapper does. */
.chat-display-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-sizing: border-box;
   
}

/* Chat Input Area (bottom section with buttons and text input) */
/* Chat Input Area (bottom section with buttons and text input) */
.chat-input-area {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 110px; /* Reduced from 110px to make it shorter */
    background-color: #333;
    padding: 5px 10px 8px;
    border-top: 1px solid #1e1e1e;
    gap: 8px;
    box-sizing: border-box;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* --- SCROLLBAR STYLING FOR CHAT MESSAGES (Applied to .chat-messages-scroll-wrapper) --- */
/* (Ensure these are present and only for .chat-messages-scroll-wrapper) */
.chat-messages-scroll-wrapper::-webkit-scrollbar {
    width: 8px;
}
.chat-messages-scroll-wrapper::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 10px;
}
.chat-messages-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 10px;
}
.chat-messages-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6a7488;
}

.status-summary-two-col {
    display: flex; /* Use flexbox to arrange items horizontally */
    justify-content: space-around; /* Distribute space evenly around items */
    align-items: center; /* Vertically align items in the middle */
    padding-top: 10px; /* Add some padding above the content */
    padding-bottom: 5px; /* Add some padding below */
    gap: 15px; /* Space between the two items */
    flex-wrap: wrap; /* Allow items to wrap on smaller screens if they don't fit */
}

/* Ensure the status-value-box is visible within this new layout */
.status-summary-two-col .status-value-box {
    margin-top: 0; /* Remove default margin-top if not needed for vertical stacking */
}

.member-checkbox-list .member-selection-item {
    display: flex;
    align-items: center; /* Vertically centers name and checkbox */
    flex-direction: row; /* Keeps the label and checkbox in order */
    gap: 5px; /* Controls the small space between the label and checkbox */
    color: #f0f0f0;
    font-size: 0.9em;
    /* REMOVED: max-height: 334px; */ 
    background-color: #2a2a2a; /* A slightly lighter shade for the inner box background */
    border: 1px solid #444; /* A subtle border around each member's box */
    border-radius: 4px; /* Slightly rounded corners for the box */
    padding: 6px 8px; /* Internal padding inside each member's box */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* A very subtle shadow for depth */
}
.enemy-targets-table thead th:not(:last-child) {
    border-right: 1px solid #303030; /* Adds a thin, dark vertical line */
}

.enemy-targets-table tbody td:not(:last-child) {
    border-right: 1px solid #303030; /* Adds a thin, dark vertical line */
}

.member-checkbox-list .member-selection-item label {
    cursor: pointer;
    flex-grow: 1; /* Allows the name (label) to take up available space */
    text-align: left; /* Ensures label text remains left-aligned */
    order: 0; /* Puts the label visually before the checkbox */
}
/* Adjust textarea within the moved Faction Announcements to stretch and have margin */
.announcement-section-item .war-announcement-section textarea {
    flex-grow: 1; /* Allow textarea to grow and take available space */
    margin-bottom: 15px; /* Ensure space above button */
    height: auto; /* Allow height to adjust */
    min-height: 80px; /* Match min-height from config-section textarea */
    resize: vertical; /* Allow vertical resizing */
}

@media (max-width: 768px) {
    .announcements-grid-container {
        gap: 15px; /* Slightly reduce gap on smaller screens */
    }
}

@media (max-width: 480px) {
    .announcements-grid-container {
        gap: 8px; /* Further reduce gap on very small screens */
        padding: 5px; /* Reduce padding for tight spaces */
    }
    .announcement-section-item .war-announcement-section {
        padding: 8px; /* Adjust inner padding of the boxes */
    }
    .announcement-section-item .war-announcement-section textarea {
        min-height: 60px; /* Adjust textarea min-height for small screens */
    }
}



/* Scrollbar styling for a cleaner look */
#chat-display-area::-webkit-scrollbar {
    width: 8px;
}
#chat-display-area::-webkit-scrollbar-track {
    background: #1a202c;
    border-radius: 10px;
}
#chat-display-area::-webkit-scrollbar-thumb {
    background: #4a5568;
    border-radius: 10px;
}
#chat-display-area::-webkit-scrollbar-thumb:hover {
    background: #6a7488;
}

/* Base style for dynamically added chat messages */
.chat-message {
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 80%; /* Messages won't take full width */
    word-wrap: break-word; /* Crucial: breaks long words to fit container */
    overflow-wrap: break-word; /* Modern alternative */
    white-space: normal; /* Ensures normal text wrapping */
    transition: opacity 0.5s ease-out, transform 0.5s ease-out; /* Animation properties */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Style for user's own messages */
.chat-message.user-message {
    background-color: #3182ce; /* Distinct blue for user messages */
    color: #ffffff;
    align-self: flex-end; /* Align to the right */
    border-bottom-right-radius: 5px; /* Slightly different corner for visual distinction */
}

/* Style for bot/other messages */
.chat-message.bot-message {
    background-color: #63b3ed; /* Lighter blue for bot messages */
    color: #1a202c; /* Darker text for contrast on light background */
    align-self: flex-start; /* Align to the left */
    border-bottom-left-radius: 5px; /* Slightly different corner */
}

/* Animation class for messages that are about to disappear */
.chat-message.fade-out {
    opacity: 0;
    transform: translateY(-20px); /* Moves the message up as it fades */
}

/* --- Status-Specific Colors --- */
.enemy-targets-table .status-hospital {
    color: #ff5c5c; /* Red for hospital */
    font-weight: bold;
}

.enemy-targets-table .status-other {
    color: #ffb86c; /* Orange for other states like Jail/Abroad */
}

/* --- Link and Button Styles --- */
.enemy-targets-table a {
    color: #8ab4f8; /* A nice blue for links */
    text-decoration: none;
}

.enemy-targets-table a:hover {
    text-decoration: underline;
}

/* Style the "Attack" link to look like a button */
.enemy-targets-table .attack-link {
    display: inline-block;
    background-color: #3d84b8; /* Blue for attack */
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.enemy-targets-table .attack-link:hover {
    background-color: #4a9dcf;
    text-decoration: none;
}

/* Style the "Claim" button */
.enemy-targets-table .claim-btn {
    background-color: #4CAF50; /* Green for claim */
    color: white;
    border: none;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.enemy-targets-table .claim-btn:hover {
    background-color: #5cb85c;
}

/* Style for when the button is disabled or says "Unclaim" */
.enemy-targets-table .claim-btn:disabled,
.enemy-targets-table .claim-btn[onclick*="unclaimTarget"] {
    background-color: #d9534f; /* Red for "Unclaim" state */
    cursor: pointer;
}

.enemy-targets-table .claim-btn[onclick*="unclaimTarget"]:hover {
    background-color: #c9302c;
}

/* MODIFIED: game-plan-display to match height and center content */
/* MODIFIED: game-plan-display to handle images and center content */
/* REPLACE your existing #gamePlanDisplay rule with this: */
.game-plan-display { /* Note: This also applies to the class if used elsewhere */
    background-color: #333;
    color: #f0f0f0;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 10px;
    min-height: 80px;
    white-space: pre-wrap; /* Preserve white space for text */
    font-family: 'Courier New', Courier, monospace; /* Font for text content */
    font-size: 0.9em; /* Font size for text content */
    flex-grow: 1;
    display: flex;
    flex-direction: column; /* Allow content (text or image) to stack vertically */
    align-items: center; /* Center content (text or image) horizontally */
    justify-content: center; /* Center content (text or image) vertically */
    text-align: center; /* Ensure text alignment */
    box-sizing: border-box;

    overflow: hidden; /* IMPORTANT: Ensures images or large content don't break out of the box */
}

/* MODIFIED: factionAnnouncementsDisplay to handle images and center content */
/* REPLACE your existing #factionAnnouncementsDisplay rule with this: */
#factionAnnouncementsDisplay {
    /* Inherits many styles from .game-plan-display. Ensure flex properties for centering. */
    flex-grow: 1;
    display: flex;
    flex-direction: column; /* Allow content (text or image) to stack vertically */
    align-items: center; /* Center content (text or image) horizontally */
    justify-content: center; /* Center content (text or image) vertically */
    text-align: center; /* Ensure text alignment */
    padding: 15px;
    box-sizing: border-box;
    background-color: #333;
    color: #f0f0f0;
    border-radius: 5px;
    min-height: 80px;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;

    overflow: hidden; /* IMPORTANT: Ensures images or large content don't break out of the box */
}

/* NEW: Styles for images displayed within gamePlanDisplay and factionAnnouncementsDisplay */
/* ADD this new rule: */
.game-plan-display img,
#factionAnnouncementsDisplay img {
    max-width: 100%; /* Ensures image doesn't overflow its container horizontally */
    max-height: 100%; /* Ensures image doesn't overflow its container vertically (important for GIFs) */
    height: auto; /* Maintains aspect ratio when scaling */
    object-fit: contain; /* Scales image down to fit within the content box, preserving aspect ratio (adds letterboxing if needed) */
    display: block; /* Removes any extra space that might appear below inline images */
    margin: auto; /* Centers the image if it's smaller than the content box */
}

/* Ensure the direct content (p or img) of these display boxes is centered */
/* REPLACE your existing .game-plan-display p, #factionAnnouncementsDisplay p rule with this: */
.game-plan-display p,
#factionAnnouncementsDisplay p {
    margin: 0; /* Remove default paragraph margins */
    width: 100%; /* Ensures paragraph takes full width within its flex container for proper text-align:center */
}
/* NEW: Adjust the direct content of these display boxes to center */
.game-plan-display p,
#factionAnnouncementsDisplay p {
    margin: 0; /* Remove default paragraph margins */
    width: 100%; /* Ensure p takes full width to allow text-align:center on itself */
}


/* NEW/MODIFIED: War Status Display on Announcements tab */
.war-status-display {
    padding: 10px;
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #333;
    display: grid;
    /* Grid for the status items: 2 columns with equal width, items centered */
    grid-template-columns: 1fr 1fr;
    gap: 8px 15px; /* Vertical gap 8px, Horizontal gap 15px */
    align-items: start; /* Align items to the start of their grid cell vertically */
    font-size: 0.9em;
    padding-top: 15px; /* Add some top padding inside the box to push content down from title */
    padding-bottom: 15px; /* Add some bottom padding inside the box */
    margin-top: 0; /* Ensure no unwanted margin pushes it down from its h3 */
}

/* NEW: Styles for individual status items within the war-status-display grid */
.war-status-display .status-item {
    display: flex;           /* Make each status item a flex container */
    flex-direction: column;  /* Stack label above value */
    align-items: center;     /* Center horizontally within its grid cell */
    justify-content: center; /* Center vertically if the grid cell has extra height */
    text-align: center;      /* Center the text content within the item */
}

.war-status-display .status-label {
    font-weight: bold;
    color: #e0a71a; /* Matching the gold of config-section h4 for labels */
    margin-bottom: 3px; /* Small space below label and above value */
}

.war-status-display .status-value {
    color: #f0f0f0; /* White/light text for the value */
    font-weight: normal; /* Ensure it-s not bold */
}

/* For the 'Next Planned Chain Time' item to span both columns */
.war-status-display .status-item-full-width {
    grid-column: 1 / -1; /* Make this item span all columns */
    margin-top: 10px; /* Add some space above this row for separation */
}

/* NEW: Style for the 'Next Planned Chain Time' value box (like the input on Leader Config) */
.war-status-display .status-value-box {
    background-color: #1e1e1e; /* Darker background for the box */
    border: 1px solid #00a8ff; /* Blue border like other value boxes/inputs */
    border-radius: 4px;
    padding: 5px 10px; /* Padding inside the box */
    font-family: 'Courier New', Courier, monospace; /* Monospace font for time */
    font-size: 1em; /* Slightly larger font for readability */
    min-width: 120px; /* Ensure it has a minimum width */
    max-width: 180px; /* Limit max width */
    display: inline-block; /* Treat as inline-block to accept width/height but flow like text */
    box-sizing: border-box;
    text-align: center; /* Ensure text inside the box is centered */
}
#currentTeamLeadInput {
    margin-top: 3px !important; /* Adjust this pixel value as needed to align it perfectly */
}


/* Active Ops Controls Grid (Tab 2) */
/* General styling for all ops-control-items (Keep this as is, for now, to retain Chain Timer fix) */
/* Active Ops Controls Grid (Tab 2) */
.ops-controls-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid black;
    border-radius: 8px;
    background-color: #222;
}

/* General styling for all ops-control-items */
.ops-control-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    white-space: nowrap;
    font-size: 0.9em;
    /* Default alignment can be removed or set here if needed, but specific overrides are below */
}

/* General label styling within ops-control-item */
.ops-control-item label {
    color: #00a8ff;
    font-weight: bold;
    /* This rule should not have a text-align, as it's handled by more specific rules below */
}

/* General input/select/button styling within ops-control-item */
.ops-control-item input[type="text"],
.ops-control-item select,
.ops-control-item button {
    width: 100%;
    box-sizing: border-box;
    font-size: 1em;
    padding: 6px;
}

/* Specific styling for ops-timer (Chain Timer) - Forces this item to align left */
.ops-control-item.ops-timer {
    justify-self: start; /* Aligns this grid item to the start (left) of its cell */
    text-align: left;    /* Aligns text content within this item to the left */
}

.ops-control-item.ops-timer label {
    text-align: left; /* Ensures the label text is left-aligned */
}

/* Specific styling for Quick FF Targets container - Forces this item to align right */
.ops-control-item.ops-quick-targets {
    justify-content: flex-end; /* Aligns content (label and targets) to the top within this item */
    margin-top: 0 !important; /* Aggressively removes any top margin */
    padding-top: 0 !important; /* Aggressively removes any top padding */
    height: auto !important; /* Ensures it doesn't take fixed or excessive height */
    min-height: unset !important; /* Ensures no min-height forces it to stretch */
}

.ops-control-item.ops-quick-targets label {
    text-align: right; /* Aligns the label text to the left */
    margin-top: 0 !important; /* Ensure no unintended margin */
    padding-top: 0 !important; /* Ensure no unintended padding */
}

.ops-control-item.ops-quick-targets .quick-ff-targets-container {
    text-align: right; /* Aligns the names (Target 1, Target 2) to the left */
    align-items: flex-end; /* Ensures internal flex children stick to the left */
    margin-top: 0 !important; /* Ensure no unintended margin */
    padding-top: 0 !important; /* Ensure no unintended padding */
}


/* Container for the Quick FF Target buttons - ensures vertical stacking and full width */
.ops-control-item .quick-ff-targets-container {
    display: flex;
    flex-direction: column; /* Stacks the buttons vertically */
    gap: 5px; /* Space between the buttons */
    width: 100%; /* Makes the container fill the width of its parent ops-control-item */
}

/* Styling for the Quick FF Target buttons (the <a> tags) */
.quick-ff-target-btn {
    display: inline-block; /* Treat as block to accept width/padding, but allows content flow */
    background-color: #007bff; /* A standard blue color, matching other buttons */
    color: black; /* White text */
    padding: 6px 15px;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border: 1px solid #0056b3;
    box-sizing: border-box;
    width: 100%; /* Make them take full width of their container */
	border: 2px solid black;
}

.quick-ff-target-btn:hover {
    background-color: #c82333;
    border-color: black;
}

/* The #postAnnouncementBtn is now only on Leader Config tab, it does not apply to Announcements tab anymore. */
#postAnnouncementBtn {
    margin-top: 15px; /* This specific margin was for consistency with Save Game Plan */
}

/* ==========================================================================
   Enemy Targets Table Styles (Fixed Header Version)
   ========================================================================== */

/* Wrapper generated by JS: <div class="enemy-targets-table-wrapper"> */
.enemy-targets-table-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Base table styles for both header and body tables created by JS */
.enemy-targets-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    color: #ddd;
    table-layout: fixed; /* Crucial: Ensures column widths are respected consistently */
}

/* Styles for the header table (the one containing <thead>) */
.enemy-targets-table thead th {
    background-color: #00a8ff; /* Blue header background, matching screenshot */
    color: #1e1e1e; /* Dark text on blue */
    font-weight: bold;
    text-align: center; /* Center header text as per screenshot */
    padding: 8px 10px;
    border-bottom: 2px solid #1e1e1e; /* Darker border below header */
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* No 'position: sticky'  here as it's a separate table */
}

/* Scrollable container for the table body */
/* This is generated by JS: <div class="enemy-targets-table-body-scroll"> */
/* Styling for the main table container (#enemyTargetsContainer) to enable scrolling */
/* Styling for the main table container (#enemyTargetsContainer) to enable scrolling */
#enemyTargetsContainer.enemy-targets-scroll-area {
    max-height: 475px; /* ADJUSTED: Increased to show more rows before internal scrollbar appears */
    overflow-y: auto; /* Enables vertical scrolling for the table content */
    border-bottom-left-radius: 8px; /* To match the overall section's border-radius if needed */
    border-bottom-right-radius: 8px; /* To match the overall section's border-radius if needed */
}

/* Custom scrollbar for the table container */
#enemyTargetsContainer.enemy-targets-scroll-area::-webkit-scrollbar { width: 10px; }
#enemyTargetsContainer.enemy-targets-scroll-area::-webkit-scrollbar-track { background: #1a1a1a; }
#enemyTargetsContainer.enemy-targets-scroll-area::-webkit-scrollbar-thumb { background-color: #007acc; border-radius: 5px; border: 2px solid #1a1a1a; }
#enemyTargetsContainer.enemy-targets-scroll-area::-webkit-scrollbar-thumb:hover { background-color: #00a8ff; }

/* Styles for actual table data cells in the body (the <td> elements) */
.enemy-targets-table tbody td {
    padding: 5px 10px; /* Compact padding for rows */
    border-bottom: 1px solid #3a3a40; /* Subtle line between rows */
    vertical-align: middle;
    font-size: 0.85em;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center; /* Center cell content as per screenshot */
}

/* Remove bottom border from the very last row in the scrollable body */
.enemy-targets-table tbody tr:last-child td {
    border-bottom: none;
}

/* Add a hover effect for better user experience on body rows */
.enemy-targets-table tbody tr:hover {
    background-color: #38383e;
}

/* Define consistent column widths for BOTH header (<thead>) and body (<tbody>) tables */
/* These percentages sum to 100% and should match the 'th' and 'td' structure */
.enemy-targets-table .col-name { width: 20%; } /* Adjusted width */
.enemy-targets-table .col-level { width: 8%; } /* Adjusted width */
.enemy-targets-table .col-last-action { width: 18%; } /* NEW COLUMN WIDTH */
.enemy-targets-table .col-status { width: 18%; } /* Adjusted width */
.enemy-targets-table .col-claim { width: 18%; } /* Adjusted width */
.enemy-targets-table .col-attack { width: 18%; } /* Adjusted width */

/* --- Status-Specific Colors (Existing, but ensure they target the new <td>) --- */
.enemy-targets-table .status-hospital {
    color: #ff5c5c; /* Red for hospital */
    font-weight: bold;
}
.enemy-targets-table .status-traveling {
    color: #17a2b8; /* Cyan for traveling */
}
.enemy-targets-table .status-other {
    color: #ffb86c; /* Orange for other states like Jail/Abroad */
}
.enemy-targets-table .status-okay {
    color: #28a745; /* Green for okay status */
}


/* --- Link and Button Styles (Ensure they target elements within the new table structure) --- */
.enemy-targets-table a {
    color: #8ab4f8; /* A nice blue for links */
    text-decoration: none;
}

.enemy-targets-table a:hover {
    text-decoration: underline;
}

/* Style the "Attack" link to look like a button */
.enemy-targets-table .attack-link {
    display: inline-block;
    background-color: #3d84b8; /* Blue for attack */
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.enemy-targets-table .attack-link:hover {
    background-color: #4a9dcf;
    text-decoration: none;
}

/* Style the "Claim" button */
.enemy-targets-table .claim-btn {
    background-color: #4CAF50; /* Green for claim */
    color: white;
    border: none;
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.enemy-targets-table .claim-btn:hover {
    background-color: #5cb85c;
}

/* Style for when the button is disabled or says "Unclaim" */
.enemy-targets-table .claim-btn:disabled,
.enemy-targets-table .claim-btn[onclick*="unclaimTarget"] { /* Using onclick selector from your JS */
    background-color: #d9534f; /* Red for "Unclaim" state */
    cursor: pointer;
}

.enemy-targets-table .claim-btn[onclick*="unclaimTarget"]:hover {
    background-color: #c9302c;
}

/* Responsive adjustments for columns - ensure they apply to both header and body tables */
@media (max-width: 992px) {
    /* ... (your other existing rules in this media query) ... */
    .enemy-targets-table .col-name { width: 24%; }
    .enemy-targets-table .col-level { width: 10%; }
    .enemy-targets-table .col-status { width: 26%; }
    .enemy-targets-table .col-claim { width: 18%; }
    .enemy-targets-table .col-attack { width: 22%; }
}

@media (max-width: 768px) {
    .enemy-targets-table .col-name { width: 22%; }
    .enemy-targets-table .col-level { width: 9%; }
    .enemy-targets-table .col-status { width: 24%; }
    .enemy-targets-table .col-claim { width: 22%; }
    .enemy-targets-table .col-attack { width: 23%; }
    .enemy-targets-table thead th, .enemy-targets-table tbody td {
        font-size: 0.75em;
        padding: 5px 5px;
    }
    .enemy-targets-table .attack-link, .enemy-targets-table .claim-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .enemy-targets-table .col-name { width: 20%; }
    .enemy-targets-table .col-level { width: 8%; }
    .enemy-targets-table .col-status { width: 23%; }
    .enemy-targets-table .col-claim { width: 24%; }
    .enemy-targets-table .col-attack { width: 25%; }
    .enemy-targets-table thead th, .enemy-targets-table tbody td {
        font-size: 0.7em;
        padding: 3px 3px;
    }
    .enemy-targets-table .attack-link, .enemy-targets-table .claim-btn {
        padding: 2px 5px;
        font-size: 10px;
    }
}

/* Coloring for Difficulty and Status */
.difficulty-easy { color: #28a745; font-weight: bold; } /* Green */
.difficulty-moderately-difficult { color: #ffc107; font-weight: bold; } /* Yellow/Orange */
.difficulty-difficult { color: #dc3545; font-weight: bold; } /* Red */
.difficulty-extremely-easy { color: #17a2b8; font-weight: bold; } /* Cyan */
.difficulty-may-be-impossible { color: #6c757d; font-weight: bold; } /* Grey */

.status-okay { color: #28a745; }
.status-hospital { color: #dc3545; }
.status-jail { color: #ffc107; }
.status-traveling { color: #17a2b8; }
.status-offline { color: #6c757d; }

/* Styles for Attack/Claim buttons inside table rows */
.enemy-target-row .action-btn {
    padding: 3px 6px; /* NEW: Reduced padding */
    font-size: 0.75em; /* NEW: Reduced font size */
    height: auto;
    min-width: unset;
    max-width: unset;
    border-radius: 3px;
    background-color: #007bff; /* Blue */
    color: white;
}
.enemy-target-row .action-btn:hover {
    background-color: #0056b3;
}


/* Alert Buttons Grid (Tab 2) */
.alert-buttons-grid {
    display: flex;
    justify-content: space-around;
    gap: 8px; /* NEW: Reduced gap */
    margin-bottom: 15px; /* NEW: Reduced margin */
    flex-wrap: wrap;
}

.alert-btn {
    background-color: #d9534f;
    color: #f0f0f0;
    padding: 8px 12px; /* NEW: Reduced padding */
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 5px;
    flex-grow: 1;
    min-width: 120px; /* NEW: Slightly smaller min-width */
    text-align: center;
    font-size: 0.85em; /* NEW: Reduced font size */
}
/* ==========================================================================
   Styles & Sizing for Friendly Status Tab
   ========================================================================== */

/* --- Sizing for the Top Box --- */
#friendly-status-tab .ops-controls-grid {
    min-height: 95px;
    align-items: center;
}

/* --- Sizing for the Main Panels (2-to-1 ratio) --- */
#friendly-status-tab .active-ops-left-panel {
    flex: 2; 
}
#friendly-status-tab .active-ops-right-panel {
    flex: 1;
}

/* --- Styling for Table & Placeholder Containers --- */
#friendlyMembersListContainer {
    background-color: #222;
    border: 1px solid black;
    border-radius: 8px;
    overflow: hidden;
    height: 475px; /* This explicitly matches the height of your chat-container */
    display: flex;
    flex-direction: column;
}

#friendly-members-table {
    flex-grow: 1;
}

/* --- Placeholder for Member Details (Right Panel) --- */
.detail-panel-placeholder { /* Using the new professional name */
    padding: 20px;
    border: 1px solid #555;
    border-radius: 8px;
    background-color: #222;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.detail-panel-placeholder h4 {
    color: #e0a71a;
    font-size: 1.5em;
    margin: 0;
}

.detail-panel-icon { /* Using the new professional name */
    font-size: 6em;
    color: rgba(240, 240, 240, 0.05);
    margin: 20px 0;
}

.detail-panel-placeholder p {
    color: #888;
    margin: 0;
}
.alert-btn:hover {
    background-color: #c9302c;
}

/* Faction Stats Summary (Tab 2) */
.faction-stats-summary {
    padding: 10px; /* NEW: Reduced padding */
    border: 1px solid #555;
    border-radius: 5px;
    background-color: #2a2a2a;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px; /* NEW: Reduced gap */
    margin-bottom: 15px; /* NEW: Reduced margin */
    font-size: 0.9em; /* NEW: Reduced font size */
}

.faction-stats-summary p {
    margin: 0;
    text-align: left;
    color: #e0a71a;
    font-weight: bold;
}

.faction-stats-summary p span {
    color: #f0f0f0;
    font-weight: normal;
    margin-left: 5px; /* NEW: Reduced margin */
}


/* Friendly Members List (Tab 3) */
.friendly-members-scroll-area {
    max-height: 550px; /* NEW: Adjusted max height */
    overflow-y: auto;
    border: 1px solid #00a8ff;
    border-radius: 8px;
    padding: 10px;
    background-color: #222;
}

.friendly-member-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr; /* Example columns for Name, E, Nerve, Status */
    padding: 6px 0; /* NEW: Reduced padding */
    border-bottom: 1px solid #333;
    align-items: center;
    font-size: 0.85em; /* NEW: Reduced font size */
    color: #f0f0f0;
}
.friendly-member-row:last-child {
    border-bottom: none;
}
.friendly-member-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}
/* Styles for member stats (e.g., green for high E, red for low life) */
/* ... (unchanged) ... */


/* Leader Configuration Section (Tab 4) */
.config-section {
    margin-bottom: 0px;
    padding: 10px;
    border: 1px solid black;
    border-radius: 8px;
    background-color: #222;
    text-align: left;
    display: flex;
    flex-direction: column;
}
.war-status-toggles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 columns */
    gap: 10px; /* Internal gap between toggles */
    width: 100%; /* Ensure it spans available width of parent config-section */
    box-sizing: border-box;
}

/* REMOVED: .war-status-toggles-grid .toggle-control:last-child { grid-column: 1 / -1; } */
/* This rule was removed to allow the last row to flow into 3 columns */


/* Fix for checkbox alignment within War Status Controls */
.war-status-toggles-grid label {
    display: flex;       /* Make the label a flex container */
    align-items: center; /* Align items (checkbox and text) vertically in the center */
    gap: 5px;            /* Add a small space between the checkbox and the label text */
    cursor: pointer;     /* Indicate the whole label is clickable */
}

.war-status-toggles-grid input[type="checkbox"] {
    margin: 0;           /* Remove default margin that might push it around */
    padding: 0;          /* Remove default padding */
    vertical-align: middle; /* Ensures baseline alignment, though flexbox should mostly handle this */
    transform: scale(1.1); /* Slightly increase size for better visibility if needed */
    accent-color: #00a8ff; /* Consistent theme color for the checkbox */
}


.config-section h4 {
    color: #e0a71a;
    margin-bottom: 8px; /* NEW: Reduced margin */
    margin-top: 0; /* NEW: Remove top top margin */
    text-align: center;
    font-size: 1.5em; /* NEW: Slightly adjusted font size */
}

.config-section input[type="text"],
.config-section select { /* REMOVED TEXTAREA FROM THIS SELECTOR */
    padding: 6px; /* NEW: Reduced padding */
    margin-bottom: 8px; /* NEW: Reduced margin */
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
    font-size: 0.9em; /* NEW: Reduced font size */
    box-sizing: border-box; /* Applied here */
}

.config-section textarea { /* TEXTAREA HAS ITS OWN SELECTOR FOR !IMPORTANT */
    width: 100%;
    padding: 6px;
    margin-bottom: 8px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;
    font-size: 0.9em;
    box-sizing: border-box !important; /* IMPORTANT: Added !important here for overlap fix */
}
/* Specific styling for 'Next Planned Chain Time' label and input */
/* Target the specific toggle-control by the ID of its input for precision */
.toggle-control:has(input#nextChainTimeInput) {
    /* Existing: display: flex; flex-direction: column; */
    align-items: center;    /* Centers the label and input elements horizontally */
    /* Remove text-align: center from here, we'll apply it directly to the label */
}

/* Style specifically for the label text within these toggle controls (to center their text) */
.toggle-control:has(input#nextChainTimeInput) label,
.toggle-control:has(input#enemyFactionIDInputLeaderConfig) label { /* ADDED: Enemy Faction ID label */
    display: block; /* Make the label behave like a block-level element */
    width: 100%; /* Ensure it takes full available width within its parent */
    text-align: center; /* Center the text content within this block-level label */
    box-sizing: border-box;
}
#postAnnouncementBtn {
    margin-top: 15px; /* Adjust this value until the gap matches Save Game Plan */
}

/* Style for the input field itself */
#nextChainTimeInput, #enemyFactionIDInputLeaderConfig { /* ADDED: Enemy Faction ID input */
    width: auto; /* Allow width to be determined by content/min-width/max-width */
    max-width: 160px; /* Adjust this value as needed to match the label's width */
    min-width: 100px; /* Ensure it doesn't get too small */
    display: block; /* Make it a block element so margin: auto can center it */
    margin-left: auto; /* Center the input horizontally */
    margin-right: auto;
    margin-top: 3px;
    /* You may also adjust padding and font-size if necessary */
    /* padding: 6px; */
    /* font-size: 0.9em; */
    /* box-sizing: border-box; */
}

/* Styling for the Set Targets button to fit correctly when placed outside grid */
#setTargetsBtn {
    padding: 8px 12px; /* Consistent padding for action buttons */
    font-size: 0.9em;
    font-weight: bold; /* Make button text bold */
    width: auto; /* Allow width to shrink to content */
    display: block; /* Make it a block element for centering */
    margin: 10px auto 0 auto; /* Center horizontally and add margin-top */
    /* Inherit background-color, color, border, border-radius, transition from .config-section .action-btn */
}


textarea {
    resize: vertical;
    min-height: 130px; /* NEW: Reduced min-height */
}

select[multiple] {
    height: 120px;
}

.config-section .action-btn {
    width: auto;
    margin-top: 5px;
    padding: 8px 15px; /* Slightly adjusted padding */
    font-size: 0.9em;
    font-weight: bold;
    background-color: #007bff;
    color: black; /* Corrected color for readability on blue */
    border: 2px solid black;
    border-radius: 5px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    line-height: 1.5; /* This new line helps normalize the vertical alignment */
    display: inline-flex; /* Use flex to better center content inside the button */
    align-items: center;
    justify-content: center;
}

.upload-btn {
    position: relative;
    top: 1px;
}

/* This new class centers the two buttons in the 'War Status Controls' box */
.war-status-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px; /* Adds some space above the buttons */
}

/* This makes the new 'Clear All Data' button red */
.clear-btn {
    background-color: #dc3545 !important; /* A strong red */
    color: black !important;
}

.clear-btn:hover {
    background-color: #c82333 !important; /* A darker red on hover */
}

.config-section .action-btn:hover {
    background-color: #00a8ff; /* ADDED: Darker blue on hover */
    border-color: black; /* ADDED: Maintain border color on hover */
}

/* --- NEW: CSS to make Leadership Settings buttons smaller --- */

/* This selector targets the "Save War Status", "Save Admins", and both "Save Selections" buttons */
#saveWarStatusControlsBtn,
.config-section .save-config-btn {
    width: fit-content;   /* This makes the button only as wide as its content. */
    align-self: center;   /* This centers the button horizontally within its box. */
    
    /* Optional: Adjusts the spacing on the left and right of the button text */
    padding-left: 30px;
    padding-right: 30px;
}
/* Specific styling for designated admins list */
#designatedAdminsList, #watchListDisplay {
    list-style: none;
    padding: 5px; /* NEW: Reduced padding */
    margin-top: 8px; /* NEW: Reduced margin */
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    max-height: 150px; /* NEW: Reduced max-height */
    overflow-y: auto;
}

#designatedAdminsList li, #watchListDisplay li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px; /* NEW: Reduced padding */
    border-bottom: 1px solid #444;
    font-size: 0.85em; /* NEW: Reduced font size */
}
#designatedAdminsList li:last-child, #watchListDisplay li:last-child {
    border-bottom: none;
}
#designatedAdminsList .remove-btn, #watchListDisplay .remove-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 3px 6px; /* NEW: Reduced padding */
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7em; /* NEW: Reduced font size */
}
#designatedAdminsList .remove-btn:hover, #watchListDisplay .remove-btn:hover {
    background-color: #c82333;
}
autocomplete-items {
    position: absolute; /* Position the list directly below the input */
    border: 1px solid #00a8ff; /* Blue border */
    border-bottom: none;
    border-top: none;
    z-index: 99; /* Ensure it appears above other content */
    /* Position the autocomplete items to be the same width as the input: */
    top: 100%; /* Position it directly below the input (100% of parent's height) */
    left: 0;
    right: 0;
    background-color: #222; /* Dark background */
    max-height: 200px; /* Max height for scrollable list */
    overflow-y: auto; /* Enable scrolling */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); /* Subtle shadow */
    margin-top: 3px; /* Small gap between input and list */
    border-radius: 0 0 5px 5px; /* Rounded bottom corners */
}




/* Only display the currently active chat panel */
.chat-panel.active {
    display: flex; /* Or 'flex' or 'grid' depending on the internal layout you want for each panel */
    height: 100%; /* Important: Make sure the active panel takes up available height */
    overflow-y: auto; /* Allow scrolling if content overflows */
}

/* Styles for the Faction Members list items to make them look good */
.members-list-display-area {
    /* Adjust padding/margin as needed for this specific area */
    padding: 10px;
}




.members-list-container {
    display: grid;          /* CRITICAL: Use CSS Grid for two columns */
    grid-template-columns: 1fr 1fr; /* Two equal-width columns */
    gap: 15px;              /* Space between grid items (both rows and columns) */
    flex-grow: 1;           /* Allows it to stretch vertically within its parent (.members-list-display-area) */
    box-sizing: border-box; /* Include padding/border */
}

/* --- Faction Members List Item Styling --- */

/* This is the main container for each member row */
.member-item {
    display: flex;
    align-items: center;
    padding: 8px;
    background-color: #222;
    border: 1px solid black;
    border-radius: 6px;
    text-decoration: none;
    color: #f0f0f0;
    transition: background-color 0.2s ease;
}

.member-item:hover {
    background-color: #3a3a3a;
}

/* NEW: This is the wrapper for the Pic and Name */
.member-identity {
    flex-grow: 1; /* This makes it take all available middle space */
    display: flex;
    align-items: center;
    justify-content: center; /* This centers the pic and name within the middle space */
    gap: 8px; /* The space between the picture and the name */
    min-width: 0; /* Prevents overflow issues */
}

/* The member's rank on the far left */
.member-rank {
    font-size: 0.8em;
    color: #e0a71a;
    font-weight: bold;
    margin-right: 10px; /* Space between rank and the identity group */
    flex-shrink: 0;
}

.member-profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #555;
}

/* UPDATED: The member's name (text-align is no longer needed here) */
.member-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
    color: #f0f0f0;
}

/* NEW: This is the wrapper for the buttons on the right */
.member-actions {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between the two buttons */
    margin-left: 10px; /* Space between the identity group and the buttons */
}





/* Styles for loading and error messages within the tab */
.loading-message, .error-message {
    text-align: center;
    padding: 20px;
    color: #bbb;
}
.error-message {
    color: #ff4d4d; /* Red for errors */
}

/* You might also need to ensure your .chat-messages-scroll-wrapper has a defined height
   and overflow-y: auto for scrolling within the chat box. Example: */
.chat-messages-scroll-wrapper {
    flex-grow: 1;
    height: 270px; /* MODIFIED: Fixed height in pixels */
    overflow-y: scroll; /* Keep this to allow internal scrolling if messages exceed 270px */
    padding: 2px 10px 10px;
    background-color: #222;
    border-radius: 8px;
    margin-bottom: 0;
    box-sizing: border-box;
}
/* Optional: Styles for chat tabs to make them clickable and active */
.chat-tabs-container {
    display: flex;
    overflow-x: auto; /* Allow horizontal scrolling if many tabs */
    white-space: nowrap;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

#chat-content-panels-wrapper {
    flex-grow: 1; 
    overflow-y: auto;
    padding: 10px;
    background-color: #2d3748;
    border-radius: 8px;
    margin-bottom: 10px;
    box-sizing: border-box;
	scrollbar-gutter: stable;
}

.chat-tab {
    padding: 7px 10px;
    background-color: #333;
    color: #f0f0f0;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    flex-grow: 1;
    white-space: nowrap;  

    border-bottom: none;
    border-right-width: 0; 
    border-radius: 5px 5px 0 0;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.chat-tab:not(:last-child) {
    border-right: 1px solid #1e1e1e;
}

/* Style for when you hover over a non-active chat tab */
.chat-tab:hover {
    background-color: #555;
    color: #f0f0f0; /* Text color stays light on hover */
    border-color: #00a8ff; /* Blue border on hover, like main tabs */
}

/* Style for the currently active chat tab */
.chat-tab.active {
    background-color: #00a8ff; /* Blue background */
    color: black; /* White text for better contrast */
    border-color: #00a8ff;
    
}
.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #333; /* Item background */
    border-bottom: 1px solid #444; /* Separator between items */
    color: #f0f0f0; /* Text color */
    font-size: 0.9em;
}

/* Style for highlighted item (on hover or keyboard navigation) */
.autocomplete-items div:hover,
.autocomplete-items .autocomplete-active {
    background-color: #00a8ff; /* Blue highlight */
    color: #1e1e1e; /* Dark text on highlight */
}

/* Style for matched text */
.autocomplete-items strong {
    color: #e0a71a; /* Gold color for matched text */
}

/* IMPORTANT: Ensure the parent container of the input has position: relative;
   This makes `top: 100%`, `left: 0`, `right: 0` in `.autocomplete-items`
   position correctly relative to the input field. */
.war-status-toggles-grid .toggle-control {
    position: relative; /* ADD THIS LINE to your existing .war-status-toggles-grid .toggle-control rule */
    /* ... other existing rules for toggle-control ... */
}

/* Class to hide the chat display and input when specific chat tabs are active */
.chat-container .chat-display-area,
.chat-container .chat-input-area {
    display: block; /* Default to block, JavaScript will override for specific tabs */
}

/* Responsive Media Queries for the War Hub Container */
@media (max-width: 992px) {
    #warPageHubContainer {
        padding: 10px; /* NEW: Reduced padding */
        gap: 10px; /* NEW: Reduced gap */
    }
    
   
    .active-ops-main-content-row {
        flex-direction: column; /* Stack panels vertically in active ops */
        gap: 10px; /* Reduce gap when stacked */
    }

    .active-ops-left-panel,
    .active-ops-right-panel {
        min-width: unset; /* Remove min-width on smaller screens */
        width: 100%; /* Take full width */
    }
}

/* Class to hide the chat display and input when specific chat tabs are active */
.chat-container.chat-content-hidden .chat-display-area,
.chat-container.chat-content-hidden .chat-input-area {
    display: none;
}
    .ops-controls-grid {
    align-items: start; /* Forces all direct children in the grid to align their tops */
    margin-top: 5px; /* Adjust this value to move the whole box closer to the tabs */
    margin-bottom: 10px; /* Adjust this value if it affects overall column height */
}
	
	.ops-controls-grid .ops-control-item {
    align-self: start;
    padding-top: 0; /* Remove top padding within grid item */
    padding-bottom: 0; /* Remove bottom padding within grid item */
    height: auto; /* Ensure no fixed height prevents shrinking */
    min-height: unset; /* Ensure no min-height prevents shrinking */
}

.quick-ff-target-btn {
    width: auto; /* Allows the button to shrink to the width of its content (text + padding) */
    padding: 4px 10px; /* Reduces the internal spacing (padding) around the text */
    font-size: 0.85em; /* Makes the text inside the button slightly smaller */
	background-color: #dc3545; /* Changed to a strong red color (similar to status-hospital red) */
    color: black; /* Changed to light text for contrast on red */
    /* Keep other properties like background-color, border, etc., as they are */
}

    .enemy-targets-header, .enemy-target-row {
        grid-template-columns: 1.5fr 0.8fr 1fr 1.5fr 1fr 0.8fr 0.8fr;
        font-size: 0.8em; /* NEW: Reduced base font size */
    }
    .faction-stats-summary {
        grid-template-columns: 1fr; /* Stack stats vertically */
    }
    .tab-content-container {
        height: auto; /* NEW: Allow height to be auto on smaller screens */
        min-height: 400px; /* Keep a minimum height */
    }
    .friendly-members-scroll-area {
        max-height: 400px; /* NEW: Adjusted max height */
    }
	
	/* --- Positioning for the Active Ops Tab Panels --- */
/* This block ensures your left (targets) and right (chat) panels are positioned correctly. */

/* The row containing both targets and chat panels */
.active-ops-layout-row {
    display: flex;
	align-items: stretch;
    flex-grow: 1; /* Allows this row to take up remaining vertical space in active-ops-tab */
    gap: 20px; /* Space between the left and right panels */
    width: 100%; /* Ensures it spans the full width of its parent */
    align-items: stretch; /* CRITICAL: Makes flex items (panels) stretch to fill the container's height */
    flex-wrap: wrap; /* Allows wrapping to column layout on smaller screens */
    overflow: hidden; /* IMPORTANT: Prevents its children from overflowing horizontally/vertically */
    box-sizing: border-box;
}

.active-ops-targets-panel {
  display: flex;
  flex-direction: column;
  flex: 1; /* This makes the panel flexible */
  min-width: 0; /* Add this to prevent potential overflow issues */
  height: 100%; 
  overflow: hidden; 
  box-sizing: border-box;
}

/* Responsive adjustments for Active Ops tab layout */
@media (max-width: 992px) {
    .active-ops-layout-row {
        flex-direction: column; /* Stack panels vertically on smaller screens */
        gap: 10px; /* Reduce gap when stacked */
    }

    .active-ops-targets-panel,
    .active-ops-chat-panel {
        min-width: unset; /* Remove min-width to allow full width stacking */
        width: 100%; /* Take full width when stacked vertically */
    }
}

/* Layout for the Friendly Status tab: Members List and Member Details */
.friendly-status-layout-row {
    display: flex; /* Arranges children (panels) side-by-side */
    flex-grow: 1;
    gap: 20px; /* Space between the left and right panels */
    width: 100%;
    align-items: flex-start; /* Aligns both panels to the top */
    flex-wrap: wrap; /* Allows panels to wrap on smaller screens */
	justify-content: center;
	
}

.friendly-members-panel {
    display: flex;
    flex-direction: column;
    flex: 2; /* This panel will take twice the space of the detail panel */
    min-width: 500px; /* Adjust this min-width as needed for the table content */
}

.friendly-details-panel {
    display: flex;
    flex-direction: column;
    flex: 1; /* This panel will take one unit of space */
    min-width: 100px; /* Minimum width for the details panel */
}

@media (max-width: 992px) {
    .friendly-status-layout-row {
        flex-direction: column; /* Stack panels vertically on smaller screens */
        gap: 10px;
    }

    .friendly-members-panel,
    .friendly-details-panel {
        min-width: unset; /* Remove min-width to allow full width stacking */
        width: 100%; /* Take full width when stacked vertically */
    }
}

.faction-versus-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    padding: 15px;
    
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    
    box-sizing: border-box; /* ADD THIS LINE */
}

.ops-chain-score .score-faction-name {
    font-size: 0.8em;
    color: #f0f0f0; /* Light text for names */
    font-weight: bold;
    text-align: center;
    width: 100%; /* Ensure it takes full width for centering */
}
/* Styling for the new Chain Score Display within Active Ops */
.ops-control-item.ops-chain-score {
display: flex;
 flex-direction: column;
 align-items: center;
 justify-content: center; 
 flex-grow: 1; /* This makes the element expand to fill empty space */
 gap: 5px;
padding: 5px;
border: 1px solid black;
 border-radius: 8px;
background-color: #222;
box-sizing: border-box;
 white-space: nowrap;
 position: relative;
min-width: 320px;
}
.ops-chain-score .chain-score-display {
    display: flex;
    align-items: center;
    justify-content: space-around; /* Distribute space around the three score components */
    width: 100%; /* Take full width of parent */
    padding: 5px 0; /* Vertical padding */
    gap: 5px; /* Space between score values and info */
}

.ops-chain-score .score-value {
    font-size: 1.5em; /* Larger font size for the scores */
    font-weight: bold;
    flex-shrink: 0; /* Prevent shrinking */
}

.ops-chain-score .current-score {
    color: #ff8c00; /* Orange color for current score */
}

.ops-chain-score .target-score {
    color: #4CAF50; /* Green color for target score */
}

.ops-chain-score .score-target-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center "LEAD TARGET" and "523 / 2,800" */
    font-size: 0.7em; /* Smaller font for lead target info */
    color: #f0f0f0; /* Light text */
    flex-grow: 1; /* Allow this section to take up available space */
}

.ops-chain-score .score-label {
    font-weight: bold;
    color: #e0a71a; /* Gold-like color for labels */
}

.ops-chain-score .score-progress {
    color: #a9a9a9; /* Greyish color for progress numbers */
}

@media (max-width: 768px) {
    .tab-navigation {
        flex-direction: column; margin-bottom: 0px;
    }
    .tab-button {
        border-radius: 5px;
        margin-bottom: 5px;
        font-size: 0.9em; /* NEW: Adjusted font size */
        padding: 6px 10px; /* NEW: Adjusted padding */
    }
    .tab-content-container {
        border-radius: 8px;
    }
    .enemy-targets-header, .enemy-target-row {
        grid-template-columns: 1.2fr 0.5fr 0.8fr 0.8fr 0.8fr 0.8fr 0.8fr;
        font-size: 0.75em; /* NEW: Reduced base font size */
    }
    .alert-buttons-grid {
        flex-direction: column;
    }
    .alert-btn {
        margin-bottom: 8px; /* NEW: Reduced margin */
        padding: 6px 10px; /* NEW: Reduced padding */
        font-size: 0.85em; /* NEW: Reduced font size */
    }
    .config-section h4 {
        font-size: 1.3em; /* NEW: Adjusted font size */
    }
}
/* NEW: Styles for chat content panels */
.chat-content-panels {
    flex-grow: 1; /* Allows this container to take up remaining vertical space */
    position: relative; /* Needed for absolute positioning of inner panels if desired */
    overflow: hidden; /* Ensures content stays within bounds */
	border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.chat-panel {
    display: none; /* Hides all chat panels by default */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    flex-direction: column; /* Ensure inner display area is stacked vertically */
}



.war-status-toggles-grid .toggle-control {
    display: flex;           /* Make each control a flex container */
    flex-direction: column;  /* Stack label, input/button vertically */
    align-items: center;     /* Center content horizontally within the column */
    gap: 3px; /* Small gap between stacked items like labels and inputs */
}

/* Update: Style specifically for the labels within these toggle controls (to center their text) */
.war-status-toggles-grid .toggle-control label {
    display: block; /* Ensure the label behaves like a block-level element */
    width: 100%; /* Ensure it takes full available width within its parent */
    text-align: center; /* Center the text content within this block-level label */
    box-sizing: border-box;
}

#nextChainTimeInput,
#enemyFactionIDInputLeaderConfig,
#currentTeamLeadInput {
    width: 150px !important;
    max-width: 160px;
    min-width: 100px;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-top: 3px !important;
}



 /*friends and enemies*/
 
 .blockedPeopleContainer {
  display: flex;
  width: 100%; /* Fills the width of its container */
  height: 100%; /* Fills the height of its container */
}

.friendsListContainer,
.ignoresListContainer {
  flex: 1; /* Each takes up 50% of the container */
  border: 1px solid #ccc; /* Example border */
  box-sizing: border-box; /* Include padding and border in element's total width and height */
  display: flex;
  flex-direction: column; /* Stack elements vertically */
}

.headerBox {
  background-color: #f0f0f0; /* Example header background */
  padding: 10px;
  text-align: center;
}

.searchBar {
  padding: 10px;
  display: flex;
  align-items: center;
}

.searchBar input[type="text"] {
  flex: 1; /* Input takes up available space */
  padding: 5px;
}

.searchIcon {
  margin-left: 5px;
}

.scrollableList {
  overflow-y: auto; /* Enables vertical scrolling */
  flex: 1; /* Takes up remaining space */
}

.friendEntry,
.ignoreEntry {
  padding: 10px;
  border-bottom: 1px solid #eee; /* Separates entries */
  display: flex;
  align-items: center;
}

.profilePic {
  width: 30px; /* Example profile pic size */
  height: 30px;
  border-radius: 50%; /* Makes it circular */
  margin-right: 10px;
}

.factionIcon {
    font-size: 2em; /* Adjust as needed */
    margin-right: 10px;
}

.letterButton,
.trashButton {
  margin-left: 5px;
}

.blocked-people-layout {
    display: flex;          /* Make it a flex container */
    flex-direction: row;    /* Arrange children (Friends/Ignores sections) horizontally */
    flex-grow: 1;           /* CRITICAL: Make it grow to fill available vertical space in its parent (chatDisplayArea) */
    gap: 15px;              /* Space between the Friends and Ignores sections */
    height: 100%;           /* CRITICAL: Make it explicitly take 100% height of chatDisplayArea */
    box-sizing: border-box; /* Include padding/border in its dimensions */
    padding: 10px;          /* Add some internal padding */
    background-color: #2a2a2a; /* Slightly different background for visual separation */
    border-radius: 8px;     /* Match other rounded corners */
}

.friends-list-section,
.ignores-list-section {
    flex: 1;                /* CRITICAL: Each takes up equal horizontal space */
    display: flex;          /* Make them flex containers for their own content */
    flex-direction: column; /* Stack their children (header, search, list) vertically */
    min-width: 250px;       /* Ensure a minimum width before shrinking too much */
    background-color: #222; /* Darker background for the inner boxes */
    border: 1px solid black; /* Subtle border */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    box-sizing: border-box;
    overflow: hidden;       /* Ensure rounded corners and prevent internal overflow of static content */
}

.header-box {
    background-color: #00a8ff; /* Your theme blue for headers */
    color: #1e1e1e;          /* Dark text on blue */
    padding: 8px 10px;       /* Padding for the header */
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0;          /* Prevent header from shrinking */
    border-bottom: 2px solid black; /* Separator below header */
}

.search-bar {
    display: flex;          /* Make it a flex container */
    align-items: center;    /* Vertically align input and icon */
    padding: 8px 10px;       /* Padding around search elements */
    background-color: #1e1e1e; /* Dark background for search bar */
    border-bottom: 1px solid #333; /* Separator below search bar */
    flex-shrink: 0;          /* Prevent search bar from shrinking */
}

.search-bar input[type="text"] {
    flex-grow: 1;           /* Input takes up remaining space */
    padding: 6px 8px;       /* Padding inside input */
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #333;
    color: #f0f0f0;         /* Light text for input */
    font-size: 0.9em;
    box-sizing: border-box;
}

.search-bar .search-icon {
    color: #f0f0f0;         /* Light color for search icon */
    margin-left: 8px;       /* Space between input and icon */
    flex-shrink: 0;
}

.scrollable-list {
    flex-grow: 1;           /* CRITICAL: Allows list to take up all remaining vertical space in its parent section */
    overflow-y: auto;       /* Enables vertical scrolling for the list content */
    padding: 8px;           /* Padding inside the list area */
    box-sizing: border-box;
    /* Optional: custom scrollbar styling if you have it from other parts of your CSS */
    scrollbar-gutter: stable; /* Consistent scrollbar behavior */
}

.list-item {
    display: flex;          /* Make each list item a flex container */
    align-items: center;    /* Vertically align content (pic, name, buttons) */
    padding: 8px 0;         /* Padding for each list item */
    border-bottom: 1px solid #3a3a40; /* Separator between list items */
    color: #f0f0f0;         /* Default text color for list items */
    font-size: 0.9em;
}

.list-item:last-child {
    border-bottom: none; /* No border for the last item */
}

/* Specific styles for elements within the list item */
.list-item .profile-pic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.list-item .faction-icon {
    font-size: 1.8em; /* Adjust icon size */
    color: #e0a71a;   /* Example color for faction icon */
    margin-right: 10px;
    flex-shrink: 0;
}

.list-item .item-name {
    flex-grow: 1;           /* Name takes up available space */
    white-space: nowrap;    /* Prevent name from wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if name is too long */
    font-weight: bold;
}

.list-item .item-button {
    background-color: #007bff; /* Example button color */
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 8px; /* Space between name and buttons, or between buttons */
    flex-shrink: 0;
}

.list-item .item-button.trash-button {
    background-color: #dc3545; /* Red for trash button */
}

.list-item .item-button:hover {
    filter: brightness(1.2); /* Slightly brighten on hover */
}

/* Style for the initial "Loading..." message within lists */
.scrollable-list p {
    text-align: center;
    margin: auto; /* Center vertically and horizontally */
    color: #bbb;
}

/* --- Styles for the Settings Tab (Dynamically Injected Content) --- */

/* The main container for all settings content, injected into settingsDisplayArea */
.chat-settings-panel {
    display: flex;          /* Make it a flex container to stack sections */
    flex-direction: column; /* Stack sections vertically */
    flex-grow: 1;           /* CRITICAL: Allows it to fill available vertical space within chatDisplayArea */
    box-sizing: border-box; /* Include padding/border */
    padding: 10px;          /* Overall padding for the settings content */
    background-color: #2a2a2a; /* Main background for settings content */
    border-radius: 8px;     /* Rounded corners */
    gap: 15px;              /* Space between major settings sections */
}

/* Individual sections within the settings panel (e.g., Display, Sound) */
.settings-section {
    display: flex;          /* Make it a flex container to stack its header and list */
    flex-direction: column; /* Stack header and settings items list vertically */
    background-color: #222; /* Slightly darker background for individual sections */
    border: 1px solid #3a3a40; /* Subtle border, matching ignores/friends boxes */
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    overflow: hidden;       /* Ensures content stays within rounded borders */
}

/* Header for each settings section */
.settings-section .header-box {
    background-color: #00a8ff; /* Theme blue for section headers */
    color: #1e1e1e;          /* Dark text on blue */
    padding: 8px 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0;          /* Prevents header from shrinking */
    border-bottom: 1px solid black; /* Separator below header */
}

/* List container for individual setting items within a section */
.settings-items-list {
    display: flex;          /* Make it a flex container */
    flex-direction: column; /* Stack setting items vertically */
    padding: 10px 15px;      /* Internal padding for the list of items */
    flex-grow: 1;           /* Allow it to grow and fill available height within its section */
    color: #f0f0f0;         /* Default text color for settings labels */
}

/* Individual setting item (label + control) */
.setting-item {
    display: flex;
    align-items: center;    /* Vertically align label and control */
    justify-content: space-between; /* Push label to left, control to right */
    padding: 8px 0;
    border-bottom: 1px solid #333; /* Separator between setting items */
    font-size: 0.95em;
}

.setting-item.checkbox-item {
    /* Specific styles if needed for checkbox items */
    /* Example: adjust vertical alignment if checkbox is smaller */
    align-items: flex-start; /* Align checkbox to top of its line if label wraps */
    padding-bottom: 10px; /* More space for checkbox lines */
    padding-top: 10px;
}


.setting-item:last-child {
    border-bottom: none; /* No border for the last item in a list */
}

.setting-item label {
    font-weight: bold;
    color: #e0a71a; /* Gold color for labels */
    flex-shrink: 0; /* Prevent label from shrinking */
    margin-right: 10px; /* Space between label and control */
}

/* Styles for dropdown selects */
.setting-item select {
    background-color: #333;
    color: #f0f0f0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.9em;
    cursor: pointer;
    flex-grow: 1; /* Allow select to grow if space allows */
    max-width: 180px; /* Limit width */
    box-sizing: border-box;
}

/* Styles for checkboxes */
.setting-item input[type="checkbox"] {
    transform: scale(1.1); /* Slightly larger checkbox */
    accent-color: #00a8ff; /* Theme color for checkbox */
    flex-shrink: 0; /* Prevent checkbox from shrinking */
    margin-left: 10px; /* Space from label */
}

/* Style for action buttons (like Clear History, Save Settings) */
.setting-item.action-item {
    justify-content: center; /* Center the button within its item */
    padding: 15px 0;
}

.setting-item.action-item .action-button {
    /* Reuse .action-button styles but adjust for settings context if needed */
    width: auto; /* Shrink to content */
    min-width: 150px;
    padding: 8px 15px;
    font-size: 1em;
    /* Inherit background, color, border, etc. from .action-button */
}

/* Specific styling for the Save Settings section button if needed */
.settings-section.save-settings-section {
    flex-shrink: 0; /* Ensures save section stays at bottom and doesn't get compressed */
    border-top: 1px solid #3a3a40; /* Separator from section above */
    border-bottom: none; /* No bottom border for the last section */
    border-radius: 0 0 8px 8px; /* Match outer container's bottom radius */
}

.settings-section.save-settings-section .header-box {
    display: none; /* Hide the header for the Save section, as it's just one button */
}

.settings-section.save-settings-section .settings-items-list {
    padding: 10px;
    align-items: center; /* Center content within save section */
}

.settings-section.save-settings-section .action-button {
    background-color: #00a8ff; /* Use primary theme color for save button */
    color: #1e1e1e;
    font-weight: bold;
}
.settings-section.save-settings-section .action-button:hover {
    background-color: #007bff; /* Darker blue on hover */
    color: white;
}

/* Style for the new message button on Faction Members tab */
.member-item .message-button {
    background-color: #e0a71a; /* Gold color for message button, matching other gold elements */
    color: #1e1e1e;             /* Dark text/icon on gold */
    margin-left: 8px;           /* Space from the add-member-button */
}

.member-item .message-button:hover {
    filter: brightness(1.2); /* Slightly brighten on hover */
}

/* --- CSS for Action Buttons in the Ops Control Bar --- */

/* This is the container for the buttons - the "box" you wanted. */
.action-buttons-container {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    height: 100%;
    
    /* --- Styles for the 'box' --- */
    background-color: rgba(255, 255, 255, 0.05); /* A very subtle, dark background for the box */
    border: 1px solid #555;     /* A border to make the box visible */
    border-radius: 8px;         /* Rounded corners for the box */
    padding: 10px 15px;         /* Space inside the box */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2); /* A subtle inner shadow for depth */
}

/* This applies to BOTH the red and green buttons */
.action-button {
    display: inline-block;
    padding: 6px 15px; /* Keeps the buttons from being too thick */
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #222; /* A dark border for the buttons themselves */
    color: black; /* Font color as requested */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* A subtle shadow for depth */
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out; /* Smooth hover effect */
}

/* A little "lift" effect when you hover over the buttons */
.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}


/* --- CSS for Action Buttons in the Ops Control Bar --- */

/* This new class on the grid item allows us to align it. */
.ops-control-item--actions {
    display: flex;
    align-items: center;
   
}

/* This is the container for the buttons - the "box" you wanted. */
.action-buttons-container {
    display: flex;
    gap: 20px;
    align-items: center;
    
    /* --- Styles for the main 'box' --- */
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

/* Styles for each individual button group (label + button) */
.action-button-group {
    text-align: center;
    padding: 10px 15px; /* Space inside the little boxes */
    background-color: rgba(0,0,0,0.15); /* Makes the little boxes slightly darker */
    border: 1px solid #444; /* Border for the little boxes */
    border-radius: 6px; /* Rounded corners for the little boxes */
}

/* The text label above each button */
.action-button-label {
    margin: 0 0 8px 0; /* Increased bottom margin slightly for more space */
    color: #00a8ff;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

/* --- General Styling for the Action Buttons --- */
/* This applies to BOTH the red and green buttons */
.action-button {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    border: 1px solid #222;
    color: black;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* --- Specific Colors for each Button --- */

/* The red "Crimes" button */
.action-button-red {
    background-color: #e53935;
}

/* The green "Gym" button */
.action-button-green {
    background-color: #43a047;
}
/* --- Styles for Energy Display Box on Active Ops Tab --- */

/* Specific styling for the Energy Display box */
.ops-control-item.ops-energy-display {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
    justify-content: center; /* Center content vertically */
    gap: 3px;
    white-space: nowrap;
    font-size: 0.9em;
    padding: 5px; /* Adjust padding to match other ops-control-items */
	grid-column: 2;
    border: 1px solid black;
    border-radius: 8px;
    background-color: #222; /* Dark background matching other boxes */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.ops-control-item.ops-energy-display label {
    color:#28a745; /* Gold color for label */
    font-weight: bold;
    text-align: center;
}

/* Style for the actual energy value display (reusing status-value-box for consistency) */
#userEnergyDisplay {
    background-color: #1e1e1e; /* Darker background for the value box */
    border: 1px solid #00a8ff; /* Blue border like other value boxes/inputs */
    border-radius: 4px;
    padding: 5px 10px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1em;
    min-width: 80px; /* Ensure it has a minimum width */
    max-width: 120px; /* Limit max width */
    display: inline-block; /* Treat as inline-block to accept width/height */
    box-sizing: border-box;
    text-align: center;
    color:#28a745; /* Blue color for the energy value */
    font-weight: bold;
}

.member-actions .item-button {
    background-color: #555; /* Default fallback grey */
    color: white;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 1.1em; /* Makes the icons a little bigger */
    line-height: 1; /* Helps with vertical alignment */
    transition: filter 0.2s ease;
}

/* A simple effect to brighten any button when you hover over it */
.member-actions .item-button:hover {
    filter: brightness(1.2); 
}

/* Gold color for the message button (targets both classes) */
.member-actions .letter-button,
.member-actions .message-button {
    background-color: #e0a71a;
    color: #1e1e1e; /* Dark text on the gold background */
}

/* Red color for the trash/delete button */
.member-actions .trash-button {
    background-color: #dc3545;
    color: white; /* White text on the red background */
}

.add-member-button.success {
    background-color: #28a745; /* A standard green color */
    color: white;
    border-color: #28a745;
    font-size: 1.2em; /* Make the tick a little bigger */
    font-weight: bold;
    padding: 4px 8px; /* Ensure padding is consistent */
    line-height: 1;
}

/* --- Ranked War Score Display --- */

/* --- Ranked War Score Display (New Design) --- */

/* This makes the new box fit nicely into the top controls grid */
.ops-control-item.ops-ranked-war-score {
    padding: 0;
    background-color: transparent;
    border: none;
    align-items: stretch; 
}

/* The main container for the entire score box */
.ranked-war-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #2a2a2a;
    border: 2px solid black;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: Arial, sans-serif;
    color: #f0f0f0;
    min-width: 320px;
    box-sizing: border-box;
}

/* Header: Faction 1 vs Faction 2 */
.rw-header {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    font-weight: bold;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #444;
}
.rw-vs {
    color: #aaa;
    font-weight: normal;
    margin: 0 15px;
}
#rw-faction-one-name { 
    color: #4CAF50;
	flex: 1;
	text-align: right;
}
#rw-faction-two-name { 
    color: #e53935;
	flex: 1;
	text-align: left;
}

/* The new middle row holding the 3 info blocks */
.rw-scores-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

/* The small boxes for Energy and War Time */
.rw-stat-box-small {
    padding: 4px 8px;
    border: 1px solid #383838;
    border-radius: 5px;
    background-color: rgba(0,0,0,0.2);
    min-width: 95px; /* Gives them a consistent width */
}
.rw-small-label {
    font-size: 0.7em;
    font-weight: bold;
    color: #e0a71a; /* Gold */
    text-transform: uppercase;
}
.rw-small-value {
    font-size: 1.1em;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    color: #ddd;
}
#rw-user-energy {
    color: #4CAF50; /* Green for energy value */
}

/* Center block: LEAD TARGET */
.rw-lead-target {
    text-align: center;
}
.rw-lead-label {
    color: #e0a71a;
    font-size: 0.8em;
    font-weight: bold;
    letter-spacing: 1px;
}
.rw-lead-value {
    font-size: 1.2em;
    font-weight: bold;
    color: #ddd;
}

/* Progress Bar */
.rw-progress-bar-container {
    display: flex;
    height: 10px;
    width: 90%;
    margin: 12px auto 0 auto; /* Adds space above the bar and centers it */
    border-radius: 5px;
    overflow: hidden;
    background-color: #1e1e1e;
    border: 1px solid #111;
}
.rw-progress-bar-one {
    background-color: #4CAF50;
    transition: width 0.5s ease-in-out;
}
.rw-progress-bar-two {
    background-color: #e53935;
    transition: width 0.5s ease-in-out;
}
.quick-links-label {
    font-weight: bold; /* Makes the text bold */
    color: white;      /* Sets the text color to white */
    margin-bottom: 5px; /* Adds a little space below the text, adjust as needed */
    padding-left: 5px; /* Adds a little padding to the left, adjust as needed to align with buttons */
}

/* =======================================================
   CHAIN TIMER STYLES V2.1 (New Look, Original Layout)
   ======================================================= */

/* Container rule - keeping it general */
.ops-chain-timers-container {
    display: flex;
    gap: 5px;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
}

/* Combining original layout with new visual flair */
.chain-timer-box {
    /* Layout/Size from original (DO NOT CHANGE) */
    padding: 2px 5px;
    min-width: 50px;
    width: fit-content;
    flex-shrink: 0;
    box-sizing: border-box;
    text-align: center;
    background-color: #2a2a2a;
    border: 2px solid #444; 
    border-radius: 8px;
    margin-top: 64px;
    display: flex;
    flex-direction: column;
}

/* New border colors based on ID */
#friendly-chain-timer {
    border-color: #4CAF50;
}
#enemy-chain-timer {
    border-color: #e53935;
}

/* Header styling */
.chain-timer-header {
    /* Layout/Structure from original (DO NOT CHANGE) */
    margin-bottom: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid #444;
    padding-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Visuals from new style */
    font-size: 0.7em; /* Slightly larger */
    font-weight: bold;
    color: #e0a71a;
}

/* Data container - Unchanged from original */
.chain-timer-data {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0px;
    margin-top: 2px;
}

/* Generic hits/time styling */
.chain-timer-hits, .chain-timer-time {
    font-weight: bold;
    line-height: 1;
}

.chain-timer-hits {
    font-size: 1.5em; /* Slightly larger */
}
.chain-timer-time {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em; /* Slightly larger */
    white-space: nowrap;
}

/* New specific colors for friendly timer */
#friendly-chain-timer .chain-timer-hits,
#friendly-chain-timer .chain-timer-time {
    color: #66bb6a;
}

/* New specific colors for enemy timer */
#enemy-chain-timer .chain-timer-hits,
#enemy-chain-timer .chain-timer-time {
    color: #ef5350;
}

/* ====================================================
   CHAIN PROGRESS BAR STYLES (Slightly Bigger)
   ==================================================== */

/* Container for the progress bar */
.chain-progress-container {
    background-color: #1e1e1e;
    border-radius: 6px; /* Increased */
    height: 12px;       /* Increased from 8px to make it thicker */
    border: 1px solid #111;
    margin-top: 8px;    /* Increased for better spacing */
    width: 100%;
    overflow: hidden;   /* Ensures inner bar has rounded corners */
}

/* The actual moving bar inside the container */
.chain-progress-bar {
    height: 100%;
    width: 0%; /* JavaScript will update this width */
    border-radius: 5px; /* Increased */
    transition: width 0.5s ease-in-out; /* Smooth animation when width changes */
}

/* Color for the friendly progress bar */
#friendly-chain-progress {
    background-color: #4CAF50; /* Green */
}

/* Color for the enemy progress bar */
#enemy-chain-progress {
    background-color: #e53935; /* Red */
}
.chain-score-header-names {
    display: flex; /* Make the names display side-by-side */
    justify-content: center; /* Center the names horizontally within their wrapper */
    align-items: center; /* Vertically align the names */
    gap: 8px; /* Space between the two faction names (adjust as needed) */
    white-space: nowrap; /* Keep the names on a single line */
    font-size: 1.2em; /* Adjust font size for the names as desired */
    color: #f0f0f0; /* Light text color for the names */
    font-weight: bold;
}

/* Ensure individual faction name spans are inline within the flex container */
.score-faction-name {
    /* MODIFIED: Ensure it behaves inline within the new flex container */
    display: inline-block; /* Or you can use 'inline-flex' if needed */
    width: auto; /* Allow width to shrink to content */
    text-align: center; /* Ensure text itself is centered if it wraps within its auto width */
}

/* Style for the new Upload Plan button */
#uploadPlanButton {
    /* Inherits from .action-btn. Add specific color if you want it different */
    background-color: #00a8ff; /* Example: A blue color for upload */
    color: #1e1e1e; /* Dark text on blue */
    margin-top: 10px; /* Add some space above it if needed */
}

#uploadPlanButton:hover {
    background-color: #007bff; /* Darker blue on hover */
    color: white; /* White text on hover */
}

/* Styling for the "Quick Action:" label and its associated button */
.quick-action-group {
    display: flex; /* Use flexbox to align the text and button horizontally */
    align-items: center; /* Vertically align them in the middle */
    gap: 5px; /* Space between the text and the button */
    margin-right: 15px; /* Add some space to the right of this group */
    white-space: nowrap; /* Prevent the label from wrapping */
}

.quick-action-label {
    color: white; /* Gold/yellow color for the text, matching your theme */
    font-weight: bold;
    font-size: 0.9em; /* Adjust font size as needed */
}

/* New: Layo for Battle Stats, Work Stats, and Cooldowns to put them in one row */
.member-details-stats-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Attempt 3 columns, then wrap as needed */
    gap: 15px; /* Space between the blocks */
    margin-bottom: 15px; /* Keep bottom margin */
}

/* Ensure the inner stat blocks and cooldown block take up full width within their grid cell */
.member-details-stats-layout .member-stat-block,
.member-details-stats-layout .member-cooldowns-block {
    width: 100%; /* Important for grid item sizing */
    box-sizing: border-box; /* Ensure padding is included */
}

/* Adjust font size for stats in the member-stats-grid to help fit */
.member-stats-grid {
    font-size: 0.85em; /* Slightly smaller font for values to help fit */
}

/* Also ensure thi style for the main section container is active */
.member-stats-group-row { /* This old class should now just define basic flex properties if needed elsewhere */
    display: flex; /* Keep as flex if other elements use it for basic row behavior */
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}


/* This new container helps align the buttons horizontally */
.config-actions {
    display: flex;
    justify-content: center; /* Centers the buttons horizontally */
    align-items: baseline; /* This is the key change to align them vertically */
    gap: 10px; /* Adds space between the buttons */
    margin-top: 15px; /* Adds some space above the buttons */
}
/* This styles the 'Upload Image' label to look like the other buttons */
.upload-btn {
    cursor: pointer;
}

.save-config-btn {
    margin-bottom: 15px;
}

.enemy-targets-table .status-okay {
    color: white; /* Green for okay status */
}

/* --- Nerve and Energy Column Text Colors --- */
#friendly-members-table td:nth-child(9) {
    color: #d32f2f; /* Red Text for Nerve Column */
}

#friendly-members-table td:nth-child(10) {
    color: #28a745; /* Green Text for Energy Column */
}

#friendly-members-table tbody td.status-other {
    color: #ffb86c !important; /* Orange for other states like Jail/Federal */
}

#friendly-members-table tbody td.status-okay {
    color: #28a745 !important;
}

#friendly-members-table tbody td.status-abroad {
    color: #17a2b8 !important; /* A clear, pleasant blue for 'Abroad' */
}


.hits-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.hits-label {
    color: #e0a71a;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}

#faction-hits-display {
    /* Basic box styling to match your theme */
    background-color: #222;
    border: 2px solid black;
    border-radius: 6px;
    padding: 5px 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-top: 75px; 
    display: flex;
    flex-direction: column;
    height: 100%; /* Makes the box fill the height of its grid cell */
    justify-content: center; /* Centers the content vertically */
    gap: 4px; /* Space between the rows */
}



#faction-hits-display .hits-value {
    color: #00a8ff;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1em;
    font-weight: bold;
}

/* --- Revivable Column Text Colors (Adjusted for Specificity) --- */
/* Target the classes directly on table data cells within the friendly-members-table */
#friendly-members-table .revivable-text-green {
    color: #4CAF50 !important; /* A vibrant green */
}

#friendly-members-table .revivable-text-orange {
    color: #17a2b8 !important; /* A clear orange */
}

#friendly-members-table .revivable-text-red {
    color: #d32f2f !important; /* A strong red */
}

/* --- NEW/MODIFIED: Styles for Faction Members Chat Tab Content --- */

/* This targets the new main container for the Faction Members tab content */
/* It acts like a regular chat-panel, occupying the full space */
#factionMembersChatContent {
    display: flex; /* Initially display as flex to show the list */
    flex-direction: column; /* Stack its children (list or details) vertically */
    flex-grow: 1; /* Allow it to fill the available height */
    overflow-y: auto; /* Allow scrolling for its content if it overflows */
    padding: 10px; /* Add some padding inside this content area */
    box-sizing: border-box; /* Include padding in the element's total width and height */
    /* background-color: #2d3748; /* Optional: A slightly different background for this specific tab content area */
    /* border-radius: 8px; /* Optional: Match other rounded corners */
}

/* This is the container for the list of members (inside factionMembersChatContent) */
#factionMembersListContainer {
    display: block; /* Ensure it's visible by default when the tab is active */
    flex-grow: 1; /* Allow it to take available space */
    /* Inherits styles from .members-list-container if defined globally */
    /* Add specific padding/margin for this context if needed */
}

/* This is the container for the Member Details view within the Faction Members tab */
#factionMemberDetailsView {
    display: none; /* Crucial: Initially hide the details view */
    flex-direction: column; /* Stack content vertically */
    flex-grow: 1; /* Allow it to take available space */
    padding: 15px; /* Add padding for the details content */
    background-color: #2a2a2a; /* A slightly different background for the details box */
    border-radius: 8px; /* Rounded corners for the details box */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling within the details panel */
    color: #f0f0f0; /* Default text color */
}

/* Styles for the "Back to List" button */
.back-to-list-button {
    background-color: #007bff; /* Blue, matching other action buttons */
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 15px; /* Space below the button */
    align-self: flex-start; /* Align to the left/start of the flex container */
    transition: background-color 0.2s ease;
}

.back-to-list-button:hover {
    background-color: #0056b3; /* Darker blue on hover */
}

/* Re-apply some specific styles for member details elements
   that were originally designed for the old 'detail-panel-placeholder' */
.member-detail-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.member-header-top-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.member-detail-profile-image {
    width: 64px; /* Larger profile image for details */
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00a8ff; /* Blue border */
    box-shadow: 0 0 8px rgba(0, 168, 255, 0.5); /* Blue glow */
}

.member-detail-name-id {
    font-size: 1.6em;
    font-weight: bold;
    color: #e0a71a; /* Gold color for name */
    text-align: center;
}

.member-detail-info-row {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #444;
}

.member-detail-info-paragraph {
    margin: 0;
    color: #f0f0f0;
    font-size: 0.95em;
}

.member-stats-group-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid for stat blocks */
    gap: 15px;
    margin-bottom: 15px;
}

.member-stat-block {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensure blocks take full height in grid */
}

.member-stat-block h5 {
    color: #00a8ff; /* Blue for stat block headers */
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.2em;
}

.member-stats-grid {
    display: grid;
    grid-template-columns: auto 1fr; /* Label then value */
    gap: 5px 10px;
    font-size: 0.9em;
    flex-grow: 1; /* Allow grid to fill space within block */
}

.member-stats-grid span:nth-child(odd) {
    font-weight: bold;
    color: #e0a71a; /* Gold for labels */
    text-align: right;
}

.member-stats-grid span:nth-child(even) {
    color: #f0f0f0;
    text-align: left;
}

.sub-detail {
    font-size: 0.8em;
    color: #aaa;
    margin-left: 5px;
}

.member-cooldowns-block {
    background-color: #222;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-top: 15px; /* Space from stats blocks */
}

.member-cooldowns-block h5 {
    color: #00a8ff;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.2em;
}

.member-cooldowns-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid; /* Use grid for cooldowns list */
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Try 2-3 columns */
    gap: 8px 15px; /* Vertical and horizontal gap */
}

.member-cooldowns-list li {
    background-color: #1a1a1a;
    padding: 8px;
    border-radius: 5px;
    font-size: 0.9em;
    color: #f0f0f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-cooldowns-list li strong {
    color: #e0a71a; /* Gold for cooldown names */
}

.member-detail-error-message {
    color: red;
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Adjustments for smaller screens (media queries) */
@media (max-width: 768px) {
    .member-header-top-row {
        flex-direction: column; /* Stack elements in header on small screens */
        gap: 5px;
    }
    .member-stat-block.member-stat-block-small {
        margin-top: 10px; /* Add some space when stacked */
    }
    .member-stats-group-row {
        grid-template-columns: 1fr; /* Stack stat blocks vertically */
    }
    .member-cooldowns-list {
        grid-template-columns: 1fr; /* Stack cooldowns vertically */
    }
}
.quick-links-container {
  display: flex;
  align-items: center;
  gap: 10px; /* Adjust the space between the label and buttons */
}

@media (min-width: 993px) {
    html, body {
        overflow-y: hidden;
    }
}


/* Main container for the entire Private Chat tab content */
.private-chat-tab-content {
    display: flex; /* Enables flexbox for its direct children (panels) */
    flex-direction: column; /* Stacks children vertically if needed, but layout-panels will handle horizontal */
    height: 100%; /* Ensures it takes up the full height of its parent (.chat-display-area) */
    box-sizing: border-box;
    padding: 10px; /* Internal padding for the entire private chat tab area */
    background-color: #2a2a2a; /* Background color for the tab's content area */
    border-radius: 8px; /* Matches rounded corners of the main chat container */
}

/* Container for the two side-by-side panels (Recent Chats and Selected Chat) */
.private-chat-layout-panels {
    display: flex; /* Arranges the two main panels side-by-side */
    flex-grow: 1; /* Allows this container to take up remaining vertical space */
    gap: 15px; /* Space between the two panels */
    height: 100%; /* Ensures panels fill the height of their parent */
    box-sizing: border-box;
}

/* Styles for the "Recent Chats" panel on the left */
.recent-chats-panel {
    display: flex;
    flex-direction: column; /* Stacks header and list vertically inside this panel */
    width: 28%; /* Sets its width to be narrower (approx 28% of available width) */
    min-width: 200px; /* Ensures it doesn't become too small on narrower views */
    background-color: #222; /* Dark background for the panel */
    border: 1px solid black; /* Border matching other elements */
    border-radius: 8px; /* Rounded corners */
    overflow: hidden; /* Hides content that overflows and helps with scrollbar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    box-sizing: border-box;
}

/* Styles for the "Selected Chat" panel on the right (the main conversation area) */
.selected-chat-panel {
    display: flex;
    flex-direction: column; /* Stacks header, messages, and input vertically inside this panel */
    flex-grow: 1; /* Allows it to take up all remaining horizontal width */
    background-color: #222;
    border: 1px solid black;
    border-radius: 8px;
    overflow: hidden; /* Hides content that overflows and helps with scrollbar */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

/* Styling for the headers within both panels (Recent Chats, Select a Chat) */
.private-chat-tab-content .panel-header {
    background-color: #00a8ff; /* Blue background matching other headers */
    color: #1e1e1e; /* Dark text on blue */
    padding: 8px 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    flex-shrink: 0; /* Prevents header from shrinking when content grows */
    border-bottom: 2px solid black; /* Separator below the header */
}

/* Scrollable wrapper for the "Recent Chats" list */
.recent-chats-list-scroll-wrapper {
    flex-grow: 1; /* Allows the list to take up all remaining vertical space in its panel */
    overflow-y: auto; /* Enables vertical scrolling if the list is too long */
    padding: 8px; /* Internal padding for the list area */
    box-sizing: border-box;
    scrollbar-gutter: stable; /* Keeps scrollbar space consistent even when not scrolling */
}

/* Base style for the unordered list of recent chats */
.recent-chats-list {
    list-style: none; /* Removes default bullet points */
    padding: 0;
    margin: 0;
}

/* Style for each individual chat item in the Recent Chats list */
.recent-chats-list .chat-item {
    display: flex;
    align-items: center; /* Vertically aligns profile pic, name, and X button */
    justify-content: space-between; /* Pushes chat info to left, delete button to right */
    padding: 8px 5px;
    border-bottom: 1px solid #3a3a40; /* Separator between chat items */
    color: #f0f0f0; /* Light text color */
    cursor: pointer; /* Indicates it's clickable */
    transition: background-color 0.2s ease; /* Smooth hover effect */
}

.recent-chats-list .chat-item:last-child {
    border-bottom: none; /* No border for the last item */
}

.recent-chats-list .chat-item:hover {
    background-color: #38383e; /* Darker background on hover */
}

/* Style for the currently active/selected chat in the list */
.recent-chats-list .chat-item.active-chat {
    background-color: #007bff; /* Highlight color for active chat */
    color: white;
}

/* Container for the profile picture and name within a chat item */
.recent-chats-list .chat-item .chat-info {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Allows it to take up available space */
    min-width: 0; /* Prevents content overflow within flex item */
    margin-right: 5px; /* Small space before the delete button */
}

/* Style for the small profile picture in the Recent Chats list */
.recent-chats-list .chat-item .profile-pic-small {
    width: 24px;
    height: 24px;
    border-radius: 50%; /* Makes it circular */
    object-fit: cover; /* Ensures image covers the area without distortion */
    margin-right: 8px;
    flex-shrink: 0; /* Prevents it from shrinking */
}

/* Style for the chat name in the Recent Chats list */
.recent-chats-list .chat-item .chat-name {
    white-space: nowrap; /* Prevents the name from wrapping */
    overflow: hidden; /* Hides overflowing text */
    text-overflow: ellipsis; /* Adds "..." for overflowing text */
    font-weight: bold;
}

/* Style for the delete/close button ('x') in Recent Chats list */
.recent-chats-list .chat-item .delete-chat-btn {
    background-color: #dc3545; /* Red background for delete */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8em;
    cursor: pointer;
    flex-shrink: 0; /* Prevents shrinking */
    opacity: 0.7; /* Slightly transparent when not hovered */
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.recent-chats-list .chat-item .delete-chat-btn:hover {
    opacity: 1; /* Fully opaque on hover */
    background-color: #c82333; /* Darker red on hover */
}

/* Scrollable wrapper for the messages in the Selected Chat panel */
.selected-chat-messages-scroll-wrapper {
    flex-grow: 1; /* Keep this to allow it to fill space if smaller than max-height */
    height: 280px; /* NEW/MODIFIED: Set a fixed height for the message display area */
    overflow-y: auto; /* This ensures a scrollbar appears if messages exceed 300px */
    padding: 10px;
    box-sizing: border-box;
    scrollbar-gutter: stable;
    display: flex;
    flex-direction: column;
}

/* Reusing existing .chat-message styles for individual messages within private chat */
/* If you need specific overrides for private chat messages, add them here */
.selected-chat-messages-scroll-wrapper .chat-message {
    margin-bottom: 8px; /* Space between messages */
}

/* Style for placeholder messages (e.g., "Click a chat...") */
.selected-chat-messages-scroll-wrapper .message-placeholder {
    text-align: center;
    color: #bbb;
    margin-top: 20px;
}

/* Input area for the Selected Chat panel (bottom of the right panel) */
.selected-chat-input-area {
    display: flex;
    gap: 10px; /* Space between input field and send button */
    padding: 10px; /* Padding around the input and button */
    border-top: 1px solid #3a3a40; /* Separator from messages above */
    background-color: #333; /* Slightly darker background for the input area */
    flex-shrink: 0; /* Prevents this area from shrinking */
}

/* Reuse existing chat-text-input styles for the private chat input */
.selected-chat-input-area .chat-text-input {
    flex-grow: 1; /* Allows the input field to take up available space */
    margin-right: 0 !important; /* Overrides any global margin-right that might interfere */
}

/* Reuse existing chat-send-btn styles for the private chat send button */
.selected-chat-input-area .chat-send-btn {
    flex-shrink: 0; /* Prevents the button from shrinking */
}

.ops-controls-grid {
  display: flex;
  justify-content: space-between; /* This spaces the 3 main items out */
  align-items: center;
  gap: 15px; /* Adjusts the space between items */
}

.ops-left-group {
  margin-top: -65px;
  display: flex;
  align-items: center;
  gap: 15px; /* This spaces out the two boxes within the left group */
}
/* --- Faction Member Button Colors --- */

/* This makes the message button blue */
.member-item .message-button {
    background-color: #3d84b8;  /* A nice blue from your theme */
    color: #ffffff;             /* White icon */
}
.member-item .message-button:hover {
    background-color: #4a9dcf;  /* A lighter blue on hover */
}

/* --- Faction Member Button Styles (Corrected Final) --- */

/* This is the MAIN button style. It is ALWAYS grey. */
.add-member-button,
.remove-friend-button {
    background-color: #555;
    color: #f0f0f0;
    border: 1px solid #444;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1em;
    cursor: pointer;
    margin-left: 10px;
    flex-shrink: 0;
    position: relative; /* This is crucial for the overlay */
    transition: background-color 0.2s ease;
}

/* A simple hover effect for the main grey button */
.add-member-button:hover,
.remove-friend-button:hover {
    background-color: #6a6a6a; 
}

/* This is the small OVERLAY circle style. It is ALWAYS the same size and position. */
.plus-sign {
    font-size: 0.8em;
    font-weight: bold;
    position: absolute;
    bottom: -2px;
    right: -2px;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    line-height: 12px;
    text-align: center;
    display: block;
    color: white;
}

/* This rule makes the overlay BLUE when it's an add button. */
.add-member-button .plus-sign {
    background-color: #00a8ff; /* Blue */
}

/* This rule makes the overlay RED when it's a remove button. */
.remove-friend-button .plus-sign {
    background-color: #dc3545; /* Red */
}

/* This makes the message button blue */
.member-item .message-button {
    background-color: #3d84b8;
    color: #ffffff;
}

.member-item .message-button:hover {
    background-color: #4a9dcf;
}

/* ==============================================
   FORCE SCOREBOARD LEFT - FINAL CSS OVERRIDE
   ============================================== */

/* 1. Force the main bar to be a flex row, starting from the left */
#active-ops-tab .ops-controls-grid {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

/* 3. Force the Quick Targets on the right to push itself the way to the right */
#active-ops-tab .ops-control-item.ops-quick-targets {
    margin-left: auto !important;
}

/* 4. Reset the scoreboard container just in case */
#active-ops-tab .ops-control-item:has(.ranked-war-container) {
    flex-grow: 0 !important;
	margin-left: 140px;
	width: 425px;
}
#friendly-status-tab .friendly-members-panel {
    width: 1500px !important;     /* Set a fixed width */
    flex: none !important;        /* Disable the flex ratio */
}
/* --- NEW ACTION BUTTON COLORS --- */

/* The orange "Travel" button */
.action-button-orange {
    background-color: #f39c12; /* A nice, vibrantnge */
}

/* The yellow "Xanax" button */
.action-button-yellow {
    background-color: #f1c40f; /* A rich yellow/gold */
}

/* --- NEW CENTERED TITLE FOR TABLE --- */
.table-title-centered {
    color: #00a8ff;
    text-align: center;
    margin-bottom: 15px; /* Adds some space below the title */
    margin-top: 5px;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.table-title-centered {
    position: relative;
    left: -25px; 
}
#saveAdminSelectionsBtn {
    margin-top: -35.5px !important; 
}

#leader-config-tab {
    padding-bottom: -60px !important;/* Adjust this value as needed to "shave off" the bottom */
}

/* Styling for the duplicated scoreboard in the Announcements tab */
#announcementScoreboardContainer {
    width: 100%;             /* Make it fill the width of the box */
    margin-top: 20px;          /* Add some space above it */
    grid-column: 1 / -1;     /* Make it span the full width of the status grid */
    box-sizing: border-box;
}
/* Ensure the .ranked-war-container within #announcementScoreboardContainer has the correct styling */
#announcementScoreboardContainer .ranked-war-container {
    background-color: #2a2a2a;
    border: 2px solid black;
    border-radius: 8px;
    padding: 8px 12px;
    width: 100%; /* Ensure it fills its parent container */
    box-sizing: border-box;
}

.rw-header {
    display: flex;
    align-items: center;
}

.rw-vs {
    flex-grow: 1;          /* This makes the 'vs' container take all available middle space */
    text-align: center;      /* This centers the text inside that space */
    margin: 0; 	/* Removes the old side margins */
}

#announcementScoreboardContainer .rw-vs {
    position: relative;
    left: -12px; /* <-- Adjust this value to move the 'vs' */
}

#rw-faction-one-name,
#rw-faction-two-name {
    flex: 1;                 /* Give equal space to the names */
}

#rw-faction-one-name {
    text-align: right;      /* Aligns the first name to the right (towards the center) */
    padding-right: 15px;    /* Adds some space between the name and 'vs' */
}

#rw-faction-two-name {
    text-align: left;       /* Aligns the second name to the left (towards the center) */
    padding-left: 15px;     /* Adds some space between 'vs' and the name */
}
/* Hide the old static scoreboard text on the Announcements tab */
#announcements-tab > div:last-child:not(#announcementScoreboardContainer) {
    display: none; /* This targets the old <div> containing the text, ensuring it doesn't hide the new scoreboard container */
}
/* Ensure the progress bars in the ANNOUNCEMENT scboard have the correct colors */
#announcementScoreboardContainer .rw-progress-bar-one {
    background-color: #4CAF50; /* Green */
}

#announcementScoreboardContainer .rw-progress-bar-two {
    background-color: #e53935; /* Red */
}

/* Ensure the faction names within the ANNOUNCEMENT scoreboard get their specific colors */
#rw-faction-one-name_announcement {
    color: #4CAF50; /* Green */
}

#rw-faction-two-name_announcement {
    color: #e53935; /* Red */
}

/* Ensure the energy value in the ANNOUNCEMENT scoreboard gets its green color */
#rw-user-energy_announcement {
    color: #4CAF50; /* Green */
}

/* Corrected: .summary-edit-buttons.leader-controls-row - This sets up the row layout */
.summary-edit-buttons.leader-controls-row {
    display: flex;
    flex-direction: row; /* CRITICAL: Must be row */
    align-items: stretch; /* Stretch items to fill height, helps with uniformity */
    justify-content: space-around; /* Distribute space (you can change to space-between or flex-start later) */
    gap: 10px;
    width: 100%;
    flex-wrap: wrap; /* Keep for responsiveness */
    padding: 10px;
    border-radius: 5px;
	margin-left: -8px !important;
    /* Background and border should be removed from here as per previous step */
}

#availability-admin-controls {
    display: none; /* Keep this as it's controlled by JS */
    align-self: flex-start; /* This helps if its parent is a flex container */
    width: 100%;           /* Ensure it spans full width so its children can align within it */
    box-sizing: border-box; /* Include padding/border in width */
    margin-left: -0px !important;

    /* CRITICAL ADDITION: Force content alignment to the left within this div */
    text-align: left !important; /* THIS IS THE KEY TO FIX CENTERING PROPAGATION */
}
/* Update: l */


/* Rule for equal width children */
.summary-edit-buttons.leader-controls-row > .action-btn,
.summary-edit-buttons.leader-controls-row > #discordWebhookUnifiedControl { /* Use #id for the webhook control */
    flex: 1; /* Makes them grow/shrink equally */
    min-width: 120px; /* Adjust as needed */
    max-width: 250px; /* Adjust as needed */
    box-sizing: border-box;
    /* text-align: center; -- This can be removed here, handled by justify-content: center */
}
/* ==================================================================
   War Availability Tab Styles
   ================================================================== */

/* Main 2-column grid for the tab content */
.war-availability-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr; /* Left column is smaller than the right */
    gap: 20px;
    padding: 10px;
}

/* Panel Styling (for both left and right columns) */
.user-status-panel,
.team-roster-panel {
    background-color: #222;
    border: 1px solid black;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Titles inside the panels */
.user-status-panel h4,
.team-roster-panel h4 {
    color: #e0a71a;
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 1.5em;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

/* --- Left Column: User Form Styles --- */

.availability-day-form {
    border: 1px solid #333;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.availability-day-form h5 {
    text-align: center;
    color: #00a8ff;
    margin: -10px -10px 10px -10px;
    padding: 8px;
    background-color: #333;
    border-radius: 5px 5px 0 0;
}

.form-group {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    color: #ccc;
}

.form-group.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 8px;
    background-color: #1e1e1e;
    border: 1px solid #555;
    color: #f0f0f0;
    border-radius: 4px;
    box-sizing: border-box;
}

#add-availability-day-btn {
    width: 100%;
    margin-top: 10px;
}


/* --- Right Column: Roster Styles --- */

.roster-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px; /* Adjust as needed */
    overflow-y: auto;
    padding-right: 5px; /* Space for scrollbar */
}

.roster-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: 4px;
    background-color: #333;
    border-left: 5px solid; /* The colored border will be here */
}

.player-name {
    font-weight: bold;
    font-size: 1.1em;
}

.player-status {
    font-size: 0.9em;
    color: #ddd;
    font-style: italic;
}

/* Roster Color Coding */
.roster-player.status-green {
    border-left-color: #4CAF50;
    color: #a5d6a7;
}

.roster-player.status-orange {
    border-left-color: #ff9800;
    color: #ffcc80;
}

.roster-player.status-red {
    border-left-color: #f44336;
    color: #ef9a9a;
}

.roster-player.status-grey {
    border-left-color: #666;
    color: #aaa;
}

/* Responsive adjustments for the new tab */
@media (max-width: 992px) {
    .war-availability-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
    }
}
.user-status-panel .action-btn {
    width: 100%;
    margin-top: 5px;
    padding: 8px 15px;
    font-size: 0.9em;
    font-weight: bold;
    background-color: #007bff;
    color: white;
    border: 2px solid black;
    border-radius: 5px;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.user-status-panel .action-btn:hover {
    background-color: #00a8ff;
    border-color: black;
}

/* New styles for the roster item to accommodate a picture */
/* --- UPDATED Roster Color Coding --- */

/* First, set the default text colors */
/* --- FINAL Roster Layout & Color Fix --- */

/* This is the main container for each player's row */
.roster-player {
    display: flex;           /* This makes the items inside go side-by-side */
    align-items: center;     /* This vertically centers the picture with the text block */
    gap: 12px;               /* This is the space between the picture and the text */
    padding: 8px 10px;
}

/* This styles the profile picture itself */
.roster-player-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #555;
    flex-shrink: 0; /* This stops the image from being squished */
}

/* This is the container for the text (Name and Status) */
.roster-player-info {
    display: flex;
    flex-direction: column; /* This is correct - it stacks the Name on top of the Status */
    gap: 3px;
}

/* This forces the player's name to be solid white */
.roster-player .player-name {
    color: #FFFFFF !important;
    font-weight: bold;
    font-size: 1.1em;
}

/* This is the default style for the status text */
.roster-player .player-status {
    color: #bbbbbb !important;
    font-size: 0.85em;
    font-style: normal !important;
}


/* --- INDIVIDUAL TEXT COLORS (These are correct, but included for completeness) --- */

.status-text-green {
    color: #66bb6a !important;
    font-weight: bold;
}
.status-text-orange {
    color: #ffa726 !important;
    font-weight: bold;
}
.status-text-red {
    color: #ef5350 !important;
    font-weight: bold;
}
.status-text-grey {
    color: #9E9E9E !important;
    font-style: italic;
}

/* This keeps the colored border on the left of the whole row */
.roster-player.status-green { border-left-color: #4CAF50; }
.roster-player.status-orange { border-left-color: #ff9800; }
.roster-player.status-red { border-left-color: #f44336; }
.roster-player.status-grey { border-left-color: #666; }

/* --- FIX for Roster Layout --- */

/* This makes each player row a flex container to align items side-by-side */
.roster-player {
    display: flex;
    align-items: center; /* Vertically centers the picture with the text block */
    gap: 12px;           /* Sets the space between the picture and the text */
}

/* This fixes the profile picture size and makes it a circle */
.roster-player-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #555;
    flex-shrink: 0; /* Prevents the image from being squished */
}

/* This ensures the text block takes up the available space */
.roster-player-info {
    flex-grow: 1;
}

/* --- Faction-Wide Summary Panel Styles --- */

.faction-summary-panel {
    border-top: 2px solid #444; /* A separator from the form above */
    margin-top: 20px;
    padding-top: 15px;
}

.faction-summary-panel h4 {
    font-size: 1.2em;
    color: #e0a71a; /* Gold color for the title */
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* This creates the 3-column layout */
    gap: 10px; /* Space between the columns */
    text-align: center;
}

.summary-col {
    background-color: #333;
    padding: 10px;
    border-radius: 5px;
}

.summary-col strong {
    color: #00a8ff; /* Blue for the "Day 1", "Day 2", etc. headers */
    border-bottom: 1px solid #555;
    display: block;
    padding-bottom: 5px;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.summary-col p {
    margin: 4px 0;
    font-size: 0.9em;
    color: #f0f0f0;
}

.summary-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9em;
    color: #ccc;
}

.summary-footer hr {
    border: none;
    border-top: 1px solid #444;
    margin: 10px auto;
    width: 80%;
}

.summary-footer p {
    margin: 5px 0;
}

.summary-footer strong {
    color: #e0a71a; /* Gold color for the labels */
}

/* --- Styling for the "Edit Day" buttons in the summary --- */


.summary-edit-buttons {
    display: flex;
    justify-content: space-around; /* This spaces the buttons out evenly */
    gap: 10px;                     /* Adds a little space between the buttons */
    margin-top: 15px;              /* Space above the buttons */
}

/* This styles the individual buttons */
.summary-edit-buttons .action-btn {
    padding: 5px 12px;     /* Makes the buttons smaller (less vertical padding) */
    font-size: 0.9em;      /* Makes the font a little smaller */
    color: black;          /* Changes the text color to black */
    flex-grow: 1;          /* Makes all buttons take up equal space in the row */
}

.availability-day-form .action-btn:disabled {
    color: black !important;
    background-color: #bbbbbb;
    cursor: not-allowed;
}

#announcements-tab > .ops-ranked-war-score {
    display: none !important;
}
/* --- Availability Summary Styles --- */
#availability-summary-container ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    text-align: center;
}

#availability-summary-container li {
    background-color: #333;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 1em;
}

#availability-summary-container li strong {
    color: #00a8ff;
}

/* ==================================================================
   FIX for Scoreboard Width and Centering
   ================================================================== */
#active-ops-scoreboard {
width: 60%;           
max-width: 700px;         /* Prevents it from getting too big on very wide screens. */
margin-left: auto !important;   /* These two lines automatically center it. */
margin-right: auto !important;
}

/* NEW: Styles for the full-screen transparent modal overlay */
.webhook-modal-overlay {
    position: fixed; /* Fixes it to the viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dark, semi-transparent background */
    display: flex; /* Use flexbox to center the modal content */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    z-index: 9999; /* Ensure it's on top of everything */
    /* display: none; will be set by JS initially */
}

/* Styles for the modal's content box (the webhook-edit-area when it's a modal) */
.webhook-edit-area {
    /* REMOVE position: absolute, top, left, width: 100%, height: 100%, z-index from previous definition */
    /* This rule will now define the appearance of the central modal box */
    background-color: #2a2a2a; /* Dark background for the modal content */
    border: 1px solid #00a8ff; /* Theme blue border */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    padding: 20px; /* Internal padding */
    box-sizing: border-box;
    width: 90%; /* Max width for responsiveness */
    max-width: 400px; /* Maximum width for the modal */
    display: flex; /* Use flex to stack its internal elements */
    flex-direction: column;
    gap: 15px; /* Space between header, body, footer */
}

/* Styles for header within the modal */
.webhook-edit-area .modal-header {
    text-align: center;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}
.webhook-edit-area .modal-header h4 {
    color: #e0a71a; /* Gold title */
    margin: 0;
    font-size: 1.4em;
}

/* Styles for body within the modal (input field) */
.webhook-edit-area .modal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.webhook-edit-area .modal-body label {
    font-weight: bold;
    color: #f0f0f0;
}
.webhook-edit-area .webhook-input {
    width: 100%; /* Make input fill available space */
    padding: 8px;
    border: 1px solid #555;
    background-color: #1e1e1e;
    color: #f0f0f0;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Styles for footer within the modal (buttons) */
.webhook-edit-area .modal-footer {
    display: flex;
    justify-content: space-between; /* Space buttons out */
    gap: 10px;
    border-top: 1px solid #444;
    padding-top: 15px;
    margin-top: 5px; /* Adjust if needed */
}

/* Styling for Remove button */
.webhook-edit-area .action-btn.remove {
    background-color: #dc3545; /* Red color for remove */
    order: -1; /* Push to the left if justify-content is space-between */
}
.webhook-edit-area .action-btn.remove:hover {
    background-color: #c82333;
}

/* Update: Styles for buttons inside the modal (e.g., Save, Cancel, Remove) */
.webhook-edit-area .action-btn.small-btn {
    /* Existing properties (padding, font-size, border-radius etc.) */
    max-width: 90px; /* From previous step, adjust as needed for width */
    padding: 6px 10px; /* From previous step, adjust as needed for padding */
    font-size: 0.85em; /* From previous step, adjust as needed for font size */
    min-width: unset;
    flex-grow: 0;
    flex-shrink: 1;
    box-sizing: border-box;

    /* CRITICAL ADDITION: Force text color to black */
    color: black !important; /* Force black text */
}

/* Re-ensure the correct styles for #discordWebhookUnifiedControl itself */
/* This ensures it matches other action-buttons in the row */
#discordWebhookUnifiedControl {
    padding: 6px 15px; /* Adjust padding to match your other action-buttons */
    border-radius: 5px;
    font-weight: bold;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;

    background-color: #007bff !important; /* Default blue, will be overridden by status for background */
    border: 2px solid black !important; /* Force dark border */
    color: black !important; /* Force black text */

    display: flex;
    align-items: center;
    justify-content: center;
    
    position: relative; /* Keep this */
    overflow: hidden; /* Keep this */
    
    flex: 1; /* Make it grow/shrink equally with other buttons */
    min-width: 120px; /* Adjust to match your other action-buttons */
    max-width: 250px; /* Adjust to match your other action-buttons */
}
/* Ensure these hover rules are updated and apply !important if needed */
#discordWebhookUnifiedControl:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Update status-based colors for #discordWebhookUnifiedControl */
#discordWebhookUnifiedControl.configured-status {
    background-color: #4CAF50 !important; /* Green */

}
#discordWebhookUnifiedControl.configured-status:hover {
    background-color: #5cb85c !important;
}
#discordWebhookUnifiedControl.not-set-status {
    background-color: #FF6347 !important; /* Red */
}
#discordWebhookUnifiedControl.not-set-status:hover {
    background-color: #e5533d !important;
}
#discordWebhookUnifiedControl.editing {
    /* No need for specific background here, as modal will cover */
    /* You can apply a visual highlight to the button that launched the modal */
}

/* Hide ALL ops-controls-grid content in the friendly-status-tab on mobile */
@media (max-width: 768px) {
    #friendly-status-tab .ops-controls-grid {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Adjust spacing for the main content area below the header on mobile */
    .main-content-wrapper {
        padding-top: 10px; /* Add some space between the header and the main content */
    }
}


.game-plan-display img {
    width: 100%;          /* Make the image spawidth of the container */
    height: 100%;         /* Make the image span the full height of the container */
    object-fit: contain;  /* This is the magic part: it scales the image to fit inside */
    border-radius: 5px;   /* Optional: Adds a nice rounded corner to the image */
}
.hide-on-mobile {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

@media (max-width: 360px) {
    .hide-on-mobile-final {
        display: none !important;
    }
}

@media (max-width: 768px) {
  /* Hides the tab buttons for "Live Faction Activity" and "War Information" */
  .tab-navigation button[data-tab="friendly-status"],
  .tab-navigation button[data-tab="Faction-Financials"],

  /* Hides the content panels for those tabs */
  #friendly-status-tab,
  #Faction-Financials-tab,

  /* Hides the "Game Plan" and "Faction Announcements" sections headers and content */
  .announcements-grid-container > div:first-child,
  .announcements-grid-container > div:last-child,

  /* Hides both scoreboards on the announcements tab */
  #announcementScoreboardContainer {
    display: none;
  }
  
  /* Centers the remaining content on the Announcements tab */
  .announcements-grid-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
  }

  /* Corrected code to center the content in the War Availability tab */
  .war-availability-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  /*
   * NEW: Adjust the main container's maximum width for a better mobile fit.
   * This ensures all tabs are consistently sized.
   */
  #warPageHubContainer {
    max-width: 500px;
    width: 95%; /* Use a percentage for better responsiveness */
  }

  .war-availability-grid > .user-status-panel,
  .war-availability-grid > .team-roster-panel {
    max-width: 100%; /* Now that the parent container is limited, let the children fill it. */
    width: 100%;
  }
}

.summary-grid {
  flex-wrap: wrap;
}

/* ==================================================================
   BATTLE STATS COLOR CODING (V3 - 9-Tier Final)
   ================================================================== */

#friendly-members-table td.stat-cell {
    font-weight: bold;
}

/* --- Default State (14 Tiers) --- */
#friendly-members-table td.stat-tier-1 { background-color: #c8efff; color: #000000; }
#friendly-members-table td.stat-tier-2 { background-color: #b5e4ff; color: #000000; }
#friendly-members-table td.stat-tier-3 { background-color: #a3d9ff; color: #000000; }
#friendly-members-table td.stat-tier-4 { background-color: #90ceff; color: #000000; }
#friendly-members-table td.stat-tier-5 { background-color: #8dc1f4; color: #000000; }
#friendly-members-table td.stat-tier-6 { background-color: #9bb2de; color: #000000; }
#friendly-members-table td.stat-tier-7 { background-color: #aaa1c5; color: #000000; }
#friendly-members-table td.stat-tier-8 { background-color: #bc8ea9; color: #000000; }
#friendly-members-table td.stat-tier-9 { background-color: #d57482; color: #000000; }
#friendly-members-table td.stat-tier-10 { background-color: #e4575a; color: #000000; }
#friendly-members-table td.stat-tier-11 { background-color: #db484c; color: #000000; }
#friendly-members-table td.stat-tier-12 { background-color: #d2393d; color: #FFFFFF; }
#friendly-members-table td.stat-tier-13 { background-color: #c7292c; color: #FFFFFF; }
#friendly-members-table td.stat-tier-14 { background-color: #bc161a; color: #FFFFFF; }

/* --- Hover State (14 Tiers) --- */
#friendly-members-table tr:hover td.stat-tier-1 { background-color: #a0bfcc; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-2 { background-color: #90b6cc; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-3 { background-color: #82adcc; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-4 { background-color: #73a4cc; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-5 { background-color: #709ac3; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-6 { background-color: #7c8eb1; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-7 { background-color: #88809d; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-8 { background-color: #967187; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-9 { background-color: #aa5c68; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-10 { background-color: #b64548; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-11 { background-color: #af393c; color: #000000; }
#friendly-members-table tr:hover td.stat-tier-12 { background-color: #a82d30; color: #FFFFFF; }
#friendly-members-table tr:hover td.stat-tier-13 { background-color: #9f2023; color: #FFFFFF; }
#friendly-members-table tr:hover td.stat-tier-14 { background-color: #961114; color: #FFFFFF; }
#friendly-members-panel {
    display: flex;
    flex-direction: column;
    min-width: 500px; /* Adjust as needed */
}

#friendlyMembersListContainer {
    background-color: #222;
    border: 1px solid black;
    border-radius: 8px;
    overflow: auto; /* This is the key change */
    height: 475px;
}

#friendly-members-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, sans-serif;
    color: #ddd;
    table-layout: fixed;
}

#friendly-members-table thead th {
    background-color: #00a8ff;
    color: #1e1e1e;
    font-weight: bold;
    text-align: center;
    padding: 8px 10px;
    border-bottom: 2px solid #1e1e1e;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky; /* This is the fix for the header */
    top: 0; /* This makes it stick to the top of the container */
    z-index: 1; /* Ensures it stays above the scrolling content */
}

#friendly-members-table tbody td {
    padding: 5px 10px;
    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;
}

#friendly-members-table tbody tr:last-child td {
    border-bottom: none;
}

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