/* Modern Network Pages - Based on Original Design */

/* Modern Network Header - Based on Original Design */
.network-header-modern {
    background: linear-gradient(135deg, var(--mdb-primary) 0%, var(--mdb-secondary) 100%);
    border-bottom: 1px solid var(--mdb-border-color);
    padding: 2rem 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.network-header-modern::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%);
    pointer-events: none;
}

.network-header-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--mdb-card-border-radius);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

/* Theme-specific header styling */
[data-mdb-theme="light"] .network-header-modern {
    background: linear-gradient(135deg, var(--mdb-primary) 0%, var(--mdb-secondary) 100%);
}

[data-mdb-theme="dark"] .network-header-modern {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

[data-mdb-theme="light"] .network-header-card {
    background: rgba(255, 255, 255, 0.95);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-mdb-theme="dark"] .network-header-card {
    background: rgba(0, 0, 0, 0.4);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.network-header-card:hover {
    box-shadow: var(--mdb-box-shadow-3);
}

/* Network Logo Section */
.network-logo-section {
    text-align: center;
    position: relative;
}

.network-logo {
    width: 160px;
    height: 160px;
    border-radius: 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.network-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.network-logo-placeholder {
    width: 160px;
    height: 160px;
    border-radius: 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: var(--mdb-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.network-logo-placeholder i {
    font-size: 3rem;
    color: #fff;
}

.network-status-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Status badge styles moved to style.css - using .status-badge-icon variant */

/* Network Info Section */
.network-info-section {
    padding: 0 1rem;
}

.network-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--mdb-text-primary);
    text-align: center;
}

/* Social Media Links */
.network-social-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--mdb-surface-secondary);
    border: 2px solid var(--mdb-border-color);
    color: var(--mdb-text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: white;
}

.social-btn.twitter:hover {
    background: #1DA1F2;
    border-color: #1DA1F2;
}

.social-btn.facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
}

.social-btn.github:hover {
    background: #333;
    border-color: #333;
}

/* Default website button hover */
.social-btn:not(.twitter):not(.facebook):not(.github):hover {
    background: var(--mdb-primary);
    border-color: var(--mdb-primary);
}

.network-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.detail-item i {
    width: 16px;
    text-align: center;
    color: var(--mdb-primary);
    flex-shrink: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--mdb-text-secondary);
    min-width: 100px;
    flex-shrink: 0;
}

.detail-value {
    color: var(--mdb-text-primary);
    font-weight: 500;
    flex: 1;
}

/* Connection Code Styling */
.connection-code {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--mdb-surface-secondary);
    border: 1px solid var(--mdb-border-color);
    color: var(--mdb-text-primary);
}

.connection-code.ssl-required {
    background: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.3);
    color: #dc3545;
}

.connection-code.ssl-supported {
    background: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.3);
    color: #198754;
}

.ssl-note {
    color: var(--mdb-text-muted);
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Channel Link Styling */
.channel-link {
    color: var(--mdb-primary);
    text-decoration: none;
    font-weight: 600;
}

.channel-link:hover {
    color: var(--mdb-primary-dark);
    text-decoration: underline;
}

.channel-count {
    color: var(--mdb-text-muted);
    font-weight: 400;
}

/* Network Stats Section */
.network-stats-section {
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--mdb-surface-secondary);
    border: 1px solid var(--mdb-border-color);
    border-radius: var(--mdb-card-border-radius);
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.stat-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--mdb-box-shadow-2);
}

/* Stat icon styles moved to style.css */

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--mdb-text-primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--mdb-text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-max {
    font-size: 0.7rem;
    color: var(--mdb-text-muted);
    margin-top: 0.25rem;
}

/* Glassmorphism Network Navigation Bar */
.network-navigation-glassy {
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    margin-top: 2rem;
}

/* Theme-specific glassmorphism navigation */
[data-mdb-theme="light"] .network-navigation-glassy {
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

[data-mdb-theme="dark"] .network-navigation-glassy {
    background: rgba(17, 25, 40, 0.75);
    border-top: 1px solid rgba(255, 255, 255, 0.125);
    border-bottom: 1px solid rgba(255, 255, 255, 0.125);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.network-nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0;
    width: 100%;
}

.navbar-collapse {
    display: flex !important;
    justify-content: center;
    width: 100%;
}

.network-nav-list {
    display: flex !important;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    justify-content: space-evenly;
    align-items: center;
    width: 100%;
    max-width: 1000px;
}

.network-nav-list .nav-item {
    position: relative;
}

.network-nav-list .nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--mdb-text-primary);
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    overflow: hidden;
    background: transparent;
    border: none;
    white-space: nowrap;
}

/* Theme-specific nav link styling */
[data-mdb-theme="light"] .network-nav-list .nav-link {
    color: #555;
}

[data-mdb-theme="dark"] .network-nav-list .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

.network-nav-list .nav-link:hover {
    color: var(--mdb-primary);
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

[data-mdb-theme="light"] .network-nav-list .nav-link:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--mdb-primary);
}

[data-mdb-theme="dark"] .network-nav-list .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--mdb-primary);
}

/* Modern active state */
.network-nav-list .nav-link.active {
    color: var(--mdb-primary);
    background: rgba(255, 255, 255, 0.4);
    font-weight: 600;
    position: relative;
}

.network-nav-list .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--mdb-primary);
    border-radius: 2px 2px 0 0;
}

[data-mdb-theme="light"] .network-nav-list .nav-link.active {
    background: rgba(0, 0, 0, 0.08);
}

[data-mdb-theme="dark"] .network-nav-list .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
}

.network-nav-list .nav-link i {
    font-size: 1rem;
}

.network-nav-list .nav-link span {
    font-size: 0.9rem;
}

/* Mobile Navigation */
.navbar-toggler {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: var(--mdb-text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

[data-mdb-theme="light"] .navbar-toggler {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-mdb-theme="dark"] .navbar-toggler {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

[data-mdb-theme="light"] .navbar-toggler:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-mdb-theme="dark"] .navbar-toggler:hover {
    background: rgba(255, 255, 255, 0.15);
}

.navbar-toggler i:last-child {
    transition: transform 0.3s ease;
}

.navbar-toggler[aria-expanded="true"] i:last-child {
    transform: rotate(180deg);
}

/* Content Area */
.network-content {
    padding: 2rem 0;
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    padding: 1rem 0.75rem 0.75rem 0.75rem; /* Increased bottom padding to prevent cutoff */
    min-height: 180px; /* Increased min-height to accommodate axes and prevent overlapping */
    height: auto; /* Allow height to adjust */
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem; /* More margin to prevent overlapping */
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

.chart-container h6 {
    margin-bottom: 0.75rem !important; /* Ensure header spacing */
    font-size: 0.875rem;
    font-weight: 600;
}

.chart-container .d-flex {
    margin-bottom: 0.75rem !important; /* Spacing between stats and chart */
}

.chart-container:hover {
    transform: scale(1.01); /* Reduced scale to prevent layout shift */
}

.chart-container canvas {
    width: 100% !important;
    min-height: 180px !important; /* Increased min-height to prevent cutoff */
    height: auto !important; /* Allow height to adjust */
    margin-top: 0.5rem; /* Additional spacing from stats above */
}

/* Chart Divider */
.chart-divider {
    margin: 2rem 0;
    border-color: var(--mdb-border-color);
    opacity: 0.3;
}

/* GitHub-style avatar list */
.avatar-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem;
}

.avatar-link {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.avatar-link:hover {
    transform: translateY(-2px);
    z-index: 10;
}

.avatar-32 {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--mdb-border-color);
    transition: all 0.3s ease;
}

.avatar-link:hover .avatar-32 {
    border-color: var(--mdb-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.admin-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--mdb-primary);
    color: #fff;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--mdb-surface-color);
}

.avatar-link.admin-owner .admin-badge {
    background: var(--mdb-warning);
}

.avatar-link.admin-staff .admin-badge {
    background: var(--mdb-info);
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .network-header-card {
        padding: 1.5rem;
    }
    
    .network-title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .network-logo,
    .network-logo-placeholder {
        width: 120px;
        height: 120px;
        border-radius: 0.75rem;
    }
    
    .network-logo-placeholder i {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .stat-box {
        padding: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        text-align: left;
    }
    
    .detail-label {
        min-width: auto;
    }
    
    .network-nav-list {
        flex-direction: column;
        gap: 0.25rem;
        width: 100%;
    }
    
    .network-nav-list .nav-link {
        justify-content: flex-start;
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .network-header-modern {
        padding: 1rem 0;
    }
    
    .network-header-card {
        padding: 1rem;
    }
    
    .network-title {
        font-size: 1.75rem;
    }
    
    .network-logo,
    .network-logo-placeholder {
        width: 100px;
        height: 100px;
        border-radius: 0.5rem;
    }
    
    .network-logo-placeholder i {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-box {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .chart-container {
        min-height: 160px;
        padding: 1rem 0.5rem 0.75rem 0.5rem;
        margin-bottom: 1.25rem;
    }
    
    .chart-container canvas {
        min-height: 160px !important;
        height: auto !important;
        margin-top: 0.5rem;
    }
    
    .chart-divider {
        margin: 1.5rem 0;
    }
    
    .detail-item {
        font-size: 0.85rem;
    }
    
    .connection-code {
        font-size: 0.8rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 575.98px) {
    .network-header-card {
        padding: 0.75rem;
    }
    
    .network-title {
        font-size: 1.5rem;
    }
    
    .network-logo,
    .network-logo-placeholder {
        width: 80px;
        height: 80px;
        border-radius: 0.5rem;
    }
    
    .network-logo-placeholder i {
        font-size: 1.75rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .stat-box {
        padding: 0.5rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .chart-container {
        min-height: 140px;
        padding: 0.875rem 0.5rem 0.75rem 0.5rem;
        margin-bottom: 1rem;
    }
    
    .chart-container canvas {
        min-height: 140px !important;
        height: auto !important;
        margin-top: 0.5rem;
    }
    
    .detail-item {
        font-size: 0.8rem;
    }
    
    .connection-code {
        font-size: 0.75rem;
        padding: 0.15rem 0.3rem;
    }
}
/* Admin styles moved to static/css/admin.css */

/* ================================================
   Network List - Cascading Cards
   ================================================ */

/* Cascading Card Animation */
.cascading-card {
    opacity: 0;
    transform: translateY(20px);
    animation: cascadeIn 0.6s ease-out forwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes cascadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays using CSS nth-child - works on .col > .cascading-card */
.row > .col:nth-child(1) > .cascading-card { animation-delay: 0.05s; }
.row > .col:nth-child(2) > .cascading-card { animation-delay: 0.1s; }
.row > .col:nth-child(3) > .cascading-card { animation-delay: 0.15s; }
.row > .col:nth-child(4) > .cascading-card { animation-delay: 0.2s; }
.row > .col:nth-child(5) > .cascading-card { animation-delay: 0.25s; }
.row > .col:nth-child(6) > .cascading-card { animation-delay: 0.3s; }
.row > .col:nth-child(7) > .cascading-card { animation-delay: 0.35s; }
.row > .col:nth-child(8) > .cascading-card { animation-delay: 0.4s; }
.row > .col:nth-child(9) > .cascading-card { animation-delay: 0.45s; }
.row > .col:nth-child(10) > .cascading-card { animation-delay: 0.5s; }
.row > .col:nth-child(11) > .cascading-card { animation-delay: 0.55s; }
.row > .col:nth-child(12) > .cascading-card { animation-delay: 0.6s; }

/* Hover Effect */
.cascading-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.2) !important;
}

[data-mdb-theme="dark"] .cascading-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5) !important;
}

/* Hero Header with Logo or Name */
.card-header-cascading {
    position: relative;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.1) 0%, rgba(33, 150, 243, 0.05) 100%);
    border-bottom: 1px solid var(--mdb-border-color);
    overflow: hidden;
    padding: 1rem;
}

[data-mdb-theme="dark"] .card-header-cascading {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.15) 0%, rgba(33, 150, 243, 0.08) 100%);
}

/* Network Logo */
.network-card-logo {
    max-width: 100%;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.5rem;
}

/* Network Name Header (when no logo) */
.network-card-name-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.network-card-name-header i {
    font-size: 3rem;
    color: var(--mdb-primary);
    opacity: 0.7;
}

.network-card-name-header span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

/* Rank Badge */
.rank-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.35em 0.65em;
}

/* Country Flag Badge */
.country-flag-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.country-flag-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Status Badges Container */
.status-badges {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

/* Network Tags */
.network-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-tag {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
}

.badge-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Network Stats */
.network-stats {
    padding: 0.75rem;
    background: rgba(var(--mdb-primary-rgb), 0.05);
    border-radius: 0.5rem;
    border: 1px solid rgba(var(--mdb-primary-rgb), 0.1);
}

[data-mdb-theme="dark"] .network-stats {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.2);
}

.stat-item {
    flex: 1;
}

.stat-item i {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

.stat-item .small {
    font-size: 0.7rem;
    line-height: 1.2;
}

.stat-item .fw-bold {
    font-size: 1rem;
    line-height: 1.2;
}

/* Description styling */
.cascading-card .card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Card Footer */
.cascading-card .card-footer {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cascading-card {
        min-height: auto;
    }
}

@media (max-width: 576px) {
    .card-header-cascading {
        height: 140px;
    }
    
    .network-card-logo {
        max-height: 100px;
    }
    
    .network-card-name-header i {
        font-size: 2.5rem;
    }
    
    .network-card-name-header span {
        font-size: 1.1rem;
    }
}

/* ================================================
   Network Servers
   ================================================ */

.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.server-card {
    border-radius: 0.5rem;
    transition: transform 0.2s ease-in-out;
}

.server-card:hover {
    transform: translateY(-2px);
}

.server-name a {
    text-decoration: none;
    font-size: 0.95rem;
}

.server-status {
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.server-status.online {
    color: #198754;
}

.server-status.offline {
    color: #dc3545;
}

.server-stats {
    display: flex;
    gap: 1rem;
}

.server-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.server-stat i {
    font-size: 0.9rem;
    color: #666;
}

.stat-details {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    background: rgba(var(--mdb-primary-rgb), 0.04);
    border: 1px solid var(--mdb-border-color);
    border-radius: 0.5rem;
    color: var(--mdb-text-secondary);
}

[data-mdb-theme="dark"] .empty-state {
    background: rgba(var(--mdb-primary-rgb), 0.08);
}

.empty-state h4 {
    color: var(--mdb-text-primary);
    font-weight: 600;
}

.empty-state p {
    color: var(--mdb-text-secondary);
}

/* ========== Network subpages: servers, channels, news, history, server (single) ========== */

/* Shared: Page header (servers, channels, news) */
.network-content .page-header {
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--mdb-border-color);
}

.network-content .page-header h2 {
    font-weight: 600;
    color: var(--mdb-text-primary);
    font-size: 1.5rem;
}

/* Shared: Pagination */
.network-content .pagination {
    gap: 0.25rem;
}

.network-content .pagination .page-item .page-link {
    border-radius: 0.5rem;
    border: 1px solid var(--mdb-border-color);
    color: var(--mdb-text-primary);
    transition: all 0.2s ease;
    font-weight: 500;
}

.network-content .pagination .page-item .page-link:hover {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    border-color: var(--mdb-primary);
    color: var(--mdb-primary);
    transform: translateY(-2px);
}

.network-content .pagination .page-item.active .page-link {
    background: var(--mdb-primary);
    border-color: var(--mdb-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(var(--mdb-primary-rgb), 0.3);
}

.network-content .pagination .page-item.disabled .page-link {
    opacity: 0.5;
}

/* ----- Servers list ----- */
.servers-card {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--mdb-border-color);
}

.servers-list {
    display: flex;
    flex-direction: column;
}

.server-item {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--mdb-border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}

.server-item:last-child {
    border-bottom: none;
}

.server-item:hover:not(.never-indexed) {
    background: rgba(var(--mdb-primary-rgb), 0.05);
    text-decoration: none;
    color: inherit;
}

[data-mdb-theme="dark"] .server-item:hover:not(.never-indexed) {
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

.server-item.never-indexed {
    cursor: not-allowed;
    opacity: 0.8;
}

.server-item.never-indexed:hover {
    background: transparent;
}

.server-status-indicator {
    flex-shrink: 0;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.status-dot i {
    font-size: 0.75rem;
}

.status-online {
    color: #14a44d;
}

.status-online::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #14a44d;
    opacity: 0.2;
    animation: pulse-online 2s infinite;
}

.status-offline {
    color: var(--mdb-text-muted);
}

@keyframes pulse-online {
    0%, 100% { transform: scale(1); opacity: 0.2; }
    50% { transform: scale(1.5); opacity: 0; }
}

.server-info {
    flex: 1;
    min-width: 0;
}

.server-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.server-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.server-icon {
    color: var(--mdb-primary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.server-name {
    font-weight: 600;
    color: var(--mdb-text-primary);
    font-size: 1.1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    background: rgba(var(--mdb-primary-rgb), 0.1);
    color: var(--mdb-text-primary);
    font-size: 0.875rem;
    white-space: nowrap;
}

.stat-badge i {
    color: var(--mdb-primary);
}

.version-badge {
    max-width: 150px;
}

.version-badge span {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.server-meta {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--mdb-text-muted);
    margin-top: 0.25rem;
}

.server-meta i {
    font-size: 0.75rem;
}

.server-action {
    flex-shrink: 0;
    color: var(--mdb-text-muted);
    margin-left: 1rem;
    transition: transform 0.2s ease;
}

.server-item:hover .server-action {
    transform: translateX(4px);
    color: var(--mdb-primary);
}

.empty-state-wrapper {
    padding: 4rem 2rem;
    text-align: center;
}

.admin-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.admin-empty-state i {
    color: var(--mdb-text-muted);
}

/* ----- Channels list ----- */
.channels-card {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--mdb-border-color);
}

.channels-list {
    display: flex;
    flex-direction: column;
}

.channel-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--mdb-border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
}

.channel-item:last-child {
    border-bottom: none;
}

.channel-item:hover {
    background: rgba(var(--mdb-primary-rgb), 0.05);
    transform: translateX(4px);
}

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

.channel-rank {
    flex-shrink: 0;
    width: 60px;
    display: flex;
    justify-content: center;
}

.rank-badge {
    width: 50px;
    height: 50px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.channel-item:hover .rank-badge {
    transform: scale(1.1);
}

.rank-badge.rank-top {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #fff;
}

.rank-badge.rank-high {
    background: linear-gradient(135deg, #C0C0C0 0%, #A9A9A9 100%);
    color: #fff;
}

.rank-badge.rank-normal {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    color: var(--mdb-primary);
}

[data-mdb-theme="dark"] .rank-badge.rank-normal {
    background: rgba(var(--mdb-primary-rgb), 0.2);
}

.channel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.channel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.channel-name-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.channel-icon {
    color: var(--mdb-primary);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.channel-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--mdb-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.user-count {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: rgba(var(--mdb-primary-rgb), 0.1);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--mdb-primary);
}

[data-mdb-theme="dark"] .user-count {
    background: rgba(var(--mdb-primary-rgb), 0.2);
}

.channel-topic {
    font-size: 0.9rem;
    color: var(--mdb-text-muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

.channel-arrow {
    flex-shrink: 0;
    color: var(--mdb-text-muted);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0.5;
    margin-top: 0.15rem;
}

.channel-item:hover .channel-arrow {
    color: var(--mdb-primary);
    transform: translateX(4px);
    opacity: 1;
}

/* ----- News ----- */
.feed-buttons-compact {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
}

.feed-btn-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1px solid var(--mdb-border-color);
    background: var(--mdb-surface-bg);
    color: var(--mdb-text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.feed-btn-compact:hover {
    background: var(--mdb-primary);
    border-color: var(--mdb-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--mdb-primary-rgb), 0.3);
}

.feed-btn-compact.feed-rss:hover {
    background: #ff6600;
    border-color: #ff6600;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.feed-btn-compact.feed-atom:hover {
    background: #ff9900;
    border-color: #ff9900;
    box-shadow: 0 2px 8px rgba(255, 153, 0, 0.3);
}

.news-article-card {
    border-radius: 1rem;
    border: 1px solid var(--mdb-border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.news-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
}

[data-mdb-theme="dark"] .news-article-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4) !important;
}

.article-header {
    border-bottom: 1px solid var(--mdb-border-color);
    padding-bottom: 1rem;
}

.article-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.article-title-link {
    color: var(--mdb-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title-link:hover {
    color: var(--mdb-primary);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--mdb-text-muted);
}

.meta-item i {
    font-size: 1rem;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mdb-border-color);
}

.author-name {
    font-weight: 600;
    color: var(--mdb-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-name:hover {
    color: var(--mdb-primary);
}

.article-preview {
    position: relative;
    max-height: 300px;
    overflow: hidden;
    margin: 1.5rem 0;
    line-height: 1.7;
    color: var(--mdb-text-primary);
}

.article-preview p {
    margin-bottom: 1rem;
}

.preview-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    pointer-events: none;
}

[data-mdb-theme="light"] .preview-fade {
    background: linear-gradient(to bottom, transparent, rgba(var(--mdb-surface-rgb), 0.9), rgba(var(--mdb-surface-rgb), 1));
}

[data-mdb-theme="dark"] .preview-fade {
    background: linear-gradient(to bottom, transparent, rgba(var(--mdb-surface-rgb), 0.9), rgba(var(--mdb-surface-rgb), 1));
}

.article-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--mdb-border-color);
}

.article-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.article-footer .btn:hover {
    transform: translateX(4px);
}

/* ----- Network history timeline ----- */
.timeline-container {
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--mdb-primary) 0%, var(--mdb-info) 50%, var(--mdb-success) 100%);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item-left {
    justify-content: flex-end;
    text-align: right;
}

.timeline-item-left .timeline-content {
    margin-right: calc(50% + 2rem);
}

.timeline-item-right {
    justify-content: flex-start;
}

.timeline-item-right .timeline-content {
    margin-left: calc(50% + 2rem);
}

.timeline-icon {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mdb-primary), var(--mdb-info));
    border: 4px solid var(--mdb-surface-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-icon {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.timeline-content {
    background: var(--mdb-surface-bg);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--mdb-border-color);
    transition: all 0.3s ease;
    max-width: 45%;
    width: 100%;
}

.timeline-content:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--mdb-text-primary);
}

.timeline-date {
    font-size: 0.875rem;
    color: var(--mdb-text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-item-right .timeline-date {
    justify-content: flex-start;
}

.timeline-item-left .timeline-date {
    justify-content: flex-end;
}

.timeline-description {
    color: var(--mdb-text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-meta {
    font-size: 0.8rem;
    color: var(--mdb-text-muted);
    padding-top: 0.75rem;
    border-top: 1px solid var(--mdb-border-color);
}

.timeline-actions {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--mdb-border-color);
}

#addEventForm .form-label {
    font-weight: 500;
    margin-bottom: 0.75rem;
}

#addEventForm textarea {
    min-height: 120px;
    resize: vertical;
}

@media (max-width: 768px) {
    .timeline-line { left: 2rem; }
    .timeline-item-left,
    .timeline-item-right { justify-content: flex-start; text-align: left; }
    .timeline-item-left .timeline-content,
    .timeline-item-right .timeline-content {
        margin-left: 4.5rem;
        margin-right: 0;
        max-width: calc(100% - 4.5rem);
    }
    .timeline-icon { left: 2rem; }
    .timeline-item-left .timeline-date { justify-content: flex-start; }
}

.timeline-container .empty-state,
.network-content .empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: var(--mdb-text-secondary);
}

.timeline-container .empty-state i,
.network-content .empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* ----- Single server page: MOTD, chart, capabilities, modal ----- */
.motd,
.admin-info {
    font-family: 'Courier New', 'Consolas', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    padding: 1.5rem;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 0 0 var(--mdb-card-border-radius) var(--mdb-card-border-radius);
}

[data-mdb-theme="light"] .motd,
[data-mdb-theme="light"] .admin-info {
    background: #1e1e1e;
    color: #d4d4d4;
}

[data-mdb-theme="dark"] .motd,
[data-mdb-theme="dark"] .admin-info {
    background: #0d1117;
    color: #c9d1d9;
}

.chart-container {
    position: relative;
    padding: 0.5rem;
    height: 250px;
    max-height: 250px;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    max-height: 250px;
}

.capabs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

@media (min-width: 576px) {
    .capabs-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

.capab-item {
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--mdb-border-color);
    border-radius: calc(var(--mdb-border-radius) * 0.75);
    background: var(--mdb-surface-secondary);
    transition: all 0.2s ease;
    cursor: help;
}

.capab-item:hover {
    background: rgba(var(--mdb-primary-rgb), 0.05);
    border-color: var(--mdb-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.capab-value {
    font-size: 0.8125rem;
    color: var(--mdb-text-primary);
    display: flex;
    align-items: center;
    line-height: 1.3;
}

.capab-value strong {
    font-weight: 600;
}

.capab-value-with-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.capab-key {
    font-size: 0.8125rem;
    color: var(--mdb-text-primary);
    line-height: 1.3;
}

.capab-key strong {
    font-weight: 600;
}

.capab-value-content {
    width: 100%;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.capab-value-content code {
    display: block;
    background: var(--mdb-surface-bg);
    padding: 0.375rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', 'Consolas', 'Monaco', monospace;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-all;
    overflow-wrap: anywhere;
    max-width: 100%;
    overflow-x: auto;
    margin-top: 0.25rem;
}

.server-features {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: var(--mdb-border-radius);
    background: var(--mdb-surface-secondary);
    border: 1px solid var(--mdb-border-color);
    color: var(--mdb-text-muted);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.feature-badge.active {
    background: rgba(var(--mdb-success-rgb), 0.1);
    border-color: var(--mdb-success);
    color: var(--mdb-success);
}

.feature-badge i {
    font-size: 0.875rem;
}

#modalUpdateServerInfo .markdown-editor-wrapper {
    width: 100%;
}

/* Smaller markdown toolbar inside the modal */
#modalUpdateServerInfo .markdown-editor-toolbar {
    padding: 0.2rem 0.35rem;
    min-height: auto;
}

#modalUpdateServerInfo .markdown-editor-toolbar .btn-group {
    margin-bottom: 0.15rem !important;
}

#modalUpdateServerInfo .markdown-editor-toolbar .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

#modalUpdateServerInfo .markdown-editor-toolbar .btn i {
    font-size: 0.75rem;
}

/* Theme-aware editor in modal: light background in light theme so it doesn't clash */
#modalUpdateServerInfo .markdown-editor {
    --md-editor-bg: #f8f9fa;
    --md-editor-border: #dee2e6;
    --md-editor-text: #212529;
}

#modalUpdateServerInfo .markdown-editor .ace_editor,
#modalUpdateServerInfo .markdown-editor .ace_scroller {
    background: #f8f9fa !important;
}

[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor,
.dark #modalUpdateServerInfo .markdown-editor {
    --md-editor-bg: var(--mdb-surface-bg, #1a1a1a);
    --md-editor-border: var(--mdb-border-color, #333);
    --md-editor-text: var(--mdb-body-color, #fff);
}

[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_scroller,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_content,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_layer,
.dark #modalUpdateServerInfo .markdown-editor .ace_editor,
.dark #modalUpdateServerInfo .markdown-editor .ace_scroller,
.dark #modalUpdateServerInfo .markdown-editor .ace_content,
.dark #modalUpdateServerInfo .markdown-editor .ace_layer {
    background: #1a1a1a !important;
}

[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_text-layer,
.dark #modalUpdateServerInfo .markdown-editor .ace_text-layer {
    background: transparent !important;
}
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_text-layer,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_line,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_gutter,
[data-mdb-theme="dark"] #modalUpdateServerInfo .markdown-editor .ace_gutter-cell,
.dark #modalUpdateServerInfo .markdown-editor .ace_editor,
.dark #modalUpdateServerInfo .markdown-editor .ace_text-layer,
.dark #modalUpdateServerInfo .markdown-editor .ace_line,
.dark #modalUpdateServerInfo .markdown-editor .ace_gutter,
.dark #modalUpdateServerInfo .markdown-editor .ace_gutter-cell {
    color: #e4e4e7 !important;
}

.admin-info-box {
    background: rgba(var(--mdb-info-rgb), 0.1);
    border: 1px solid rgba(var(--mdb-info-rgb), 0.3);
    border-radius: var(--mdb-border-radius);
    padding: 1rem;
    color: var(--mdb-text-primary);
}

.admin-info-box i {
    color: var(--mdb-info);
}

/* Shared modal styling for network subpages (theme.css handles header/title) */
.network-content .modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.network-content .modal-body {
    padding: 2rem;
}

.network-content .modal-body .alert {
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.network-content .modal-body .form-outline {
    margin-bottom: 1.5rem;
}

.network-content .modal-body .form-control {
    border-radius: 0.5rem;
    border: 2px solid var(--mdb-border-color);
    transition: all 0.3s ease;
}

.network-content .modal-body .form-control:focus {
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--mdb-primary-rgb), 0.25);
}

.network-content .modal-body .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.network-content .modal-body .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.network-content .modal-body .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Edit Network Description modal (main page): header/title and markdown editor styling */
#modalEditNetworkDescription .modal-header,
#modalEditNetworkDescription .modal-title {
    color: var(--mdb-text-primary) !important;
}
[data-mdb-theme="light"] #modalEditNetworkDescription .modal-header,
[data-mdb-theme="light"] #modalEditNetworkDescription .modal-title {
    color: #212529 !important;
}
[data-mdb-theme="dark"] #modalEditNetworkDescription .modal-header,
[data-mdb-theme="dark"] #modalEditNetworkDescription .modal-title,
.dark #modalEditNetworkDescription .modal-header,
.dark #modalEditNetworkDescription .modal-title {
    color: rgba(255, 255, 255, 0.95) !important;
}

#modalEditNetworkDescription .markdown-editor-wrapper {
    width: 100%;
}
#modalEditNetworkDescription .markdown-editor-toolbar {
    padding: 0.2rem 0.35rem;
    min-height: auto;
}
#modalEditNetworkDescription .markdown-editor-toolbar .btn-group {
    margin-bottom: 0.15rem !important;
}
#modalEditNetworkDescription .markdown-editor-toolbar .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
}
#modalEditNetworkDescription .markdown-editor-toolbar .btn i {
    font-size: 0.75rem;
}
#modalEditNetworkDescription .markdown-editor {
    --md-editor-bg: #f8f9fa;
    --md-editor-border: #dee2e6;
    --md-editor-text: #212529;
}
#modalEditNetworkDescription .markdown-editor .ace_editor,
#modalEditNetworkDescription .markdown-editor .ace_scroller {
    background: #f8f9fa !important;
}
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor,
.dark #modalEditNetworkDescription .markdown-editor {
    --md-editor-bg: var(--mdb-surface-bg, #1a1a1a);
    --md-editor-border: var(--mdb-border-color, #333);
    --md-editor-text: var(--mdb-body-color, #fff);
}
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_scroller,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_content,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_layer,
.dark #modalEditNetworkDescription .markdown-editor .ace_editor,
.dark #modalEditNetworkDescription .markdown-editor .ace_scroller,
.dark #modalEditNetworkDescription .markdown-editor .ace_content,
.dark #modalEditNetworkDescription .markdown-editor .ace_layer {
    background: #1a1a1a !important;
}
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_text-layer,
.dark #modalEditNetworkDescription .markdown-editor .ace_text-layer {
    background: transparent !important;
}
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_text-layer,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_line,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_gutter,
[data-mdb-theme="dark"] #modalEditNetworkDescription .markdown-editor .ace_gutter-cell,
.dark #modalEditNetworkDescription .markdown-editor .ace_editor,
.dark #modalEditNetworkDescription .markdown-editor .ace_text-layer,
.dark #modalEditNetworkDescription .markdown-editor .ace_line,
.dark #modalEditNetworkDescription .markdown-editor .ace_gutter,
.dark #modalEditNetworkDescription .markdown-editor .ace_gutter-cell {
    color: #e4e4e7 !important;
}

/* Edit News Article modal: shrunk toolbar and dark theme (match other modals) */
#modalUpdateNewsArticle .markdown-editor-wrapper {
    width: 100%;
}
#modalUpdateNewsArticle .markdown-editor-toolbar {
    padding: 0.2rem 0.35rem;
    min-height: auto;
}
#modalUpdateNewsArticle .markdown-editor-toolbar .btn-group {
    margin-bottom: 0.15rem !important;
}
#modalUpdateNewsArticle .markdown-editor-toolbar .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
}
#modalUpdateNewsArticle .markdown-editor-toolbar .btn i {
    font-size: 0.75rem;
}
#modalUpdateNewsArticle .markdown-editor {
    --md-editor-bg: #f8f9fa;
    --md-editor-border: #dee2e6;
    --md-editor-text: #212529;
}
#modalUpdateNewsArticle .markdown-editor .ace_editor,
#modalUpdateNewsArticle .markdown-editor .ace_scroller {
    background: #f8f9fa !important;
}
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor,
.dark #modalUpdateNewsArticle .markdown-editor {
    --md-editor-bg: var(--mdb-surface-bg, #1a1a1a);
    --md-editor-border: var(--mdb-border-color, #333);
    --md-editor-text: var(--mdb-body-color, #fff);
}
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_scroller,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_content,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_layer,
.dark #modalUpdateNewsArticle .markdown-editor .ace_editor,
.dark #modalUpdateNewsArticle .markdown-editor .ace_scroller,
.dark #modalUpdateNewsArticle .markdown-editor .ace_content,
.dark #modalUpdateNewsArticle .markdown-editor .ace_layer {
    background: #1a1a1a !important;
}
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_text-layer,
.dark #modalUpdateNewsArticle .markdown-editor .ace_text-layer {
    background: transparent !important;
}
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_text-layer,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_line,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_gutter,
[data-mdb-theme="dark"] #modalUpdateNewsArticle .markdown-editor .ace_gutter-cell,
.dark #modalUpdateNewsArticle .markdown-editor .ace_editor,
.dark #modalUpdateNewsArticle .markdown-editor .ace_text-layer,
.dark #modalUpdateNewsArticle .markdown-editor .ace_line,
.dark #modalUpdateNewsArticle .markdown-editor .ace_gutter,
.dark #modalUpdateNewsArticle .markdown-editor .ace_gutter-cell {
    color: #e4e4e7 !important;
}

/* Add News Article modal: shrunk toolbar and dark theme (same as modalUpdateNewsArticle) */
#modalAddNewsArticle .markdown-editor-wrapper {
    width: 100%;
}
#modalAddNewsArticle .markdown-editor-toolbar {
    padding: 0.2rem 0.35rem;
    min-height: auto;
}
#modalAddNewsArticle .markdown-editor-toolbar .btn-group {
    margin-bottom: 0.15rem !important;
}
#modalAddNewsArticle .markdown-editor-toolbar .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
    line-height: 1.2;
}
#modalAddNewsArticle .markdown-editor-toolbar .btn i {
    font-size: 0.75rem;
}
#modalAddNewsArticle .markdown-editor {
    --md-editor-bg: #f8f9fa;
    --md-editor-border: #dee2e6;
    --md-editor-text: #212529;
}
#modalAddNewsArticle .markdown-editor .ace_editor,
#modalAddNewsArticle .markdown-editor .ace_scroller {
    background: #f8f9fa !important;
}
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor,
.dark #modalAddNewsArticle .markdown-editor {
    --md-editor-bg: var(--mdb-surface-bg, #1a1a1a);
    --md-editor-border: var(--mdb-border-color, #333);
    --md-editor-text: var(--mdb-body-color, #fff);
}
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_scroller,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_content,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_layer,
.dark #modalAddNewsArticle .markdown-editor .ace_editor,
.dark #modalAddNewsArticle .markdown-editor .ace_scroller,
.dark #modalAddNewsArticle .markdown-editor .ace_content,
.dark #modalAddNewsArticle .markdown-editor .ace_layer {
    background: #1a1a1a !important;
}
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_text-layer,
.dark #modalAddNewsArticle .markdown-editor .ace_text-layer {
    background: transparent !important;
}
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_editor,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_text-layer,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_line,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_gutter,
[data-mdb-theme="dark"] #modalAddNewsArticle .markdown-editor .ace_gutter-cell,
.dark #modalAddNewsArticle .markdown-editor .ace_editor,
.dark #modalAddNewsArticle .markdown-editor .ace_text-layer,
.dark #modalAddNewsArticle .markdown-editor .ace_line,
.dark #modalAddNewsArticle .markdown-editor .ace_gutter,
.dark #modalAddNewsArticle .markdown-editor .ace_gutter-cell {
    color: #e4e4e7 !important;
}

/* Responsive: servers, channels, news */
@media (max-width: 991.98px) {
    .network-content .page-header h2 { font-size: 1.5rem; }
    .server-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .server-stats { width: 100%; flex-wrap: wrap; }
    .version-badge { max-width: 100%; }
    .article-title { font-size: 1.5rem; }
}

@media (max-width: 767.98px) {
    .channel-rank { width: 50px; }
    .rank-badge { width: 45px; height: 45px; font-size: 0.9rem; }
    .channel-name { font-size: 1rem; }
    .channel-stats { width: 100%; }
    .article-title { font-size: 1.25rem; }
    .article-preview { max-height: 250px; }
}

@media (max-width: 575.98px) {
    .server-item { padding: 1rem; }
    .server-name { font-size: 1rem; }
    .stat-badge { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
    .channel-item { gap: 0.75rem; padding: 0.875rem; }
    .channel-rank { width: 45px; }
    .rank-badge { width: 40px; height: 40px; font-size: 0.85rem; }
    .channel-header { flex-direction: column; align-items: flex-start; }
    .user-count { font-size: 0.85rem; padding: 0.25rem 0.5rem; }
    .channel-arrow { display: none; }
    .news-article-card .card-body { padding: 1.5rem !important; }
    .article-meta { font-size: 0.8rem; }
    .author-avatar { width: 28px; height: 28px; }
}

/* ========== Network news article page (network/news_article.html) ========== */
/* Article Page Header */
.article-page-header {
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--mdb-border-color);
}

.article-page-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mdb-text-primary);
}

/* Article Page Meta */
.article-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--mdb-text-muted);
}

.meta-item i {
    font-size: 1.1rem;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--mdb-border-color);
}

.author-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--mdb-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-name:hover {
    color: var(--mdb-primary);
}

/* Article Actions */
.article-actions .btn-group .btn {
    font-weight: 500;
    transition: all 0.3s ease;
}

.article-actions .btn-group .btn:hover {
    transform: translateY(-2px);
}

/* News Article Header Image (blog-style) */
.news-article-header-image {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--mdb-border-color);
}

.news-article-header-image img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

/* Article Content Card */
.article-content-card {
    border-radius: 1rem;
    border: 1px solid var(--mdb-border-color);
}

/* Article Content Styling */
.article-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--mdb-text-primary);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--mdb-text-primary);
}

.article-content h1 { font-size: 2rem; }
.article-content h2 { font-size: 1.75rem; }
.article-content h3 { font-size: 1.5rem; }
.article-content h4 { font-size: 1.25rem; }
.article-content h5 { font-size: 1.125rem; }
.article-content h6 { font-size: 1rem; }

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 1.5rem 0;
}

.article-content a {
    color: var(--mdb-primary);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.article-content a:hover {
    opacity: 0.8;
}

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--mdb-primary);
    background: rgba(var(--mdb-primary-rgb), 0.1);
    border-radius: 0.5rem;
}

.article-content pre {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

[data-mdb-theme="dark"] .article-content pre {
    background: rgba(255, 255, 255, 0.05);
}

.article-content code {
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    background: rgba(0, 0, 0, 0.05);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

[data-mdb-theme="dark"] .article-content code {
    background: rgba(255, 255, 255, 0.1);
}

.article-content pre code {
    padding: 0;
    background: transparent;
}

.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.article-content table th,
.article-content table td {
    padding: 0.75rem;
    border: 1px solid var(--mdb-border-color);
}

.article-content table th {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    font-weight: 600;
}

/* Modal Styling */
.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

[data-mdb-theme="light"] .modal-content {
    background: rgba(255, 255, 255, 0.95);
}

[data-mdb-theme="dark"] .modal-content {
    background: rgba(30, 35, 45, 0.95);
}

.modal-body {
    padding: 2rem;
}

.modal-body .alert {
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.modal-body .form-outline {
    margin-bottom: 1.5rem;
}

.modal-body .form-control {
    border-radius: 0.5rem;
    border: 2px solid var(--mdb-border-color);
    transition: all 0.3s ease;
}

.modal-body .form-control:focus {
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--mdb-primary-rgb), 0.25);
}

.modal-body .form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.modal-body .btn {
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.modal-body .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Comments Section */
.comments-section {
    border-radius: 1rem;
    border: 1px solid var(--mdb-border-color);
}

.comments-section .card-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--mdb-border-color);
}

.comments-section .card-header h4 {
    font-weight: 600;
    color: var(--mdb-text-primary);
}

/* Comment Form */
.comment-form-wrapper {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--mdb-border-color);
}

.comment-avatar img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 2px solid var(--mdb-border-color);
}

.comment-form textarea {
    border-radius: 0.5rem;
    border: 2px solid var(--mdb-border-color);
    transition: all 0.3s ease;
}

.comment-form textarea:focus {
    border-color: var(--mdb-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--mdb-primary-rgb), 0.25);
}

.char-count {
    font-weight: 600;
    color: var(--mdb-primary);
}

/* Comments List - More Compact */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.comment-item {
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: rgba(var(--mdb-primary-rgb), 0.02);
    border: 1px solid var(--mdb-border-color);
    transition: all 0.3s ease;
}

.comment-item:hover {
    background: rgba(var(--mdb-primary-rgb), 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-mdb-theme="dark"] .comment-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.comment-item.comment-hidden {
    opacity: 0.6;
    background: rgba(255, 193, 7, 0.1);
}

.comment-item .comment-avatar img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border: 2px solid var(--mdb-border-color);
}

/* Comment Header - More Compact */
.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--mdb-text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.comment-author:hover {
    color: var(--mdb-primary);
}

.comment-time {
    font-size: 0.8rem;
    color: var(--mdb-text-muted);
}

/* Comment Text - More Compact */
.comment-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--mdb-text-primary);
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

/* Comment Actions */
.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-actions .btn-text {
    padding: 0.25rem 0.5rem;
    color: var(--mdb-text-muted);
    transition: all 0.2s ease;
}

.comment-actions .btn-text:hover {
    color: var(--mdb-primary);
    background: rgba(var(--mdb-primary-rgb), 0.1);
}

/* Vote Group */
.vote-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(var(--mdb-surface-rgb), 0.5);
    border-radius: 0.375rem;
    border: 1px solid var(--mdb-border-color);
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem;
    background: transparent;
    border: none;
    transition: all 0.2s ease;
}

.vote-btn:hover:not(:disabled) {
    transform: scale(1.2);
    color: var(--mdb-primary);
}

.vote-score {
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 1.5rem;
    text-align: center;
    color: var(--mdb-text-primary);
}

.vote-score.vote-success {
    animation: voteSuccess 0.3s ease;
}

.vote-btn.voted {
    color: var(--mdb-primary) !important;
}

.vote-btn.vote-up-btn.voted {
    color: #14a44d !important; /* success green */
}

.vote-btn.vote-down-btn.voted {
    color: #dc4c64 !important; /* danger red */
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@keyframes voteSuccess {
    0% { 
        transform: scale(1);
        color: var(--mdb-text-primary);
    }
    50% { 
        transform: scale(1.3);
        color: var(--mdb-primary);
    }
    100% { 
        transform: scale(1);
        color: var(--mdb-text-primary);
    }
}

/* Reply Indicator */
.reply-indicator {
    padding: 0.5rem;
    background: rgba(var(--mdb-info-rgb), 0.1);
    border-left: 3px solid var(--mdb-info);
    border-radius: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

/* Reply Form */
.reply-form-container {
    padding: 1rem;
    background: rgba(var(--mdb-primary-rgb), 0.03);
    border-left: 3px solid var(--mdb-primary);
    border-radius: 0.5rem;
}

[data-mdb-theme="dark"] .reply-form-container {
    background: rgba(var(--mdb-primary-rgb), 0.08);
}

.reply-form textarea {
    border-radius: 0.5rem;
}

/* Emoji Picker */
.emoji-picker-dropdown {
    min-width: 320px;
    max-width: 360px;
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}

.emoji-picker {
    padding: 0.5rem;
}

.emoji-category {
    margin-bottom: 1rem;
}

.emoji-category:last-child {
    margin-bottom: 0;
}

.emoji-category-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mdb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.25rem;
    border-bottom: 1px solid var(--mdb-border-color);
    margin-bottom: 0.5rem;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
}

.emoji-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    padding: 0.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
}

.emoji-btn:hover {
    background: rgba(var(--mdb-primary-rgb), 0.1);
    border-color: var(--mdb-primary);
    transform: scale(1.2);
}

.emoji-btn:active {
    transform: scale(1.1);
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .article-page-title {
        font-size: 2rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h1 { font-size: 1.75rem; }
    .article-content h2 { font-size: 1.5rem; }
    .article-content h3 { font-size: 1.25rem; }
}

@media (max-width: 767.98px) {
    .article-page-title {
        font-size: 1.75rem;
    }
    
    .article-page-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .article-actions {
        width: 100%;
    }
    
    .article-actions .btn-group {
        width: 100%;
        display: flex;
    }
    
    .article-actions .btn-group .btn {
        flex: 1;
    }
    
    .comment-item .comment-avatar img {
        width: 36px;
        height: 36px;
    }
    
    .comment-avatar img {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 575.98px) {
    .article-page-title {
        font-size: 1.5rem;
    }
    
    .article-content-card .card-body {
        padding: 1.5rem !important;
    }
    
    .article-page-meta {
        font-size: 0.85rem;
    }
    
    .author-avatar {
        width: 32px;
        height: 32px;
    }
    
    .article-content {
        font-size: 0.95rem;
    }
    
    .comment-item {
        padding: 1rem;
    }
    
    .comment-avatar {
        display: none;
    }
    
    .comment-header {
        font-size: 0.9rem;
    }
    
    .comment-text {
        font-size: 0.9rem;
    }
    
    /* Mobile emoji picker adjustments */
    .emoji-picker-dropdown {
        min-width: 280px;
        max-width: 300px;
    }
    
    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .emoji-btn {
        padding: 0.375rem;
        font-size: 1.25rem;
    }
}

/* Martor editor styling handled by martor.bootstrap.mdb5.css */
.preview-content {
    line-height: 1.7;
    color: var(--mdb-text-primary);
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.preview-content h1 { font-size: 2rem; }
.preview-content h2 { font-size: 1.75rem; }
.preview-content h3 { font-size: 1.5rem; }
.preview-content h4 { font-size: 1.25rem; }
.preview-content h5 { font-size: 1.125rem; }
.preview-content h6 { font-size: 1rem; }

.preview-content p {
    margin-bottom: 1rem;
}

.preview-content code {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

[data-theme="dark"] .preview-content code {
    background-color: rgba(255, 255, 255, 0.1);
}

.preview-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
}

[data-theme="dark"] .preview-content pre {
    background-color: rgba(255, 255, 255, 0.1);
}

.preview-content pre code {
    background-color: transparent;
    padding: 0;
}

.preview-content blockquote {
    border-left: 4px solid var(--mdb-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.preview-content li {
    margin-bottom: 0.5rem;
}

.preview-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.preview-content a {
    color: var(--mdb-primary);
    text-decoration: underline;
}

.preview-content a:hover {
    text-decoration: none;
}

/* Modal Form Styling */
#updateNewsForm .form-label {
    font-weight: 500;
    margin-bottom: 0.75rem;
}

#updateNewsForm .form-check-label {
    font-weight: 500;
}

#updateEditorTabs {
    border-bottom: 2px solid var(--mdb-border-color);
}

#updateEditorTabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.75rem 1.25rem;
    color: var(--mdb-text-muted);
    transition: all 0.3s ease;
}

#updateEditorTabs .nav-link:hover {
    border-bottom-color: var(--mdb-primary);
    color: var(--mdb-primary);
}

#updateEditorTabs .nav-link.active {
    border-bottom-color: var(--mdb-primary);
    color: var(--mdb-primary);
    background-color: transparent;
    font-weight: 500;
}

#updateEditorTabContent {
    border-color: var(--mdb-border-color);
}

/* Better spacing for form sections */
#updateNewsForm > div {
    margin-bottom: 1.5rem;
}

/* Improve switch styling */
.form-check-input {
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--mdb-success);
    border-color: var(--mdb-success);
}

.form-check-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

.form-check-input:disabled ~ .form-check-label {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768.98px) {
    /* Responsive adjustments for Martor editor handled by its own CSS */
}
