:root {
    --navbar-offset: 80px; /* Space for fixed-top navbar; tune if navbar height changes */
    --network-header-height: 120px;
    --network-logo-size: 120px;
    --network-stat-icon-size: 32px;
    --network-card-radius: 0.5rem;
}

/* Theme-aware notes/content box (fixes white-on-white in dark theme) */
.notes-box {
    background: var(--mdb-surface-secondary, rgba(0, 0, 0, 0.05));
    color: var(--mdb-body-color, #212529);
    border: 1px solid var(--mdb-border-color, #dee2e6);
}

/* Base Layout */
body {
    min-width: 320px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Layout containers */
.container-fluid {
    min-width: 320px;
    padding: 0 1rem;
}

.row {
    margin: 0 -0.5rem;
}

/* Column spacing */
.col-lg-2, .col-lg-3,
.col-lg-9, .col-lg-10 {
    padding: 0 0.5rem;
}

/* Card Structure */
.card {
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}

/* Enhanced card pop effect */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover::before {
    opacity: 1;
}

/* Ensure card content is above the overlay */
.card > * {
    position: relative;
    z-index: 2;
}

.card-header {
    padding: 0.5rem var(--mdb-card-spacer-x);
    border-radius: 0;
}

.card-footer {
    padding: var(--mdb-card-spacer-y) var(--mdb-card-spacer-x);
    border-radius: 0;
}

.card-body {
    flex: 1 1 auto;
    padding: var(--mdb-card-spacer-y) var(--mdb-card-spacer-x);
}

/* Card footer utilities */
.card-footer.bg-transparent.border-0 {
    padding-top: 0;
    margin-top: -1rem;
}

.network-description {
    width: 100%;
    min-width: 100%;
}

/* Navbar Layout & Structure - Fixed Top */
.navbar {
    z-index: 1030;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
}

.navbar .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Allow wrapping only on mobile */
@media (max-width: 991.98px) {
    .navbar {
        flex-wrap: wrap;
    }
    
    .navbar .container-fluid {
        flex-wrap: wrap;
    }
}

/* Desktop: navbar menu is always visible, use flex layout */
@media (min-width: 992px) {
    .navbar-collapse {
        flex-basis: auto;
        flex-grow: 1;
        align-items: center;
        display: flex !important;
        justify-content: space-between;
    }
}

/* Mobile: vertical stacked layout with full-width tap targets and visible labels.
   When menu is expanded: no overflow/max-height on collapse (so dropdown isn't bound),
   and navbar becomes position:relative so the whole page scrolls instead of trapping scroll. */
@media (max-width: 991.98px) {
    .navbar-collapse {
        width: 100%;
        max-height: none;
        overflow: visible;
    }

    /* When collapse is open, un-fix navbar so full page (including dropdown) scrolls */
    .navbar:has(.navbar-collapse.show) {
        position: relative;
    }

    .navbar-collapse.show {
        display: flex !important;
        flex-basis: 100%;
        flex-grow: 1;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 1rem 0;
        margin-top: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

    [data-mdb-theme="dark"] .navbar-collapse.show {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    /* Main nav: vertical list with touch-friendly targets */
    .navbar-collapse.show .navbar-nav.me-auto {
        flex-direction: column;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .navbar-collapse.show .navbar-nav.me-auto .nav-item {
        width: 100%;
        border-radius: 0.5rem;
    }

    .navbar-collapse.show .navbar-nav.me-auto .nav-link {
        display: flex;
        align-items: center;
        min-height: 44px;
        padding: 0.75rem 1rem;
        width: 100%;
        border-radius: 0.5rem;
    }

    .navbar-collapse.show .navbar-nav.me-auto .nav-link i {
        flex-shrink: 0;
        width: 1.25em;
        margin-right: 0.5rem;
    }

    /* Right-aligned section: stack vertically with divider above (search, theme, account) */
    .navbar-collapse.show .navbar-nav.align-items-center {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }

    [data-mdb-theme="dark"] .navbar-collapse.show .navbar-nav.align-items-center {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .navbar-collapse.show .navbar-nav.align-items-center .nav-item {
        margin: 0 !important;
    }

    /* Search form full-width on mobile */
    .navbar-collapse.show .navbar-nav .d-flex[role="search"],
    .navbar-collapse.show form.d-flex {
        width: 100%;
    }

    .navbar-collapse.show .navbar-nav .input-group {
        width: 100% !important;
    }

    /* Theme toggle and buttons: comfortable tap targets */
    .navbar-collapse.show .theme-toggle,
    .navbar-collapse.show .navbar-nav .btn {
        min-height: 44px;
        padding: 0.5rem 1rem;
    }

    /* Dropdown toggles (Networks, Channels, etc.): same tap target as regular links */
    .navbar-collapse.show .navbar-nav .nav-link.dropdown-toggle {
        min-height: 44px;
        width: 100%;
        display: flex;
        align-items: center;
    }
}

/* Toggler: show hamburger when closed, X when menu is open */
.navbar-toggler .navbar-toggler-icon-close {
    display: none;
}
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon-open {
    display: none;
}
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon-close {
    display: inline-block;
}

/* Mobile: larger tap target for toggler */
@media (max-width: 991.98px) {
    .navbar-toggler {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    .navbar-toggler i {
        font-size: 1.35rem;
    }
}

.navbar .nav-link {
    transition: all 0.2s ease;
}

/* Standard MDB5 Navbar Styles - Solid Background */
.navbar {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

[data-mdb-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

[data-mdb-theme="dark"] .navbar {
    background: rgba(18, 18, 18, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Animated navbar on scroll - MDB5 navbar-scrolled class */
.navbar.navbar-scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

[data-mdb-theme="light"] .navbar.navbar-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-mdb-theme="dark"] .navbar.navbar-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Navbar Brand */
.navbar-logo {
    max-height: 32px;
    height: 32px;
    transition: transform 0.2s ease;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.05);
}

.navbar-brand-text {
    font-weight: 600;
    color: var(--text-primary) !important;
}

/* Navbar Toggler */
.navbar-toggler {
    border: 0;
    padding: 0.25rem 0.5rem;
}

.navbar-toggler i {
    color: var(--text-primary);
    font-size: 1.25rem;
}

/* Nav Links - Standard MDB5 with theme-aware styling */
.navbar .nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-weight: 500;
}

.navbar .nav-link:hover {
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

/* Main padding for fixed navbar - moved from body to work with flexbox layout.
   body > main and !important ensure this wins in production (CDN/cache load order). */
body > main {
    padding-top: var(--navbar-offset) !important;
    flex: 1 0 auto;
}

/* Mobile: when navbar menu is expanded it's in-flow (position:relative), so no extra top padding on main */
@media (max-width: 991.98px) {
    body:has(.navbar:has(.navbar-collapse.show)) > main {
        padding-top: 0 !important;
    }
}

footer {
    flex-shrink: 0;
    margin-bottom: 0 !important;
}

/* Login modal - next steps notice */
.next-notice {
    background: var(--mdb-surface-bg);
    border-left: 4px solid var(--mdb-primary);
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.next-notice p {
    margin: 0;
    color: var(--mdb-text-secondary);
    font-size: 0.9rem;
}

.next-notice code {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.85em;
    word-break: break-all;
}

/* Footer links and copyright */
.footer-link {
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    position: relative;
}

.footer-link:hover {
    transform: translateX(5px);
    color: var(--mdb-primary) !important;
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

.footer-link i {
    transition: transform 0.3s ease;
}

.footer-link:hover i {
    transform: scale(1.2);
}

.badge-link {
    display: inline-block;
    transition: transform 0.3s ease;
}

.badge-link:hover {
    transform: translateY(-2px);
}

.footer-copyright {
    min-height: auto;
}

.footer-copyright .badge-link img {
    height: 18px;
    width: auto;
    vertical-align: middle;
}

[data-mdb-theme="dark"] .footer-copyright {
    background: rgba(var(--mdb-primary-rgb), 0.05) !important;
}

/* Search Form */
.navbar-search .input-group {
    min-width: 200px;
}

.navbar-search .form-control {
    border-radius: 0.5rem 0 0 0.5rem;
    border-right: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.navbar-search .btn {
    border-radius: 0 0.5rem 0.5rem 0;
    border-left: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Theme Toggle */
.theme-toggle {
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.theme-toggle:hover {
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

.theme-icon {
    font-size: 0.875rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Theme icon colors - ensure visibility in both themes */
[data-mdb-theme="light"] .theme-icon {
    color: rgba(0, 0, 0, 0.87);
    opacity: 0.8;
}

[data-mdb-theme="light"] .theme-toggle:hover .theme-icon {
    opacity: 1;
    color: var(--mdb-primary);
}

[data-mdb-theme="dark"] .theme-icon {
    color: rgba(255, 255, 255, 0.87);
    opacity: 0.8;
}

[data-mdb-theme="dark"] .theme-toggle:hover .theme-icon {
    opacity: 1;
    color: var(--mdb-primary);
}

/* Submit Network button - modern, engaging CTA */
.navbar .btn-submit-network {
    background: linear-gradient(135deg, rgba(var(--mdb-primary-rgb), 0.9), rgba(var(--mdb-primary-rgb), 0.75));
    border: none;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(var(--mdb-primary-rgb), 0.25);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar .btn-submit-network:hover {
    background: linear-gradient(135deg, rgba(var(--mdb-primary-rgb), 1), rgba(var(--mdb-primary-rgb), 0.9));
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--mdb-primary-rgb), 0.35);
}

.navbar .btn-submit-network:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(var(--mdb-primary-rgb), 0.2);
}

/* Navbar right side alignment fixes - prevent shifting in both themes */
.navbar-nav.align-items-center {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 0;
    padding-right: 0;
}

.navbar-nav.align-items-center .nav-item {
    flex-shrink: 0;
    white-space: nowrap;
    display: flex;
    align-items: center;
    margin-left: 0;
    margin-right: 0;
}

[data-mdb-theme="light"] .navbar-search {
    min-width: 200px;
    max-width: 300px;
}

[data-mdb-theme="light"] .navbar-search .input-group {
    width: 100%;
}

[data-mdb-theme="light"] .navbar-search .form-control {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #212529;
    padding: 0.375rem 0.75rem;
}

[data-mdb-theme="light"] .navbar-search .form-control:focus {
    background: #fff;
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--mdb-primary-rgb), 0.25);
}

[data-mdb-theme="light"] .navbar-search .btn {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    border: 1px solid rgba(var(--mdb-primary-rgb), 0.3);
    color: var(--mdb-primary);
    padding: 0.375rem 0.75rem;
    min-width: 40px;
}

[data-mdb-theme="light"] .navbar-search .btn:hover {
    background: rgba(var(--mdb-primary-rgb), 0.2);
    border-color: rgba(var(--mdb-primary-rgb), 0.5);
    color: var(--mdb-link-hover-color);
}

[data-mdb-theme="light"] .nav-action-btn {
    background: var(--mdb-primary);
    color: #fff;
    border: 1px solid var(--mdb-primary);
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

[data-mdb-theme="light"] .nav-action-btn:hover {
    background: var(--mdb-link-hover-color);
    border-color: var(--mdb-link-hover-color);
    color: #fff;
}

/* Dark theme navbar search styles */
[data-mdb-theme="dark"] .navbar-search {
    min-width: 200px;
    max-width: 300px;
}

[data-mdb-theme="dark"] .navbar-search .input-group {
    width: 100%;
}

[data-mdb-theme="dark"] .navbar-search .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    padding: 0.375rem 0.75rem;
}

[data-mdb-theme="dark"] .navbar-search .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--mdb-primary-rgb), 0.25);
}

[data-mdb-theme="dark"] .navbar-search .btn {
    background: rgba(var(--mdb-primary-rgb), 0.2);
    border: 1px solid rgba(var(--mdb-primary-rgb), 0.3);
    color: var(--mdb-primary);
    padding: 0.375rem 0.75rem;
    min-width: 40px;
}

[data-mdb-theme="dark"] .navbar-search .btn:hover {
    background: rgba(var(--mdb-primary-rgb), 0.3);
    border-color: rgba(var(--mdb-primary-rgb), 0.5);
    color: #ffffff;
}

[data-mdb-theme="dark"] .nav-action-btn {
    background: var(--mdb-primary);
    color: #fff;
    border: 1px solid var(--mdb-primary);
    padding: 0.375rem 0.75rem;
    white-space: nowrap;
}

[data-mdb-theme="dark"] .nav-action-btn:hover {
    background: var(--mdb-link-hover-color);
    border-color: var(--mdb-link-hover-color);
    color: #fff;
}

/* Theme switch styling */
.form-check-input[type="checkbox"][role="switch"] {
    cursor: pointer;
}

[data-mdb-theme="light"] .form-check-input[type="checkbox"][role="switch"] {
    background-color: rgba(0, 0, 0, 0.25);
    border-color: rgba(0, 0, 0, 0.25);
}

[data-mdb-theme="light"] .form-check-input[type="checkbox"][role="switch"]:checked {
    background-color: var(--mdb-primary);
    border-color: var(--mdb-primary);
}

[data-mdb-theme="dark"] .form-check-input[type="checkbox"][role="switch"] {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.25);
}

[data-mdb-theme="dark"] .form-check-input[type="checkbox"][role="switch"]:checked {
    background-color: var(--mdb-primary);
    border-color: var(--mdb-primary);
}

[data-mdb-theme="light"] .nav-link-modern {
    color: rgba(0, 0, 0, 0.87);
    padding: 0.5rem;
}

[data-mdb-theme="light"] .nav-link-modern:hover {
    color: var(--mdb-primary);
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

[data-mdb-theme="dark"] .nav-link-modern {
    color: rgba(255, 255, 255, 0.87);
    padding: 0.5rem;
}

[data-mdb-theme="dark"] .nav-link-modern:hover {
    color: var(--mdb-primary);
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

[data-mdb-theme="light"] .nav-icon {
    color: rgba(0, 0, 0, 0.87);
}

[data-mdb-theme="dark"] .nav-icon {
    color: rgba(255, 255, 255, 0.87);
}

[data-mdb-theme="light"] .user-avatar {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-mdb-theme="dark"] .user-avatar {
    border-color: rgba(255, 255, 255, 0.2);
}

/* User Home - statistics cards (theme-aware) */
.user-stat-card {
    background-color: #f8f9fa;
}
[data-mdb-theme="dark"] .user-stat-card {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Search form layout */
.modern-search {
    position: relative;
}

.modern-search .search-button {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 5;
}

/* User Dropdown Structure */
/* User dropdown minimum width - using ID selector */
#userDropdown + .dropdown-menu {
    min-width: 280px;
}

/* Notifications dropdown */
#notificationsDropdown + .dropdown-menu {
    min-width: 320px;
}

/* Notifications List */
#notificationsList {
    max-height: 400px;
    overflow-y: auto;
}

#notificationLoading {
    display: none;
}

/* Navbar User Avatar */
.navbar .user-avatar {
    width: 32px;
    height: 32px;
}

.dropdown-header .user-avatar-lg {
    width: 48px;
    height: 48px;
}

/* Animation utilities */
.animate__faster {
    animation-duration: 200ms !important;
}

/* Object fit utilities */
.object-fit-contain {
    object-fit: contain;
}

/* Badge utilities */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 500;
}

/* ================================================
   Status Badge System - Unified Across All Pages
   ================================================ */

/* Base Status Badge - Default: Circular Icon Badge (24px) for network/channel headers */
.status-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
    border: 2px solid var(--mdb-surface-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Text Badge - Used in network list cards */
.status-badges .status-badge,
.network-list .status-badge {
    width: auto;
    height: auto;
    border-radius: var(--mdb-border-radius);
    font-size: 0.75rem;
    padding: 0.25em 0.5em;
    gap: 0.25rem;
    border: none;
    box-shadow: none;
}

/* Small Badge - Used in search results */
.google-result .status-badge,
.search-container .status-badge {
    display: inline-block;
    width: auto;
    height: auto;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 400;
    font-style: italic;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
    margin-left: 6px;
    cursor: help;
    border: none;
    box-shadow: none;
}

/* Standard Badge - Used in user profiles and IRC link pages */
.edit-profile-page .status-badge,
.profile-section .status-badge,
.user-profile .status-badge {
    width: auto;
    height: auto;
    border-radius: var(--mdb-border-radius);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: none;
    box-shadow: none;
}

/* Status Badge Variants - Colors */
.status-badge.ssl-required {
    background: var(--mdb-danger);
}

.status-badge.ssl-supported {
    background: var(--mdb-success);
}

/* Server-based: full = all visible servers, partial = some */
.status-badge.ssl-full {
    background: var(--mdb-success);
}

.status-badge.ssl-partial {
    background: rgba(25, 135, 84, 0.55);
}

.status-badge.ipv6-full {
    background: var(--mdb-info);
}

.status-badge.ipv6-partial {
    background: rgba(13, 202, 240, 0.55);
}

.status-badge.bot-online {
    background: var(--mdb-success);
}

.status-badge.indexing {
    background: var(--mdb-warning);
}

.status-badge.modes {
    background: var(--mdb-info);
}

.status-badge.disabled {
    background: var(--mdb-secondary);
}

/* Channel-specific: disabled channels use danger color */
.channel-status-badges .status-badge.disabled {
    background: var(--mdb-danger);
}

/* Search Result Status Variants */
.status-archived {
    background-color: #f1f3f4;
    color: #5f6368;
    border: 1px solid #dadce0;
}

[data-mdb-theme="dark"] .status-archived {
    background-color: #3c4043;
    color: #9aa0a6;
    border-color: #5f6368;
}

.status-inactive {
    background-color: #fef7e0;
    color: #b06000;
    border: 1px solid #f9ab00;
}

[data-mdb-theme="dark"] .status-inactive {
    background-color: #5c4a00;
    color: #fdd835;
    border-color: #f9ab00;
}

.status-current {
    background-color: #e8f5e9;
    color: #1e7e34;
    border: 1px solid #34a853;
}

[data-mdb-theme="dark"] .status-current {
    background-color: #1e4620;
    color: #81c784;
    border-color: #34a853;
}

/* ================================================
   Stat Icon System - Unified Across All Pages
   ================================================ */

/* Base Stat Icon - Container for icon */
.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.stat-icon i {
    font-size: 1rem;
}

/* Sidebar stat-icon: 28px */
.sidebar .stat-icon,
.stats-item .stat-icon {
    width: 28px;
    height: 28px;
}

.sidebar .stat-icon i,
.stats-item .stat-icon i {
    font-size: 0.75rem;
}

[data-mdb-theme="dark"] .sidebar .stat-icon,
[data-mdb-theme="dark"] .stats-item .stat-icon {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Channel stat-icon: 40px with background */
.channel-stats-grid .stat-icon {
    background: rgba(255, 255, 255, 0.2);
}

.channel-stats-grid .stat-icon i {
    font-size: 1.25rem;
}

/* Network stat-box: icon styling only (no container) */
.stat-box .stat-icon {
    width: auto;
    height: auto;
    display: block;
    font-size: 1.5rem;
    color: var(--mdb-primary);
    margin-bottom: 0.5rem;
    opacity: 0.8;
    background: none;
    border-radius: 0;
}

.stat-box:hover .stat-icon {
    opacity: 1;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* Forum responsive breakpoints */
@media (max-width: 992px) {
    .forum-container .stat-icon {
        width: 32px;
        height: 32px;
    }
    
    .forum-container .stat-icon i {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .forum-container .stat-icon {
        width: 28px;
        height: 28px;
        margin-right: 0.5rem;
    }
    
    .forum-container .stat-icon i {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .forum-container .stat-icon {
        width: 24px;
        height: 24px;
    }
    
    .forum-container .stat-icon i {
        font-size: 0.625rem;
    }
}

@media (min-width: 1920px) {
    .forum-container .stat-icon {
        width: 48px;
        height: 48px;
    }
    
    .forum-container .stat-icon i {
        font-size: 1.25rem;
    }
}

/* Avatar utilities - consistent sizing across the website */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    overflow: hidden;
}

.avatar-sm {
    width: 20px;
    height: 20px;
}

.avatar-md {
    width: 28px;
    height: 28px;
}

.avatar-lg {
    width: 40px;
    height: 40px;
}

.avatar-xl {
    width: 60px;
    height: 60px;
}

.avatar-2xl {
    width: 80px;
    height: 80px;
}

.avatar-3xl {
    width: 120px;
    height: 120px;
}

/* Ensure all avatars maintain aspect ratio and proper sizing */
.avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
}

/* Avatar fallback icons */
.avatar i {
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.avatar-sm i {
    font-size: 10px;
}

.avatar-md i {
    font-size: 14px;
}

.avatar-lg i {
    font-size: 18px;
}

.avatar-xl i {
    font-size: 24px;
}

.avatar-2xl i {
    font-size: 32px;
}

.avatar-3xl i {
    font-size: 48px;
}

/* Responsive styles */
@media (max-width: 992px) {
    .form-outline {
        margin-bottom: 2.5rem !important;
    }
}

@media (max-width: 768px) {
    .container-fluid {
        padding: 0.5rem !important;
    }
    
    .network-stats {
        gap: 0.35rem;
    }
    
    .stat-value {
        font-size: 0.85rem;
    }
    
    .network-logo-container {
        height: 80px;
    }
}

@media (max-width: 576px) {
    #notificationDropDown + .dropdown-menu {
        position: fixed !important;
        top: 60px !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw;
        max-height: calc(100vh - 60px);
        margin: 0;
        border-radius: 0;
    }
}

/* Custom Scrollbar Structure */
.dropdown-menu::-webkit-scrollbar {
    width: 8px;
}

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

/* Staff Cards Structure */
.staff-card .card-up {
    height: 80px;
}

.staff-card .avatar {
    width: 100px;
    height: 100px;
    margin-top: -50px;
    overflow: hidden;
}

.staff-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-social-links {
    gap: 0.5rem;
}

.staff-social-links .btn-floating {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messaging (private messages) - Glass Effect Styles */
.message-glass-sidebar {
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    background: rgba(26, 31, 37, 0.85);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

[data-mdb-theme="light"] .message-glass-sidebar {
    background: linear-gradient(135deg, rgba(var(--mdb-primary-rgb), 0.9), rgba(var(--mdb-primary-rgb), 0.95));
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.message-item-glass {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0.5rem;
}

.message-item-glass:hover {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateX(4px);
}

[data-mdb-theme="light"] .message-item-glass {
    background: rgba(255, 255, 255, 0.4);
}

[data-mdb-theme="light"] .message-item-glass:hover {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
}

[data-mdb-theme="light"] .message-item-glass.unread {
    background: rgba(59, 113, 202, 0.1);
    border-left: 3px solid var(--mdb-primary);
}

[data-mdb-theme="dark"] .message-item-glass {
    background: rgba(255, 255, 255, 0.03);
}

[data-mdb-theme="dark"] .message-item-glass:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

[data-mdb-theme="dark"] .message-item-glass.unread {
    background: rgba(59, 113, 202, 0.15);
    border-left: 3px solid var(--mdb-primary);
}

.message-bubble-glass {
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 1rem;
}

[data-mdb-theme="light"] .message-bubble-glass.sent {
    background: linear-gradient(135deg, rgba(59, 113, 202, 0.9), rgba(59, 113, 202, 1));
    box-shadow: 0 4px 16px rgba(59, 113, 202, 0.3);
}

[data-mdb-theme="light"] .message-bubble-glass.received {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
}

[data-mdb-theme="dark"] .message-bubble-glass.sent {
    background: linear-gradient(135deg, rgba(59, 113, 202, 0.8), rgba(59, 113, 202, 0.9));
    box-shadow: 0 4px 16px rgba(59, 113, 202, 0.4);
}

[data-mdb-theme="dark"] .message-bubble-glass.received {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Global Glass Effects for Interactive Elements */
.btn:not(.btn-link) {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn:not(.btn-link):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

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

/* Form controls glass effect */
.form-control,
.form-select {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

[data-mdb-theme="light"] .form-control,
[data-mdb-theme="light"] .form-select {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-mdb-theme="light"] .form-control:focus,
[data-mdb-theme="light"] .form-select:focus {
    background: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 4px 16px rgba(31, 38, 135, 0.1);
}

[data-mdb-theme="dark"] .form-control,
[data-mdb-theme="dark"] .form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-mdb-theme="dark"] .form-control:focus,
[data-mdb-theme="dark"] .form-select:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/*
 * MDB Select: hide the native <select> when wrapped by MDB so only the custom trigger is visible.
 */
.select-wrapper select.form-select,
.select-wrapper select[data-mdb-select-init] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    margin: 0;
    border: 0;
}

/*
 * MDB Select: global dark-theme for dropdown. MDB dropdown uses var(--mdb-form-outline-select-dropdown-bg)
 * which defaults to var(--mdb-surface-bg). When the dropdown is portaled to body it can miss theme context;
 * we re-apply the theme variables so all MDB select dropdowns match site theme.
 */
[data-mdb-theme="dark"] .select-dropdown-container .select-dropdown,
[data-mdb-theme="dark"] .select-dropdown-container .select-options-wrapper {
    background-color: var(--mdb-surface-bg);
}
[data-mdb-theme="dark"] .select-dropdown-container .select-option {
    color: var(--mdb-surface-color);
}
[data-mdb-theme="dark"] .select-dropdown-container .select-option.selected {
    background-color: rgba(var(--mdb-primary-rgb), 0.25);
}

/* Alert boxes glass effect */
.alert {
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-radius: 1rem;
}

[data-mdb-theme="light"] .alert {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.3),
        0 4px 16px rgba(31, 38, 135, 0.08);
}

[data-mdb-theme="dark"] .alert {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        inset 0 0 20px rgba(255, 255, 255, 0.05),
        0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Badge glass effect */
.badge {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* List group glass effect */
.list-group {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.list-group-item {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

[data-mdb-theme="light"] .list-group-item {
    background: rgba(255, 255, 255, 0.5);
}

[data-mdb-theme="light"] .list-group-item:hover {
    background: rgba(255, 255, 255, 0.7);
    transform: translateX(4px);
}

[data-mdb-theme="dark"] .list-group-item {
    background: rgba(255, 255, 255, 0.03);
}

[data-mdb-theme="dark"] .list-group-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

/* Utility Classes for Common Inline Styles */
/* Font Sizes */
.fs-075 { font-size: 0.75rem; }
.fs-09 { font-size: 0.9rem; }
.fs-09375 { font-size: 0.9375rem; }
.fs-15 { font-size: 1.5rem; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-90 { opacity: 0.9; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Display */
.d-inline-form { display: inline; }

/* Width/Height */
.w-auto { width: auto; }
.min-w-150 { min-width: 150px; }
.max-h-200 { max-height: 200px; }
.max-h-300 { max-height: 300px; }
.max-h-400 { max-height: 400px; }

/* Info Icon Size */
.info-icon-lg {
    font-size: 1.5rem;
}

/* Muted Icon */
.icon-muted {
    opacity: 0.5; }

/* Scrollable Container */
.scrollable-container {
    overflow-y: auto;
}

/* Calendar Day Indicator */
.calendar-day-indicator {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Logo Preview */
.logo-preview-img {
    max-height: 200px;
}

/* Avatar Sizes */
.avatar-40 {
    width: 40px;
    height: 40px;
    object-fit: cover;
}

/* Card Border Radius Utilities */
.card-radius-1 { border-radius: 1rem; overflow: hidden; }
.card-radius-15 { border-radius: 1.5rem; overflow: hidden; }

/* Card Header Gradients */
.card-header-gradient-primary {
    background: linear-gradient(135deg, var(--mdb-primary), rgba(var(--mdb-primary-rgb), 0.8));
    backdrop-filter: blur(20px);
    border: none;
}

.card-header-gradient-info {
    background: linear-gradient(135deg, rgba(var(--mdb-info-rgb), 0.9), rgba(var(--mdb-info-rgb), 0.7));
    backdrop-filter: blur(20px);
    border: none;
}

.card-header-gradient-success {
    background: linear-gradient(135deg, rgba(var(--mdb-success-rgb), 0.9), rgba(var(--mdb-success-rgb), 0.7));
    backdrop-filter: blur(20px);
    border: none;
}

/* Text Opacity */
.text-opacity-90 { opacity: 0.9; }

/* List Group Item Background */
.list-group-item-success-bg {
    background: rgba(var(--mdb-success-rgb), 0.1);
    border-radius: 0.75rem;
}

/* Kiwi/chat embed and Embedly placeholder (network/channel chat pages) */
.kiwi-noscript-warn {
    text-align: center;
    font-weight: 700;
    padding: 1em;
}

.embedly-css .card .hdr {
    display: none;
}

/* WYSIWYG editor wrapper (partials/wysiwyg_editor.html) */
.wysiwyg-editor-wrapper .wysiwyg-toolbar {
    background-color: var(--surface-secondary);
    border-color: var(--mdb-border-color);
}

[data-mdb-theme="dark"] .wysiwyg-editor-wrapper .wysiwyg-toolbar {
    background-color: var(--surface-secondary);
    border-color: var(--dark-border);
}

.wysiwyg-editor-wrapper textarea[data-mdb-wysiwyg-init] {
    min-height: 200px;
}

/* Homepage (index.html) welcome and cards */
.welcome-banner {
    background: linear-gradient(135deg, rgba(var(--mdb-primary-rgb), 0.05) 0%, rgba(var(--mdb-info-rgb), 0.05) 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.welcome-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--mdb-box-shadow-lg) !important;
}

.transition-all {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.transition-all:hover {
    transform: translateY(-3px);
}

.carousel-inner.rounded-5 {
    overflow: hidden;
}

/* Homepage Featured Network card */
.featured-network-card .featured-network-logo img {
    transition: transform 0.2s ease;
}
.featured-network-card:hover .featured-network-logo img {
    transform: scale(1.03);
}

/* Homepage Explore panel */
.explore-link {
    color: inherit;
    transition: background 0.2s ease, color 0.2s ease;
}
.explore-link:hover {
    background: rgba(var(--mdb-primary-rgb), 0.08);
    color: var(--mdb-primary);
}
.explore-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: rgba(var(--mdb-primary-rgb), 0.1);
    color: var(--mdb-primary);
    font-size: 0.875rem;
    transition: background 0.2s ease, color 0.2s ease;
}
.explore-link:hover .explore-icon {
    background: rgba(var(--mdb-primary-rgb), 0.2);
}