/* ======================================= */
/* GroupGate+ CSS (v5 - Tools Deck Styles Added) */
/* ======================================= */

/* --- Variables & Basic Reset --- */
:root {
    --bg-dark: #1a1d21;
    --bg-card: #2a2d31;
    --bg-input: #3a3d41;
    --bg-header: var(--bg-card);
    --bg-tab-active: var(--bg-dark);
    --bg-tab-inactive: var(--bg-card);
    --text-light: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-placeholder: #777;
    --accent-blue: #39C3FF;
    --accent-blue-darker: #00aeff;
    --accent-green: #4CAF50;
    --accent-orange: #FF9800; /* Premium */
    --danger-red: #ff4d4d;
    --danger-red-hover: rgba(255, 77, 77, 0.1);
    --border-color: #444;
    --border-color-light: #555;
    --font-family: 'Segoe UI', 'Inter', 'Open Sans', sans-serif;
    --border-radius: 8px;
    --border-radius-small: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-light);
    overscroll-behavior: none;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
}

/* --- App Container --- */
#app-container {
    width: 100%;
    max-width: 480px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

/* --- Main Content Area --- */
#main-content {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
    display: flex;
}

/* --- Top Level Pane Styling --- */
.app-pane {
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    background-color: var(--bg-dark);
    overflow: hidden;
}
.app-pane.active-pane { display: flex; }

/* Scrollable content area within panes */
/* Applied to direct children of app-pane OR group-pane */
.app-pane > .pane-content,
.group-pane > .pane-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    height: 100%; /* Needed for flex-grow and overflow */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}


/* --- Headers --- */
.pane-header {
    padding: 12px 15px;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}
.pane-header h1, .pane-header h2 {
    font-size: 1.1rem; font-weight: 600; color: var(--text-light); text-align: center;
    flex-grow: 1; margin: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pane-header button { background: none; border: none; color: var(--accent-blue); font-size: 1rem; cursor: pointer; padding: 5px; line-height: 1; transition: opacity 0.2s ease; }
.pane-header button:hover { opacity: 0.8; }
.pane-header .back-button { font-size: 0.9rem; font-weight: 500; padding: 5px 10px; }
/* Specific cancel button styles */
#create-edit-cg-post-pane .pane-header .back-button,
#create-edit-feed-post-pane .pane-header .back-button { color: var(--text-secondary); }
#create-edit-cg-post-pane .pane-header .back-button:hover,
#create-edit-feed-post-pane .pane-header .back-button:hover { color: var(--text-light); }
.header-action-button { background-color: var(--accent-blue); color: var(--bg-dark); border: none; padding: 6px 15px; border-radius: var(--border-radius-small); font-weight: 600; font-size: 0.9rem; cursor: pointer; transition: background-color 0.2s ease; margin-left: auto; }
.header-action-button:hover { background-color: var(--accent-blue-darker); }
.header-action-button:disabled { background-color: var(--bg-input) !important; color: var(--text-secondary) !important; opacity: 0.6; cursor: not-allowed; }
.pane-header span { min-width: 30px; } /* Spacers */


/* ======================================= */
/* ====== Pane 1: Group List View ====== */
/* ======================================= */
#group-list-view .group-list { list-style: none; padding: 10px; overflow-y: auto; flex-grow: 1; } /* Already scrollable */
.group-card { display: flex; align-items: center; background-color: var(--bg-card); padding: 12px 15px; margin-bottom: 8px; border-radius: var(--border-radius); cursor: pointer; transition: background-color 0.2s ease, box-shadow 0.2s ease; position: relative; overflow: hidden; }
.group-card:hover { background-color: #35383d; box-shadow: 0 0 10px rgba(57, 195, 255, 0.1); }
.group-icon { width: 45px; height: 45px; border-radius: 50%; background-color: var(--bg-input); margin-right: 15px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; font-weight: bold; color: var(--text-light); flex-shrink: 0; }
.group-icon.add-icon { background-color: transparent; border: 2px dashed var(--text-secondary); color: var(--text-secondary); font-weight: normal; }
.group-info { display: flex; flex-direction: column; overflow: hidden; flex-grow: 1; }
.group-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; color: var(--text-light); }
.group-preview { font-size: 0.9rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-group-card .group-name { color: var(--text-secondary); font-weight: normal; }
.group-badge { position: absolute; top: 5px; right: 5px; font-size: 0.7rem; font-weight: bold; padding: 2px 6px; border-radius: var(--border-radius-small); color: var(--bg-dark); }
.group-badge.premium { background-color: var(--accent-orange); }


/* ======================================= */
/* ====== Pane 2: Selected Group View ====== */
/* ======================================= */
.group-tabs { display: flex; background-color: var(--bg-header); border-bottom: 1px solid var(--border-color); flex-shrink: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.group-tabs::-webkit-scrollbar { display: none; }
.group-tab-button { flex-grow: 1; flex-basis: 0; padding: 10px 5px; background-color: var(--bg-tab-inactive); border: none; border-bottom: 3px solid transparent; color: var(--text-secondary); font-size: 1.3rem; font-weight: 500; cursor: pointer; text-align: center; transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease; line-height: 1.2; position: relative; }
.group-tab-button i { display: block; margin: 0 auto; pointer-events: none; }
.group-tab-button:hover:not(.active) { color: var(--text-light); background-color: #35383d; }
.group-tab-button.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); background-color: var(--bg-tab-active); }
.group-pane-container { flex-grow: 1; position: relative; overflow: hidden; }
.group-pane { width: 100%; height: 100%; display: none; flex-direction: column; background-color: var(--bg-dark); overflow: hidden; }
.group-pane.active-group-pane { display: flex; }

/* Chat */
#group-chat-pane { /* structure OK */ }
#message-list { flex-grow: 1; overflow-y: auto; padding: 15px 10px; display: flex; flex-direction: column; }
/* --- Chat Message Bubble Styling --- */
#message-list {
    flex-grow: 1; /* Takes up available space */
    overflow-y: auto; /* Enable scrolling for messages */
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px; /* Add a small gap between messages */
}

.message {
    max-width: 75%; /* Max width of message bubbles */
    padding: 8px 12px;
    border-radius: var(--border-radius);
    margin-bottom: 8px; /* Consistent bottom margin */
    word-wrap: break-word; /* Break long words */
    line-height: 1.4;
    position: relative; /* Needed if using ::before for tails later */
    box-shadow: 0 1px 1px rgba(0,0,0,0.1); /* Subtle shadow */
}

.message .sender-name {
    font-size: 0.8rem;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
    /* Color defined in .self / .other */
}

.message .message-content {
    font-size: 1rem;
    margin: 0; /* Reset default p margin */
    white-space: pre-wrap; /* Respect line breaks */
}

.message .timestamp {
    font-size: 0.7rem; /* Smaller timestamp */
    color: var(--text-secondary);
    display: block; /* On its own line */
    text-align: right;
    margin-top: 5px;
    line-height: 1;
    /* Color adjusted in .self / .other */
}

.message.self {
    background-color: var(--accent-blue);
    color: var(--bg-dark); /* Dark text on accent bg */
    align-self: flex-end; /* Align to the right */
    margin-left: auto; /* Push to right */
    border-bottom-right-radius: 2px; /* Slightly flatten corner */
}
.message.self .timestamp {
     color: rgba(0, 0, 0, 0.7); /* Darker timestamp */
}
/* Self messages don't need sender name displayed */
.message.self .sender-name {
    display: none;
}


.message.other {
    background-color: var(--bg-card);
    color: var(--text-light);
    align-self: flex-start; /* Align to the left */
    margin-right: auto; /* Push to left */
    border-bottom-left-radius: 2px; /* Slightly flatten corner */
}
.message.other .sender-name {
    color: var(--accent-green); /* Example color for sender */
}
.message.other .timestamp {
     color: var(--text-secondary); /* Standard secondary color */
}
/* --- End Chat Message Bubble Styling --- */
/* --- Chat Input Area --- */
.message-input-area {
    display: flex;
    align-items: center; /* Align items vertically */
    padding: 10px 12px; /* Adjust padding */
    background-color: var(--bg-header); /* Match header/tab background */
    border-top: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent shrinking */
    gap: 8px; /* Add gap between input and button */
}

#message-input {
    flex-grow: 1; /* Take available space */
    padding: 10px 15px; /* Good padding */
    border: 1px solid var(--border-color-light); /* Add subtle border */
    border-radius: 18px; /* More rounded pill shape */
    background-color: var(--bg-input);
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.4; /* Ensure text fits vertically */
    /* Remove default margin if any */
    margin: 0;
    /* Transition for focus effect */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    resize: none; /* Prevent manual resize if it's a textarea */
    overflow: hidden; /* Hide overflow */
    max-height: 80px; /* Limit excessive height if it grows */
}
#message-input::placeholder {
    color: var(--text-placeholder);
}
#message-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(57, 195, 255, 0.3); /* Softer focus ring */
}

/* Optional: Auto-growing input (using JS later if needed) */
/* textarea#message-input { height: auto; } */


#send-button {
    flex-shrink: 0; /* Prevent button from shrinking */
    background-color: transparent; /* <<< No background color */
    color: var(--accent-blue); /* <<< Set icon color directly */
    border: none; /* No border */
    border-radius: 0; /* No rounding */
    width: auto; /* Allow natural width */
    height: auto; /* Allow natural height */
    cursor: pointer;
    /* Remove flex centering */
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
    transition: color 0.2s ease, transform 0.1s ease; /* Transition color */
    padding: 5px 8px; /* Add some padding for tap area */
    margin-left: 5px; /* Add margin instead of relying on gap maybe */
    /* Set icon properties */
    font-family: 'Font Awesome 5 Free';
    font-weight: 900; /* Solid icon */
    font-size: 1.8rem; /* <<< Larger icon size */
    line-height: 1;
}

/* Use ::before to inject the icon content */
#send-button::before {
    content: '\f1d8'; /* Unicode for fa-paper-plane */
}

#send-button:hover {
    /* background-color: transparent; /* Ensure no background on hover */ */
    color: var(--accent-blue-darker); /* Darken icon color on hover */
}

#send-button:active {
     transform: scale(0.95); /* Keep slight press effect */
     color: var(--accent-blue-darker); /* Keep color during press */
}

/* ========================================== */
/* ====== Members Pane Styles (ADD THIS) ===== */
/* ========================================== */

/* Ensure the pane-content itself scrolls */
#group-members-pane .pane-content {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    /* Remove any fixed height if previously added */
    height: auto;
}

/* Heading style */
#group-members-pane .pane-content h3 {
    margin-bottom: 20px;
    color: var(--accent-blue);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
#group-members-pane .pane-content h3 span#member-count {
     font-weight: normal;
     color: var(--text-secondary);
     font-size: 1rem;
}

/* Member list reset */
#member-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual member row */
#member-list li {
    display: flex;
    align-items: center; /* Vertically center */
    justify-content: space-between; /* Space out items */
    padding: 14px 5px; /* Vertical padding */
    border-bottom: 1px solid var(--border-color-light);
    transition: background-color 0.15s ease;
}
#member-list li:hover {
    background-color: rgba(255, 255, 255, 0.03);
}
#member-list li:last-child {
    border-bottom: none;
}

/* Member Name */
.member-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-light);
    margin-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1; /* Allow name to take space */
    flex-shrink: 1; /* Allow name to shrink */
}

/* Member Role */
.member-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: capitalize;
    flex-shrink: 0;
    margin-left: 0;
    margin-right: 15px; /* Space before actions */
    text-align: right;
}
.member-role.admin {
    color: var(--accent-orange);
    font-weight: 600;
}

/* Member Actions Area */
.member-actions {
    padding-left: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 15px; /* Space between buttons */
}

/* Action Buttons (Icons) */
.member-actions .small-button {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.3rem; /* Larger icons */
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.1s ease;
}
.member-actions .small-button:hover {
    color: var(--accent-blue);
}
.member-actions .small-button:active {
    transform: scale(0.9);
}

/* Invite Button at Bottom */
#group-members-pane .pane-content .action-button {
    display: block;
    width: 100%;
    margin-top: 25px;
    text-align: center;
    /* Inherits general .action-button styles defined elsewhere */
}
/* ========================================== */
/* ====== End Members Pane Styles        ===== */
/* ========================================== */

/* ================================================== */
/* ====== Invite Member Button Style (Outline) ====== */
/* ================================================== */

#group-members-pane .pane-content button.action-button {
    display: block; /* Keep full width */
    width: 100%;
    margin-top: 25px;
    padding: 11px 20px; /* Adjust padding slightly for border */
    background-color: transparent; /* No background */
    color: var(--accent-blue); /* Text/Icon color matches accent */
    border: 1px solid var(--accent-blue); /* Border matches accent */
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    /* Remove inherited box-shadow if any */
    box-shadow: none;
}

#group-members-pane .pane-content button.action-button:hover {
    background-color: rgba(57, 195, 255, 0.1); /* Subtle accent background on hover */
    color: var(--accent-blue-darker); /* Slightly darker text/border if needed */
    border-color: var(--accent-blue-darker);
}

#group-members-pane .pane-content button.action-button:active {
    background-color: rgba(57, 195, 255, 0.2); /* Slightly more pronounced background on press */
    transform: none; /* Remove press down effect for outline */
}

/* Ensure general :disabled styles apply if needed */
#group-members-pane .pane-content button.action-button:disabled {
     background-color: transparent !important;
     color: var(--text-secondary) !important;
     border-color: var(--text-secondary) !important; /* Grey border when disabled */
     box-shadow: none !important;
     transform: none !important;
     cursor: not-allowed;
     opacity: 0.6;
}
/* ======================================= */
/* ====== Feed Pane Styles (v4) ====== */
/* ======================================= */
#group-feed-pane { display: flex; flex-direction: column; } /* Ensure flex layout */

/* Feed Sub-Navigation */
.feed-sub-nav { display: flex; justify-content: flex-start; /* Align tabs left */ align-items: center; padding: 5px 10px; /* Adjusted padding */ background-color: var(--bg-card); border-bottom: 1px solid var(--border-color); flex-shrink: 0; gap: 5px; /* Space between buttons */ }
.feed-type-button { background: none; border: none; color: var(--text-secondary); font-size: 1.4rem; padding: 8px 12px; /* Larger tap area */ cursor: pointer; transition: color 0.2s ease, border-bottom-color 0.2s ease; border-bottom: 3px solid transparent; line-height: 1; }
.feed-type-button:hover:not(.active) { color: var(--text-light); }
.feed-type-button.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.feed-create-button { /* Create (+) button */ padding: 6px 10px; font-size: 1.1rem; margin-left: auto; background-color: transparent; color: var(--accent-blue); border: 1px solid var(--accent-blue); border-radius: 50%; line-height: 1; cursor: pointer; transition: background-color 0.2s ease; }
.feed-create-button:hover { background-color: rgba(57, 195, 255, 0.1); }

/* Feed Content Area */
.feed-content-container { flex-grow: 1; overflow-y: auto; position: relative; padding: 10px; }
.feed-content { display: none; } /* Hide inactive feed types */
.feed-content.active-feed { display: block; } /* Show active feed type */

/* General Feed Post Styling */
.feed-post { background-color: var(--bg-card); border-radius: var(--border-radius-small); padding: 12px 15px; margin-bottom: 10px; border: 1px solid var(--border-color-light); }
/* Text Post Specifics */
.text-post .post-author-info { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }
.text-post .post-text-content { font-size: 0.95rem; line-height: 1.5; margin-bottom: 10px; white-space: pre-wrap; }
.text-post .post-actions { font-size: 0.8rem; color: var(--text-secondary); margin-top: 10px; }
/* Video Post Placeholder */
.video-post-placeholder { min-height: 300px; display: flex; align-items: center; justify-content: center; font-style: italic; color: var(--text-secondary); border-radius: var(--border-radius-small); background-color: #222; } /* Darker placeholder bg */
/* Audio Post Specifics */
.audio-post .post-author-info { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }
.audio-player-placeholder { background-color: var(--bg-input); padding: 10px 15px; border-radius: var(--border-radius-small); font-size: 0.9rem; color: var(--text-light); display: flex; align-items: center; justify-content: center; min-height: 50px; }

/* --- Pane 2.3: Content (ContentGate) --- */

#group-content-pane .pane-content h3 { /* Heading above list */
    margin-bottom: 15px;
    color: var(--accent-blue);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* Container for the list of post cards */
#content-post-list {
    margin-top: 15px;
    /* No extra styles needed usually, just holds cards */
}

/* Individual ContentGate Post Card */
.content-post-card {
    display: block; /* Ensure it takes full width */
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 12px; /* Consistent spacing */
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1); /* Subtle depth */
}
.content-post-card:hover {
    background-color: #35383d;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Post Card Title */
.content-post-card h4 {
    color: var(--text-light);
    margin: 0 0 8px 0; /* Reset margin, add bottom spacing */
    font-size: 1.15rem; /* Slightly larger title */
    font-weight: 600;
    line-height: 1.3;
}

/* Post Card Excerpt / Preview Text */
.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 12px 0; /* Reset margin, add bottom spacing */
    line-height: 1.5;
    /* Limit lines for consistent card height */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Allow up to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1.5 * 0.9rem); /* Ensure minimum height even if text is short */
}

/* Post Card Meta Information (Author, Date, Visibility) */
.post-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 8px; /* More space between meta items */
    margin-top: 10px; /* Space above meta */
    padding-top: 8px; /* Space above meta */
    border-top: 1px solid var(--border-color-light); /* Separator line */
}

/* Individual meta items */
.post-meta span {
    /* No specific styles needed unless differentiating */
}
/* .post-author { font-weight: 500; } */ /* Optional: slightly bolder author */

/* Visibility Badge */
.post-visibility {
    font-weight: 600; /* Make bolder */
    padding: 3px 8px; /* Adjust padding */
    border-radius: var(--border-radius-small);
    color: var(--bg-dark);
    margin-left: auto; /* Push badge to the right */
    font-size: 0.75rem; /* Slightly larger badge text */
    line-height: 1;
}
/* Keep existing background colors */
.post-visibility.public { background-color: var(--accent-green); }
.post-visibility.members { background-color: var(--accent-blue); }
.post-visibility.paid { background-color: var(--accent-orange); }
.post-visibility.gated { background-color: var(--text-secondary); }
.post-visibility.unknown { background-color: #555; }

/* Create Button */
#group-content-pane .pane-content button#cg-create-post-button {
    /* Use general .action-button styles or customize */
    margin-bottom: 15px; /* Space between button and heading */
}

/* General Action Button Style (Ensure this exists and is styled well) */
.action-button {
    display: inline-block; /* Or 'block' if usually full-width */
    background-color: var(--accent-blue);
    color: var(--bg-dark);
    border: none;
    padding: 10px 20px; /* Adjust as needed */
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.95rem; /* Adjust as needed */
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15); /* Subtle shadow */
    /* Remove any width: 100% if it shouldn't always be full width */
}
.action-button:hover {
    background-color: var(--accent-blue-darker);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.action-button:active {
    transform: scale(0.98); /* Press effect */
    box-shadow: 0 1px 1px rgba(0,0,0,0.15);
}
/* General disabled state was already defined, keep it */
.action-button:disabled { /* ... styles from previous versions ... */ }

/* Inline variant (if used elsewhere) */
.action-button.inline {
    display: inline-block;
    margin-left: 10px;
    margin-top: 0;
    padding: 8px 15px; /* Smaller */
    box-shadow: none; /* Maybe no shadow for inline */
}

/* Style for the Create Content Post Button */
#group-content-pane .pane-content button#cg-create-post-button {
    display: block; /* Make it full width */
    width: 100%;
    margin-bottom: 20px; /* Space below button, above heading */
    /* It will inherit the .action-button base style */
    /* Add any specific overrides here if needed, e.g.: */
    /* font-size: 1rem; */
    /* padding: 12px 20px; */
}


/* =============================================== */
/* ====== Meeting Pane Styles (Simple Cards) ===== */
/* =============================================== */

#meeting-list {
    padding: 0;
    margin: 20px 0 0 0; /* Space above list */
}

/* Simple Meeting Card Style */
.meeting-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 12px;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    /* Simple block layout */
}

.meeting-card h5 { /* Title */
    color: var(--text-light);
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.meeting-card p { /* Date / Access */
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 10px 0; /* Spacing below paragraphs */
    line-height: 1.4;
}
.meeting-card p:last-of-type {
     margin-bottom: 15px; /* More space before button */
}

/* Join Button - Use general Action Button style or a variation */
.meeting-card .join-meeting-button {
    display: block; /* Full width button */
    width: 100%;
    padding: 10px 15px;
    background-color: var(--accent-green); /* Keep green for action */
    color: var(--bg-dark);
    border: none;
    border-radius: var(--border-radius-small); /* Slightly smaller radius maybe */
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
}
.meeting-card .join-meeting-button:hover {
    background-color: #45a049;
}
.meeting-card .join-meeting-button:disabled {
    background-color: var(--bg-input) !important;
    color: var(--text-secondary) !important;
    cursor: not-allowed;
    opacity: 0.6;
}


/* Placeholder for when no meetings exist */
.no-meetings-placeholder {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-style: italic;
    border: 1px dashed var(--border-color-light);
    border-radius: var(--border-radius);
    margin-top: 20px;
}
/* =============================================== */
/* ====== End Meeting Pane Styles              ====== */
/* =============================================== */

/* =============================================== */
/* ====== Settings Pane Styles (REVAMPED)      ====== */
/* =============================================== */

#group-settings-pane .pane-content {
    /* Padding and overflow are handled by the general .pane-content rule */
    /* Add some extra bottom padding if needed */
     padding-bottom: 30px;
}

/* Main Settings Heading */
#group-settings-pane .pane-content > h3 {
    margin-bottom: 25px;
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon and text */
}
#group-settings-pane .pane-content > h3 i {
    color: var(--accent-blue); /* Icon color */
}

/* Settings Group Container */
.settings-group {
    margin-bottom: 30px; /* Space between groups */
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color-light); /* Separator between groups */
}
.settings-group:last-of-type {
    margin-bottom: 0;
    border-bottom: none; /* No border on the last group */
}

/* Section Heading (h4) */
.settings-group h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.settings-group h4 i {
     font-size: 0.85rem; /* Slightly smaller icon */
     color: var(--accent-blue); /* Match text color */
     opacity: 0.8;
}

/* Individual Setting Item Row */
.setting-item {
    display: flex;
    align-items: center; /* Align label and control vertically */
    justify-content: space-between; /* Push label and control apart */
    padding: 10px 0; /* Vertical padding */
    margin-bottom: 5px; /* Small space between items */
    min-height: 45px; /* Consistent row height */
    border-bottom: 1px solid var(--border-color-light); /* Subtle line between items */
}
.settings-group .setting-item:last-child {
    border-bottom: none; /* No line on the last item within a group */
}

/* Setting Label */
.setting-label {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-right: 15px; /* Space between label and control */
    flex-shrink: 1; /* Allow label to shrink if needed */
}

/* Setting Control Area */
.setting-control {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align items to the right */
    gap: 10px; /* Space between elements within control */
    flex-grow: 1; /* Allow control area to take remaining space */
    flex-shrink: 0; /* Prevent control area shrinking too much */
}

/* Specific Control Styling */

/* Basic Inputs & Textareas */
.settings-input,
.settings-textarea,
.settings-select {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color-light);
    color: var(--text-light);
    padding: 8px 12px;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    min-width: 150px; /* Minimum width for inputs/selects */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-textarea {
     min-width: 200px; /* Textarea can be wider */
     resize: vertical; /* Allow vertical resize */
     line-height: 1.4;
}
.settings-input:focus,
.settings-textarea:focus,
.settings-select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(57, 195, 255, 0.2);
}
.settings-input:disabled,
.settings-textarea:disabled,
.settings-select:disabled {
    background-color: var(--bg-card); /* Slightly different disabled bg */
    opacity: 0.7;
    cursor: not-allowed;
}

/* PIN Display and Controls */
.pin-control code#group-join-pin-display {
    background-color: var(--bg-card);
    padding: 6px 10px;
    border-radius: var(--border-radius-small);
    font-family: monospace;
    font-size: 1.1rem;
    color: var(--accent-orange); /* Make PIN stand out */
    border: 1px solid var(--border-color-light);
}
.pin-control .inline-button {
    padding: 5px 8px; /* Smaller padding for icon buttons */
    font-size: 1rem; /* Adjust icon size */
    line-height: 1;
    min-width: auto; /* Allow button to shrink */
}

/* Inline Buttons (Copy, Regen, Save) */
.inline-button {
    background: none;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex; /* Align icon and text if any */
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.inline-button:hover:not(:disabled) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background-color: rgba(57, 195, 255, 0.05);
}
.inline-button:disabled {
     opacity: 0.5;
     cursor: not-allowed;
}
.inline-button i { /* Adjust icon size within inline buttons */
    font-size: 0.9em;
}
.inline-button.copy-button:hover:not(:disabled) { color: var(--accent-green); border-color: var(--accent-green); background-color: rgba(76, 175, 80, 0.05); }
.inline-button.regenerate-button:hover:not(:disabled) { color: var(--accent-orange); border-color: var(--accent-orange); background-color: rgba(255, 152, 0, 0.05); }
.inline-button.save-button:hover:not(:disabled) { color: var(--accent-blue); border-color: var(--accent-blue); background-color: rgba(57, 195, 255, 0.05); }


/* CSS Toggle Switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--bg-input); border: 1px solid var(--border-color-light); transition: .4s; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: var(--text-secondary); transition: .4s; }
.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-green); border-color: var(--accent-green); }
input:focus + .slider { box-shadow: 0 0 1px var(--accent-green); }
input:checked + .slider:before { transform: translateX(20px); background-color: white; }
input:disabled + .slider { cursor: not-allowed; opacity: 0.6; background-color: var(--bg-input) !important; border-color: var(--border-color-light) !important;}
input:disabled + .slider:before { background-color: var(--border-color-light) !important; }

/* Setting Note (NYI etc) */
.setting-note {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-left: 5px; /* Small space from the control */
}

/* Items with Full Width Controls (Buttons) */
.setting-item.full-width-control {
    display: block; /* Override flex */
    padding: 15px 0; /* More padding */
    border-bottom: none; /* Usually no border needed */
}
.setting-item.full-width-control .action-button {
    width: 100%;
    margin-top: 5px; /* Space if there was a label (though often not used here) */
}

/* Outline Action Buttons (used for Manage Whitelist etc) */
.action-button.outline {
    background-color: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
    box-shadow: none;
}
.action-button.outline:hover:not(:disabled) {
    background-color: rgba(57, 195, 255, 0.1);
    color: var(--accent-blue-darker);
    border-color: var(--accent-blue-darker);
}
.action-button.outline:disabled {
     background-color: transparent !important;
     color: var(--text-secondary) !important;
     border-color: var(--text-secondary) !important;
     opacity: 0.6;
     cursor: not-allowed;
}

/* Danger Zone Styling */
.settings-group.danger-zone {
    border-top: 2px solid var(--danger-red); /* Highlight top border */
    border-bottom: none;
    margin-top: 30px;
    padding-top: 15px;
     background-color: rgba(255, 77, 77, 0.03); /* Very subtle red background */
}
.settings-group.danger-zone h4 {
    color: var(--danger-red);
}
.settings-group.danger-zone h4 i {
    color: var(--danger-red);
}

/* Danger Action Buttons */
.action-button.danger {
    background-color: var(--danger-red);
    color: white; /* White text on red */
    border: none;
}
.action-button.danger:hover:not(:disabled) {
    background-color: #d63636; /* Darker red */
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
.action-button.danger:disabled {
    background-color: var(--text-secondary) !important;
    color: var(--bg-dark) !important;
    border: none !important;
    opacity: 0.5;
    cursor: not-allowed;
}
.action-button i { /* Ensure icons in buttons align well */
    margin-right: 8px;
}

/* =============================================== */
/* ====== End Settings Pane Styles (REVAMPED)  ====== */
/* =============================================== */


/* ======================================= */
/* ====== Tools Deck Pane (v5 NEW) ====== */
/* ======================================= */
#tools-view .pane-header h1 { /* Center title since no back button */ text-align: center; }

.tools-grid-container { /* Uses .pane-content for padding/scroll */ }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); /* Responsive grid columns */
    gap: 15px; /* Space between cards */
    padding: 10px 0; /* Add some vertical padding */
}

.tool-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.3s ease;
    position: relative; /* For badges */
    border: 1px solid var(--border-color-light);
    aspect-ratio: 1 / 1; /* Make cards square-ish */
}
.tool-card:hover {
    background-color: #35383d;
    transform: translateY(-2px);
}

.tool-icon {
    font-size: 2.2rem; /* Large icon */
    color: var(--accent-blue); /* Default color */
    margin-bottom: 10px;
    line-height: 1;
}
/* Specific icon colors if desired */
.tool-card[data-tool-id="GroupDrive"] .tool-icon { color: var(--accent-blue); }
.tool-card[data-tool-id="ScramblerNotes"] .tool-icon { color: var(--accent-green); }
.tool-card[data-tool-id="ChildSafetyNet"] .tool-icon { color: var(--accent-orange); }
.tool-card[data-tool-id="CamoSkins"] .tool-icon { color: #bd7aff; } /* Example purple */


.tool-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    /* Prevent text wrapping if needed */
    /* white-space: nowrap; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
    margin-top: auto; /* Push name down slightly */
}

/* Badges for premium */
.tool-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: var(--border-radius-small);
    line-height: 1;
}
.tool-badge.premium {
    background-color: var(--accent-orange);
    color: var(--bg-dark);
}
.tool-badge.premium i {
    font-size: 0.65rem;
    margin-right: 2px;
}

/* Enabled / Disabled states */
.tool-card.disabled {
    opacity: 0.6;
    /* filter: grayscale(60%); */ /* Optional grayscale effect */
    cursor: not-allowed; /* Indicate non-interactive */
}
.tool-card.disabled:hover {
    background-color: var(--bg-card); /* No hover effect */
    transform: none;
}
.tool-card.premium.disabled .tool-icon::after { /* Locked icon overlay */
     content: '\f023'; /* Font Awesome lock icon unicode */
     font-family: 'Font Awesome 5 Free';
     font-weight: 900;
     position: absolute;
     bottom: 5px;
     right: 5px;
     font-size: 0.8rem;
     color: rgba(255, 255, 255, 0.4); /* Semi-transparent white lock */
}


/* Placeholder Tool Panes */
#tool-groupdrive-pane,
#tool-scramblernotes-pane,
#tool-csn-pane,
#tool-camoskins-pane {
     /* Inherit app-pane styles */
}
/* Ensure content area in tool panes scrolls */
#tool-groupdrive-pane .pane-content,
#tool-scramblernotes-pane .pane-content,
#tool-csn-pane .pane-content,
#tool-camoskins-pane .pane-content {
     overflow-y: auto;
     flex-grow: 1;
}


/* ======================================= */
/* ====== Bottom Navigation ====== */
/* ======================================= */
#bottom-nav { display: flex; border-top: 1px solid var(--border-color); background-color: var(--bg-header); flex-shrink: 0; }
.nav-button { flex-grow: 1; flex-basis: 0; padding: 8px 5px; background: none; border: none; color: var(--text-secondary); font-size: 0.75rem; font-weight: 500; cursor: pointer; text-align: center; transition: color 0.2s ease, border-top-color 0.2s ease; border-top: 3px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.nav-button i { font-size: 1.4rem; margin-bottom: 2px; line-height: 1; pointer-events: none; }
.nav-button:disabled { color: #666 !important; cursor: not-allowed; border-top-color: transparent !important; opacity: 0.5; }
.nav-button.active { color: var(--accent-blue); font-weight: 600; border-top-color: var(--accent-blue); }
.nav-button:hover:not(.active):not(:disabled) { color: var(--text-light); }


/* --- Utility Classes --- */
.hidden { display: none !important; }
hr { border: none; border-top: 1px solid var(--border-color); margin: 20px 0; } /* Ensure HR style is present */

/* --- Basic Responsiveness --- */
@media (min-width: 768px) { #app-container { max-width: 480px; box-shadow: 0 0 20px rgba(0,0,0,0.3); } }