/* 
 * Private Community Group Stylesheet
 * Premium Modern Dark/Glassmorphism Theme
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-input: rgba(15, 23, 42, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-focus: #6366f1;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-secondary: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
    
    --bg-nav: rgba(15, 23, 42, 0.8);
    --bg-footer: rgba(15, 23, 42, 0.9);
    --bg-card-hover: rgba(30, 41, 59, 0.55);
    --bg-comments: rgba(15, 23, 42, 0.3);
    --bg-comment-item: rgba(30, 41, 59, 0.3);
    --bg-table-th: rgba(15, 23, 42, 0.4);
    --fade-gradient: linear-gradient(to bottom, rgba(30, 41, 59, 0) 0%, rgba(30, 41, 59, 0.95) 100%);
}

:root.light-theme {
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: rgba(241, 245, 249, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-focus: #4f46e5;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.15);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --gradient-secondary: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    
    --bg-nav: rgba(255, 255, 255, 0.8);
    --bg-footer: rgba(241, 245, 249, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-comments: rgba(241, 245, 249, 0.7);
    --bg-comment-item: rgba(255, 255, 255, 0.9);
    --bg-table-th: rgba(226, 232, 240, 0.8);
    --fade-gradient: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 100%);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: #818cf8;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    flex: 1;
    padding: 40px 0;
}

/* Glassmorphism Card styling */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Form Styling */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Select Form Controls */
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, #7c3aed 0%, #c084fc 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(51, 65, 85, 0.8);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 6px;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 24px;
    font-size: 15px;
    border-left: 4px solid transparent;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: #34d399;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--danger);
    color: #f87171;
}

.alert-info {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    color: #a5b4fc;
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Unified Navigation */
.main-nav {
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    font-weight: 700;
    font-size: 22px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-logo span {
    font-size: 14px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--accent);
    color: #a5b4fc;
    padding: 2px 8px;
    border-radius: 20px;
    -webkit-text-fill-color: initial;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-item {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
}

.user-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 30px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.user-badge strong {
    color: var(--text-primary);
}

.badge-admin {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Footer Styling */
footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    padding: 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

/* Login/Registration Portal Screen */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 140px);
}

.auth-card {
    width: 100%;
    max-width: 450px;
    border-radius: var(--border-radius-lg);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Dashboard Elements */
.dashboard-grid {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 30px;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-title-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Post Cards */
.post-card {
    margin-bottom: 24px;
    border-radius: var(--border-radius-md);
    background: var(--bg-card);
    transition: all 0.3s ease;
}

.post-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.2);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
}

.post-author-info h4 {
    font-size: 15px;
    color: var(--text-primary);
}

.post-author-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

.tag {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 30px;
    letter-spacing: 0.05em;
}

.tag-general {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.tag-qa {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
}

.tag-official {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    line-height: 1.3;
}

.post-content {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.post-content.collapsible {
    max-height: 250px;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
}

.post-content.collapsible::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--fade-gradient);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.post-content.expanded {
    max-height: none !important;
}

.post-content.expanded::after {
    opacity: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 12px 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.post-content table th, .post-content table td {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-content table th {
    background-color: rgba(255, 255, 255, 0.05);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.post-actions {
    display: flex;
    gap: 16px;
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.action-btn:hover {
    color: var(--text-primary);
}

.action-btn.liked {
    color: #f43f5e;
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.3);
}

.action-btn.liked svg {
    fill: #f43f5e;
    stroke: #f43f5e;
}

/* Comments Section */
.comments-section {
    display: none;
    margin-top: 20px;
    background: var(--bg-comments);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 16px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Comment scrollbar */
.comment-list::-webkit-scrollbar {
    width: 6px;
}
.comment-list::-webkit-scrollbar-track {
    background: transparent;
}
.comment-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.comment-item {
    display: flex;
    gap: 12px;
    background: var(--bg-comment-item);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255,255,255, 0.03);
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.comment-body {
    flex: 1;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-meta strong {
    font-size: 13px;
    color: var(--text-primary);
}

.comment-meta span {
    font-size: 11px;
    color: var(--text-secondary);
}

.comment-text {
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.4;
}

.comment-form {
    display: flex;
    gap: 10px;
}

.comment-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 14px;
}

/* Sidebar Widgets */
.sidebar-widget {
    margin-bottom: 24px;
}

.sidebar-widget h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.widget-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.widget-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.code-badge {
    font-family: monospace;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    color: #a5b4fc;
    font-size: 13px;
}

/* User Management Table */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 15px;
    text-align: left;
}

.custom-table th, .custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.custom-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-table-th);
}

.custom-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge-status-active {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--success);
    color: #34d399;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.badge-status-suspended {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--danger);
    color: #f87171;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Grid Layout for Forms */
.dashboard-actions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* TinyMCE wrapper styling */
.tinymce-wrapper {
    background: var(--bg-input);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.tox-tinymce {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-sm) !important;
}

/* ----------------------------------------------------
   Theme Toggle, Live Search, Notifications, Profiles,
   Saved Posts & Chat Layout Extensions
   ---------------------------------------------------- */

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
}
.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: rotate(15deg);
}
:root.light-theme .theme-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Header Live Search */
.search-container {
    position: relative;
    max-width: 250px;
    width: 100%;
}
.search-input {
    width: 100%;
    padding: 8px 16px;
    padding-left: 36px;
    border-radius: var(--border-radius-lg);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    transition: all 0.3s ease;
}
.search-input:focus {
    border-color: var(--border-focus);
    outline: none;
    box-shadow: 0 0 10px var(--accent-glow);
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}
.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}
.search-result-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13.5px;
    transition: background 0.2s ease;
}
.search-result-item:last-child {
    border-bottom: none;
}
.search-result-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

/* Notifications Bell & Dropdown */
.notification-container {
    position: relative;
}
.notification-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    padding: 8px;
    border-radius: 50%;
}
.notification-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
:root.light-theme .notification-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notification-dropdown {
    position: absolute;
    top: 120%;
    right: 0;
    width: 320px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}
.notification-header strong {
    font-weight: 600;
}
.notification-header a {
    font-size: 12px;
}
.notification-list {
    display: flex;
    flex-direction: column;
}
.notification-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background 0.2s ease;
    text-decoration: none;
}
.notification-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
:root.light-theme .notification-item:hover {
    background: rgba(0, 0, 0, 0.02);
}
.notification-item.unread {
    background: rgba(99, 102, 241, 0.05);
}
.notification-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}
.notification-item-body {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}
.notification-item-time {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Bookmark Action Button */
.action-btn.bookmarked {
    color: var(--warning);
}
.action-btn.bookmarked svg {
    fill: var(--warning);
}

/* User Profile Badges & Avatars */
.avatar-large-container {
    text-align: center;
    margin-bottom: 24px;
}
.avatar-large {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}
.avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.badge-status-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}
.badge-premium {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid transparent;
}
.badge-member {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--border-focus);
    color: var(--accent);
}
.badge-contributor {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}
.badge-veteran {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    color: var(--warning);
}

/* Messaging/Chat System Layout */
.chat-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    height: calc(100vh - 220px);
    min-height: 480px;
}
.chat-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}
.chat-contact-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
}
.chat-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}
.chat-contact-item:hover, .chat-contact-item.active {
    background: rgba(99, 102, 241, 0.08);
}
.chat-contact-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}
.chat-contact-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.chat-contact-info {
    flex: 1;
    overflow: hidden;
}
.chat-contact-info h4 {
    font-size: 13.5px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.chat-contact-info p {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.chat-contact-badge {
    background: var(--danger);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.chat-main {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-main-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-main-header h3 {
    font-size: 16px;
    font-weight: 600;
}
.chat-messages-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(0, 0, 0, 0.05);
}
:root.light-theme .chat-messages-container {
    background: rgba(0, 0, 0, 0.02);
}
.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 65%;
}
.chat-message.message-mine {
    align-self: flex-end;
}
.chat-message.message-other {
    align-self: flex-start;
}
.chat-message-bubble {
    padding: 12px 16px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    line-height: 1.5;
}
.message-mine .chat-message-bubble {
    background: var(--accent);
    color: white;
    border-bottom-right-radius: 2px;
}
.message-other .chat-message-bubble {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 2px;
}
.chat-message-time {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}
.message-mine .chat-message-time {
    align-self: flex-end;
}
.message-other .chat-message-time {
    align-self: flex-start;
}
.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}
.chat-input-form {
    display: flex;
    width: 100%;
    gap: 12px;
}
.chat-input-field {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 12px 20px;
    color: var(--text-primary);
    font-size: 14px;
}
.chat-input-field:focus {
    outline: none;
    border-color: var(--border-focus);
}
.chat-send-btn {
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Password Visibility Toggle */
.password-wrapper {
    position: relative;
}
.password-wrapper .form-control {
    padding-right: 44px;
}
.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}
.password-toggle-btn:hover {
    color: var(--text-primary);
}
.password-toggle-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Mobile menu elements hidden on desktop */
.nav-header-row {
    display: contents;
}
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: background 0.2s ease;
}
.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}
.mobile-menu-toggle svg {
    display: block;
    width: 24px;
    height: 24px;
}
.nav-collapse {
    display: contents;
}

/* Responsive adjustments for mobile devices */
@media (max-width: 768px) {
    /* 1. Navigation Container */
    .nav-container {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        padding: 12px 16px !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .nav-header-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .nav-logo {
        font-size: 19px !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .search-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Collapsible Navigation Panel */
    .nav-collapse {
        display: none !important;
        flex-direction: column !important;
        gap: 16px !important;
        border-top: 1px solid var(--border-color) !important;
        padding-top: 16px !important;
    }
    
    .nav-collapse.active {
        display: flex !important;
    }
    
    .nav-menu {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
        gap: 12px !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
    }
    
    .nav-actions {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 16px !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
        padding-top: 12px !important;
    }

    /* Make user profile avatar round and remove padding/border on mobile */
    .user-badge {
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }
    .user-badge strong,
    .user-badge .badge-admin {
        display: none !important;
    }

    /* 2. Main Content & Headers */
    .main-content {
        padding: 20px 0 !important;
    }
    
    .dashboard-title-area {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
    
    .dashboard-title-area .btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* 3. Messaging/Chat layout */
    .chat-layout {
        grid-template-columns: 1fr !important;
        height: auto !important;
        min-height: 400px !important;
    }
    
    .chat-sidebar {
        max-height: 200px !important;
    }
    
    .chat-messages-container {
        height: 300px !important;
    }
}

@media (max-width: 480px) {
    .notification-dropdown {
        width: calc(100vw - 32px) !important;
        right: -40px !important;
    }
    
    .glass-card {
        padding: 16px !important;
    }
    
    .auth-card {
        padding: 20px !important;
    }
}
