/* ==================== CSS CUSTOM PROPERTIES (VARIABLES) ==================== */
:root {
    --primary-color: #bb86fc;
    --primary-hover: #a370fc;
    --background-primary: #121212;
    --background-secondary: #1e1e1e;
    --background-tertiary: #2a2a2a;
    --surface-color: #2e2e2e;
    --text-primary: #e0e0e0;
    --text-secondary: #9e9e9e;
    --text-disabled: #555;
    --border-color: #333;
    --error-color: #cf6679;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --leader-color: #ffd700;
    --scrollbar-thumb: #555;
    --scrollbar-thumb-hover: #777;
    --scrollbar-track: var(--background-secondary);
}

/* ==================== GLOBAL STYLES & OVERRIDES ==================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(135deg, #1a1a2e, #32264a);
    color: var(--text-primary);
    font-family: 'Consolas', 'Aptos Mono', 'Monaco', 'Cascadia Code', monospace;
    height: 100vh;
    overflow: hidden;
}

/* Prevent browser defaults from interfering */
input, button, select, textarea {
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    outline: none;
}

/* ==================== AUTHENTICATION STYLES ==================== */
.auth-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, #203036, #262657);
}

.auth-form {
    background: linear-gradient(300deg, rgb(46, 46, 46), rgb(30, 30, 30));
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.auth-panel {
    display: none;
    flex-direction: column;
    gap: 15px;
}

.auth-panel.active {
    display: flex;
}

.auth-panel h2 {
    text-align: center;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 2px;
    color: var(--primary-color);
	cursor: default;
}

.auth-panel input {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    background-color: var(--background-tertiary);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

.auth-panel input:focus {
    border-color: var(--primary-color);
}

.auth-switch {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
	cursor: default;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
	cursor: pointer;
}

.auth-switch a:hover {
    color: var(--primary-hover);
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.app-logo {
    text-align: center;
    margin-bottom: 30px;
	cursor: default;
}

.app-logo h1 {
    font-size: 32px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: 5px;
	cursor: default;
}

.app-logo p {
    color: var(--text-secondary);
    font-size: 14px;
	cursor: default;
}

.disabled-overlay {
    background-color: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 15px;
    border: 1px solid var(--error-color);
	cursor: default;
}

.disabled-overlay h3 {
    color: var(--error-color);
    margin-bottom: 5px;
	cursor: pointer;
}

/* ==================== GUEST LOGIN DISABLED STYLES ==================== */
#guest-tab {
    color: var(--text-disabled);
    cursor: not-allowed;
    opacity: 0.5;
}

#guest-panel {
    position: relative;
    pointer-events: none; /* Prevents any interaction */
}

#guest-panel .input-with-button {
    opacity: 0.4;
    filter: blur(1px); /* The missing blur effect */
}

#guest-panel p {
    text-align: center;
    font-size: 14px;
    font-weight: 250;
    letter-spacing: 0.75px;
    color: var(--text-secondary);
    margin-bottom: 3px;
	cursor: default;
}

/* ==================== MAIN APP LAYOUT ==================== */
.app-container {
    height: 100vh;
    display: flex;
}

.app-main {
    flex: 1;
    display: flex;
    height: 100vh;
    position: relative;
}

/* ==================== SIDEBAR STYLES ==================== */
.sidebar {
    width: 280px;
    height: 100%;
    background-color: var(--background-secondary);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.sidebar-footer a:hover {
    color: var(--primary-hover);
}

/* Typing indicator for chat buttons */
.recent-chat-item {
    position: relative;
    transition: all 0.3s ease;
}

.recent-chat-item.typing {
    border-right: 3px solid #fff;
    transition: all 0.3s ease;
	background-color: linear-gradient(180deg, #2e2e2e, #1e1e1e);
}



/* ==================== CHAT AREA STYLES ==================== */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--background-primary);
    min-height: 0;
}

.chat-header {
    flex-shrink: 0;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--background-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    color: var(--text-primary);
    margin-bottom: 5px;
}

.app-branding {
	font-weight: 1000;
	font-size: 36px;
	color: #bb86fc;
}

.header-left {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-width: 0;
}

#current-room-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(300deg, #20192b, var(--background-secondary));
}

/* ==================== MESSAGE INPUT & CONTROLS ==================== */
.message-input {
    flex-shrink: 0;
    display: none;
    padding: 15px;
    border-top: 1px solid var(--border-color);
    background-color: var(--background-secondary);
    flex-direction: column;
    gap: 10px;
}

.message-input-typing {
    position: absolute;
    top: -25px;
    left: 15px;
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
    height: 20px;
    transition: all 0.3s ease;
}

.app-container.user-logged-in .message-input {
    display: flex;
}

.message-input .input-with-button {
    display: flex;
    align-items: center;
    background-color: var(--background-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2px;
    transition: border-color 0.3s;
}

.message-input .input-with-button:focus-within {
    border-color: var(--primary-color);
}

.message-input input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    color: var(--text-primary);
}

.message-input button {
    background-color: var(--primary-color);
    color: var(--background-primary);
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    padding: 8px 17px;
    margin-right: 8px;
}

.message-input button:hover {
    background-color: var(--primary-hover);
}

/* Image Preview */
.image-preview {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: var(--background-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 10px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.preview-header span {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 14px;
}

.cancel-btn {
    background: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    transition: all 0.2s;
}

.cancel-btn:hover {
    color: var(--error-color);
    background-color: rgba(207, 102, 121, 0.1);
}

.preview-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
    object-fit: contain;
    background: var(--background-tertiary);
}

.preview-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- Voice Message Button & Player --- */

#record-voice-btn {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0 10px;
    transition: transform 0.2s ease, color 0.2s ease;
}

#record-voice-btn:hover {
    transform: scale(1.1);
}

#record-voice-btn.recording {
    color: #e74c3c;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.voice-player {
    width: 100%;
    height: 36px;
    margin-top: 5px;
}

/* ==================== MESSAGE STYLES ==================== */
.message {
    padding: 12px 15px;
    border-radius: 20px;
    background-color: var(--background-tertiary);
    max-width: 40%;
    word-wrap: break-word;
    position: relative;
}

.message.current-user {
    background-color: #8757c2;
    color: var(--background-primary);
    align-self: flex-end;
}

.message.current-user .username {
    color: rgba(255, 255, 255, 0.7);
    font-weight: bold;
}

.message.current-user .time {
    color: #9e9e9e;
}

.message[data-guest="true"] .username {
    color: var(--text-secondary);
    font-style: italic;
}

.message[data-guest="true"] {
    border-left: 3px solid #757575;
}

.message.is-reply {
    border-left: 5px solid #8757c2;
}

.admin-message {
    border-left: 3px solid var(--primary-color);
    background-color: rgba(187, 134, 252, 0.1);
    box-shadow: 0 0 8px rgba(187, 134, 252, 0.15);
}

.message.leader-message {
    border: 2px solid var(--leader-color);
    background-color: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    border-radius: 20px;
}

.message.leader-message .username {
    color: var(--leader-color);
    font-weight: bold;
}

.message.admin-message .username {
    color: var(--primary-color);
    font-weight: bold;
}

.message:hover .reply-button-container {
    opacity: 1;
    pointer-events: auto;
}

.replied-to-message {
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 5px;
    padding: 5px;
    background-color: rgba(154, 82, 242, 0.1);
    border-radius: 10px;
    border: 1px solid #fff;
}

.reply-button-container {
    position: absolute;
    top: 5px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.reply-button {
    background: none;
    border: 1px solid #555;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.reply-button:hover {
    background-color: #333;
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.reply-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--background-tertiary);
    padding: 8px 12px;
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 12px;
    margin-bottom: 5px;
}

.cancel-reply-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
}

.cancel-reply-btn:hover {
    color: var(--text-primary);
}

.username {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--primary-color);
    font-size: 14px;
}

.text {
    line-height: 1.4;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-break: break-word;
}

.time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
    text-align: right;
}

/* ==================== USER PROFILE STYLES ==================== */
.user-profile {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.user-avatar {
    width: 51px;
    height: 51px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--background-primary);
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.user-name {
    font-size: 16px;
    font-weight: 500;
}

/* Email Verification Icon */
.email-verification-icon {
    position: relative;
    cursor: pointer;
}

.verification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
    color: white;
    transition: transform 0.2s ease;
}

.email-verification-icon:hover .verification-icon {
    transform: scale(1.1);
}

.verification-icon.verified { background-color: var(--success-color); }
.verification-icon.not-verified { background-color: var(--error-color); }

/* Tooltip */
.verification-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    background: var(--background-tertiary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.email-verification-icon:hover .verification-tooltip {
    opacity: 1;
    visibility: visible;
}

.tooltip-content { color: #fff; text-align: center; }
#tooltip-status { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13px; }
.tooltip-email { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; word-break: break-all; }
.tooltip-btn { width: 100%; padding: 6px 10px; background-color: var(--error-color); border-radius: 4px; color: white; font-size: 11px; cursor: pointer; transition: background-color 0.2s ease; }
.tooltip-btn:hover { background-color: #d32f2f; }
.tooltip-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.enable-notification-btn { background-color: #2e2e2e; border-radius: 15px; font-size: 14px; cursor: pointer; transition: background-color 0.2s ease; padding-top: 10px; padding-bottom:10px; }
.enable-notification-btn:hover { background-color: #333; transform: translateY(-1px); }

/* Auth Actions */
.auth-actions { display: flex; align-items: center; gap: 10px; }
.logout-btn {
    background: linear-gradient(135deg, #c0392b, #f52611, #c0392b);
    color: white;
    padding: 4px 6px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 12px;
    flex: 1;
}
.logout-btn:hover { background: #c0392b; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);}
.logout-btn:active { transform: translateY(0); }

/* ==================== COLLAPSIBLE SECTIONS ==================== */
.collapsible-section { border-bottom: 1px solid var(--border-color); }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s;
}
.section-header:hover { background-color: var(--background-tertiary); }
.section-header h3 { color: var(--primary-color); font-size: 16px; margin: 0; }
.section-controls { display: flex; gap: 8px; align-items: center; }
.collapse-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.3s, color 0.3s;
    padding: 2px 6px;
    border-radius: 5px;
}
.collapse-toggle:hover { background-color: rgba(187, 134, 252, 0.1); color: var(--primary-hover); }
.collapse-toggle.collapsed { transform: rotate(-90deg); }
.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 500px;
    opacity: 1;
}
.section-content.collapsed { max-height: 0; opacity: 0; }

.material-symbols-outlined {
	line-height: 0;
	display: block;
}

.call-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
	cursor: pointer;
	border-radius: 15px;
	transition: transform 0.3s, color 0.3s;
}

.call-btn .icon {
	width: 25px;
	height: 25px;
	fill: #bb86fc;
	display: block;
}

.call-btn:hover { background: rgba(187, 134, 252, 0.1); transition: transform 0.3s, color 0.3s; }

/* ==================== RECENT CHATS & ROOMS SECTIONS ==================== */
.recent-chats-list, .room-list {
    padding: 0 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 1000px;
    overflow-y: auto;
}

.recent-chat-item, .room-item {
    padding: 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.recent-chat-item:hover, .room-item:hover { background-color: var(--background-tertiary); }
.room-item.active { background-color: var(--primary-color); color: var(--background-primary); }
.recent-chat-item.active { background-color: var(--primary-color); color: var(--background-primary); }

.chat-info { display: flex; flex-direction: column; flex: 1; }
.chat-name { font-weight: 500; color: white; display: flex; align-items: center; gap: 5px; }
.unread-dot { width: 8px; height: 8px; background: #ff4d6d; border-radius: 50%; margin-left: 8px; }
.unread-dot.hidden { display: none; }
.chat-preview { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.chat-status { display: flex; flex-direction: column; align-items: flex-end; }
.chat-time { font-size: 10px; color: var(--text-secondary); }

#status-indicator {
	align-self: right;
	align-content: right;
	align-items: right;
}

.recent-chat-item.active {
	border: 2px solid #bb86fc;
	transition: all 0.3s ease;
}

.recent-chat-item:hover {
	border: 1px solid #2e2e2e;
	transition: all 0.3s ease;
}

.recent-chat-item.online {
    background: linear-gradient(to right, 
        rgba(76, 175, 80, 0.25) 0%, 
        var(--background-tertiary) 100%);
	transition: all 0.3s ease;
}

.recent-chat-item.offline {
    background-color: var(--background-tertiary);
	transition: all 0.3s ease;
}

.recent-chat-item.typing {
    background: linear-gradient(to right, 
        rgba(76, 175, 80, 0.25) 0%,
		rgba(255, 255, 255, 0.25) 100%); 
    border-right: 5px solid #fff;
	transition: all 0.3s ease;
}

.recent-chat-item.admin:not(.online):not(.typing) {
    background: var(--background-tertiary);
	transition: all 0.3s ease;
}

.recent-chat-item.leader:not(.online):not(.typing) {
	background: var(--background-tertiary);
	transition: all 0.3s ease;
}

.recent-chat-item.admin.online {
    background: linear-gradient(to right, 
        rgba(84, 102, 235, 0.5) 0%,
		var(--background-tertiary) 100%);
	transition: all 0.3s ease;
}

.recent-chat-item.leader.online {
    background: linear-gradient(to right, 
        rgba(255, 215, 0, 0.5) 0%,
		var(--background-tertiary) 100%);
	transition: all 0.3s ease;
}

.recent-chat-item.admin.typing {
    background: linear-gradient(to right, 
		rgba(84, 102, 235, 0.25) 0%,
		rgba(255, 255, 255, 0.25) 100%);
	border-right: 5px solid #fff;
	transition: all 0.3s ease;
}

.recent-chat-item.leader.typing {
    background: linear-gradient(to right,
		rgba(255, 215, 0, 0.25) 0%
		rgba(255, 255, 255, 0.5) 100%);
	border-right: 5px solid #fff;
	transition: all 0.3s ease;
}

.recent-chat-item.admin .chat-name {
    font-weight: 600;
    color: rgba(139, 151, 240, 1);
	transition: all 0.3s ease;
}

.recent-chat-item.leader .chat-name {
    font-weight: 600;
    color: var(--leader-color);
	transition: all 0.3s ease;
}

/* 
 * DR. ZAKIR NAIK BOT STYLING (Purple Theme)
 */

/* The background and border */
.recent-chat-item.bot-contact {
    /* A subtle purple tint background */
    background-color: rgba(187, 134, 252, 0.1); 
    /* A solid purple bar on the left */
}

.recent-chat-item.bot-contact.online {
    background-color: #5c3a86; /* Light purple for preview text */
}

/* Hover effect */
.recent-chat-item.bot-contact.online:hover {
    background-color: rgba(187, 134, 252, 0.25);
}

/* The name text color */
.recent-chat-item.bot-contact .chat-name {
    color: #bb86fc;
    font-weight: 600;
}

/* When the bot is the currently active chat */
.recent-chat-item.bot-contact.active {
    background-color: rgba(187, 134, 252, 0.2);
}

.refresh-btn {
    background: none;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    font-size: 14px;
}
.refresh-btn:hover { background-color: var(--primary-color); color: var(--background-primary); }

/* ==================== ADMIN COMPONENTS ==================== */
.admin-controls { padding: 8px 15px 15px 15px; display: flex; flex-direction: column; gap: 15px; }
.admin-form-group { display: flex; flex-direction: column; gap: 5px; }
.admin-form-group label { color: var(--text-primary); font-size: 14px; }
.admin-textarea {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 14px;
    background-color: var(--background-tertiary);
    color: var(--text-primary);
    resize: vertical;
    min-height: 80px;
}

.admin-user-select-wrapper { position: relative; width: 100%; margin-bottom: 15px; }
.admin-select-container { position: relative; width: 100%; }
#admin-user-select {
    width: 100%;
    padding: 10px 30px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 14px;
    background-color: var(--background-tertiary);
    color: var(--text-primary);
    cursor: pointer;
}
#admin-user-select:focus { border-color: var(--primary-color); }
#refresh-admin-users-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.2s;
    z-index: 10;
}
#refresh-admin-users-btn:hover { background-color: rgba(255, 255, 255, 0.1); }

.admin-user-info {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}
.user-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 5px; }
.info-item { display: flex; flex-direction: column; font-size: 11px; }
.info-label { font-size: 10px; color: var(--text-secondary); margin-bottom: 2px; }

.admin-buttons, .leader-buttons { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-button {
    padding: 8px 15px;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    color: white;
}
.ban-button { background-color: var(--error-color); }
.unban-button { background-color: var(--success-color); }
.grant-button { background-color: #2196F3; }
.revoke-button { background-color: var(--warning-color); }

.admin-notification {
    padding: 10px;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 14px;
}
.admin-notification.success { background-color: rgba(76, 175, 80, 0.2); color: var(--success-color); border: 1px solid var(--success-color); }
.admin-notification.error { background-color: rgba(244, 67, 54, 0.2); color: var(--error-color); border: 1px solid var(--error-color); }

/* Role-based visibility */
.leader-only, .admin-only { display: none; }
body.is-leader .leader-only { display: inline-block; }
body.is-admin .admin-only { display: inline-block; }

/* Leader contacts styling */
.leader-contact {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), rgba(255, 215, 0, 0.05));
    padding-left: 12px;
    margin-left: -3px;
}

.leader-contact .chat-name {
    font-weight: 600;
    color: gold;
}

/* Dark theme support */
body.theme-dark .leader-contact {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.08));
}

body.theme-dark .leader-contact .chat-name {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

/* ==================== MODAL STYLES ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
    background-color: var(--background-secondary);
    margin: 15% auto;
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal-header h3 { color: var(--primary-color); }
.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}
.close-modal:hover { color: var(--text-primary); }
.search-user-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 15px;
    font-size: 14px;
    background-color: var(--background-tertiary);
    color: var(--text-primary);
    margin-bottom: 15px;
}
.search-user-input:focus { border-color: var(--primary-color); }
.search-results { max-height: 200px; overflow-y: auto; }
.search-result-item {
    padding: 10px;
    border-radius: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.search-result-item:hover { background-color: var(--background-tertiary); }
.search-result-name { font-weight: 500; }
.search-result-status { font-size: 12px; color: var(--text-secondary); }
.error-message {
    color: var(--error-color);
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(207, 102, 121, 0.1);
    border: 1px solid rgba(207, 102, 121, 0.3);
}
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 15px; }
.btn { padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.2s ease; }
.btn-secondary { background-color: #616161; color: white; }
.btn-danger { background-color: var(--error-color); color: white; }
.btn:hover { opacity: 0.9; }

/* ==================== PUSH NOTIFICATION SYSTEM STYLING ==================== */
.push-notification-control {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.push-toggle-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.push-toggle-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.push-toggle-btn.subscribed {
    background-color: var(--success-color);
}

.push-status-text {
    color: var(--text-secondary);
    font-size: 12px;
    display: block;
    margin-top: 5px;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .push-notification-control {
        padding: 10px;
    }
    
    .push-toggle-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
}

/* ==================== IN-APP NOTIFICATION SYSTEM STYLING ==================== */
/* Notification Container - CRITICAL: Remove pointer-events: none */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Base Notification Styles */
.notification {
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 16px 20px;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    
    /* --- Animation Properties --- */
    opacity: 0 !important;
    transform: translateX(100%) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    pointer-events: auto;
    cursor: pointer;
}

/* --- Animation State --- */
.notification.show {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

/* --- Notification Icon --- */
.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
    color: white;
}

/* --- Notification Content --- */
.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: #fff;
    font-size: 14px;
}

.notification-message {
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.4;
}

/* --- Close Button --- */
.notification-close {
    background: none;
    border: none;
    color: #9e9e9e;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}


/* ==================== NOTIFICATION TYPE STYLES ==================== */

/* --- Success --- */
.notification.success {
    border-left: 4px solid #4caf50;
}

.notification.success .notification-icon {
    background-color: #4caf50 !important;
}

.notification.success .notification-icon::before {
    content: "✓" !important;
}

/* --- Error --- */
.notification.error {
    border-left: 4px solid #f44336;
}

.notification.error .notification-icon {
    background-color: #f44336 !important;
}

.notification.error .notification-icon::before {
    content: "✕" !important;
}

/* --- Warning --- */
.notification.warning {
    border-left: 4px solid #ff9800;
}

.notification.warning .notification-icon {
    background-color: #ff9800 !important;
}

.notification.warning .notification-icon::before {
    content: "!" !important;
}

/* --- Info --- */
.notification.info {
    border-left: 4px solid #2196f3;
}

.notification.info .notification-icon {
    background-color: #2196f3 !important;
}

.notification.info .notification-icon::before {
    content: "i" !important;
}

/* ==================== BANNED USER STYLES ==================== */
.banned-notification {
    display: none;
    z-index: 1000;
    position: relative;
    color: white;
    padding: 15px;
    margin: 10px;
    border-radius: 15px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
    
    background-image: linear-gradient(45deg, #c0392b, #f52611, #c0392b);
    
    background-size: 400% 400%;
}

#banned-notification.show {
    display: flex !important;
}

.banned-notification.animated-bg {
    animation: rotate-gradient 8s ease infinite;
}

@keyframes rotate-gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.banned-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.banned-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.banned-message h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
}

.banned-message p {
    margin: 5px 0;
    font-size: 14px;
    opacity: 0.9;
}

#ban-reason-text {
    font-weight: bold;
}

.banned-state {
    filter: blur(4px);
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* ==================== SPECIAL COMPONENTS ==================== */
/* Input with Button Inside */
.input-with-button {
    display: flex;
    align-items: center;
    background-color: var(--background-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 2px;
    transition: border-color 0.3s;
}
.input-with-button:focus-within { border-color: var(--primary-color); }
.input-with-button input { flex: 1; }
.input-with-button button {
    background-color: var(--primary-color);
    color: var(--background-primary);
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    padding: 8px 17px;
    margin-right: 8px;
}
.input-with-button button:hover { background-color: var(--primary-hover); }

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.button-loading { cursor: not-allowed; opacity: 0.7; }

/* In-Message Loader */
.messages-loading-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--text-secondary);
}
.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(187, 134, 252, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 15px;
}

/* ==================== SCROLLBAR STYLING ==================== */
/* For Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Apply to specific elements if needed */
.messages, .sidebar, .recent-chats-list, .search-results, .chat-search-results, .section-content, .admin-tab-content {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* ==================== MOBILE RESPONSIVENESS ==================== */
@media (max-width: 768px) {
    .sidebar { 
        width: 200px; 
    }
    .user-avatar { 
        display: none; 
    }
    .app-branding { 
        display: none; 
    }
}

@media (max-width: 480px) {
    .app-main { 
        flex-direction: column; 
    }
    
    .mobile-menu-toggle {
        display: flex;
        justify-content: center;
        align-items: center;
        position: fixed;
        top: 15px;
        right: 15px; /* Changed from left to right */
        left: auto;   /* Reset left property */
        z-index: 1001;
        background-color: var(--primary-color);
        color: var(--background-primary);
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 24px;
        cursor: pointer;
        transition: all 0.3s;
        box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    
    .mobile-menu-toggle:hover { 
        background-color: var(--primary-hover); 
    }

    /* Keep sidebar exactly as it was */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .chat-area {
        width: 100%;
        margin-left: 0;
    }
    
    .message { 
        max-width: 90%; 
    }
    
    .section-header { 
        padding: 12px 15px; 
    }
    
    .section-header h3 { 
        font-size: 14px; 
    }
    
    .recent-chats-list, .room-list, .user-list { 
        padding: 0 15px 10px; 
    }
    
    .user-name, .logout-btn { 
        align-content: right-side; 
        margin-right: 5px; 
    }
}