/* ========================================
   MODERN THEME - CSS VARIABLES & FOUNDATION
   ======================================== */

@font-face {
    font-family: 'Lato';
    src: url('themes/default/assets/fonts/lato/lato-v22-latin-regular.woff2') format('woff2'),
        url('themes/default/assets/fonts/lato/lato-v22-latin-regular.woff') format('woff');
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('themes/default/assets/fonts/lato/lato-v22-latin-italic.woff2') format('woff2'),
        url('themes/default/assets/fonts/lato/lato-v22-latin-italic.woff') format('woff');
    font-style: italic;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('themes/default/assets/fonts/lato/lato-v22-latin-700.woff2') format('woff2'),
        url('themes/default/assets/fonts/lato/lato-v22-latin-700.woff') format('woff');
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Lato';
    src: url('themes/default/assets/fonts/lato/lato-v22-latin-700italic.woff2') format('woff2'),
        url('themes/default/assets/fonts/lato/lato-v22-latin-700italic.woff') format('woff');
    font-style: italic;
    font-weight: 700;
    font-display: swap;
}

:root {
    color-scheme: light;

    /* Color Palette */
    --color-primary: #6366f1;
    --color-primary-dark: #4f46e5;
    --color-primary-light: #818cf8;
    
    --color-secondary: #ec4899;
    --color-secondary-dark: #be185d;
    
    --color-accent: #14b8a6;
    --color-accent-light: #2dd4bf;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --bg-light: #f1f5f9;
    --bg-lighter: #ffffff;
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    /* Cards & Surfaces */
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
    --card-shadow-hover: 0 25px 70px rgba(99, 102, 241, 0.12);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Typography */
    --font-primary: 'Lato', 'Helvetica Neue', Arial, Helvetica, sans-serif;
    --font-mono: 'Fira Code', 'Courier New', monospace;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

/* Dark mode as default */
html,
body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
}

body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

body,
body .ui.menu,
body .ui.segment,
body .ui.card,
body .ui.message,
body .ui.table,
body .ui.popup,
body .ui.modal,
body .ui.dropdown .menu,
body .ui.label,
body .ui.button,
body .ui.header,
body .ui.list,
body .ui.form,
body .ui.form input:not(.button),
body .ui.form textarea,
body .ui.form select,
body .ui.selection.dropdown,
body .ui.image.label,
body a,
body input,
body textarea,
body select,
body .cc-window.cc-floating,
body .spoiler,
body #tinymce .spoiler {
    transition:
        background-color var(--transition-slow),
        color var(--transition-slow),
        border-color var(--transition-slow),
        box-shadow var(--transition-slow),
        fill var(--transition-slow),
        stroke var(--transition-slow);
}

body.pushable > .pusher {
    background: var(--bg-primary);
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

@media (prefers-reduced-motion: reduce) {
    body,
    body .ui.menu,
    body .ui.segment,
    body .ui.card,
    body .ui.message,
    body .ui.table,
    body .ui.popup,
    body .ui.modal,
    body .ui.dropdown .menu,
    body .ui.label,
    body .ui.button,
    body .ui.header,
    body .ui.list,
    body .ui.form,
    body .ui.form input:not(.button),
    body .ui.form textarea,
    body .ui.form select,
    body .ui.selection.dropdown,
    body .ui.image.label,
    body a,
    body input,
    body textarea,
    body select,
    body .cc-window.cc-floating,
    body .spoiler,
    body #tinymce .spoiler,
    body.pushable > .pusher {
        transition: none !important;
    }
}

#wrapper {
    margin-bottom: 0;
    flex: 1;
}

/* ========================================
   MODERN NAVIGATION BAR
   ======================================== */

.ui.secondary.menu {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(30, 41, 59, 0.8) 100%);
    padding: var(--space-md);
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.ui.secondary.menu .item {
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
    margin: 0 var(--space-xs);
    padding: var(--space-md) var(--space-lg) !important;
}

.ui.secondary.menu .item:hover {
    color: var(--color-accent);
    background: rgba(20, 184, 166, 0.1);
}

.ui.secondary.menu .item.active {
    color: var(--color-accent);
    background: rgba(20, 184, 166, 0.15);
    border-bottom: 2px solid var(--color-accent);
}

.ui.secondary.menu .item i {
    margin-right: var(--space-md);
    color: var(--color-accent);
}

.ui.secondary.menu .toc.item {
    display: none;
    color: var(--text-primary);
}

.ui.secondary.menu .toc.item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.ui.secondary.menu .ui.dropdown.item > .dropdown.icon {
    color: var(--text-secondary);
}

.ui.secondary.menu .ui.dropdown.item .menu {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.ui.secondary.menu .ui.dropdown.item .menu .item {
    color: var(--text-secondary);
    border-radius: 0;
    margin: 0;
    padding: var(--space-md) var(--space-lg) !important;
}

.ui.secondary.menu .ui.dropdown.item .menu .item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary-light);
}

.ui.secondary.menu .right.menu {
    margin-left: auto;
}

.ui.secondary.menu .right.menu .item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ui.secondary.menu .ui.medium.label {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-primary);
    color: var(--color-primary-light);
    padding: 0.55em 0.85em;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.ui.secondary.menu .ui.medium.label:hover {
    background: rgba(99, 102, 241, 0.2);
}

.ui.secondary.menu .ui.medium.label img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: var(--space-sm);
}

/* Mobile Navigation */
@media only screen and (max-width: 768px) {
    .ui.secondary.menu {
        padding: var(--space-md);
    }

    .ui.secondary.menu .menu,
    .ui.secondary.menu .item:not(.toc),
    .ui.secondary.menu .right.menu {
        display: none;
    }

    .ui.secondary.menu .toc.item {
        display: block !important;
        margin: 0 !important;
    }
}

/* Sidebar Navigation */
.ui.vertical.inverted.sidebar.menu.left {
    background: var(--card-bg);
    border-right: 1px solid var(--card-border);
}

.ui.vertical.inverted.sidebar.menu.left .item {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--card-border);
    padding: var(--space-lg) var(--space-md) !important;
}

.ui.vertical.inverted.sidebar.menu.left .item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-accent);
}

.ui.vertical.inverted.sidebar.menu.left .item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-accent);
    border-left: 3px solid var(--color-accent);
}

.ui.vertical.inverted.sidebar.menu.left .item .header {
    color: var(--text-primary);
    font-weight: 600;
}

.ui.vertical.inverted.sidebar.menu.left .item .header .icon {
    float: right;
    color: var(--color-accent);
}

.ui.vertical.inverted.sidebar.menu.left .item .menu {
    margin-top: var(--space-md);
}

.ui.vertical.inverted.sidebar.menu.left .item .menu .item {
    padding: var(--space-md) var(--space-lg) !important;
    border: none;
    border-left: 2px solid transparent;
    margin-left: var(--space-md);
}

.ui.vertical.inverted.sidebar.menu.left .item .menu .item:hover {
    border-left: 2px solid var(--color-primary);
}

/* ========================================
   MODERN HEADER & MASTHEAD
   ======================================== */

.ui.masthead {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 50%, var(--color-accent) 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    margin-bottom: var(--space-xl);
    padding: 5rem var(--space-lg);
    border-radius: 0;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.ui.masthead::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.ui.masthead .ui.container {
    position: relative;
    z-index: 1;
}

.ui.masthead h1,
.ui.masthead h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.ui.masthead .connect-server {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: fit-content;
    padding: var(--space-lg) var(--space-xl);
    margin-left: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
}

.ui.masthead .connect-server:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.ui.masthead .connect-server .ui.header {
    margin: 0;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .ui.masthead {
        padding: 3rem var(--space-lg);
    }

    .ui.masthead h1,
    .ui.masthead h2 {
        font-size: 1.75rem;
    }

    .ui.masthead .ui.grid .ui.row .column > * {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .ui.masthead .connect-server {
        margin-left: 0;
        margin-top: var(--space-lg);
    }
}

/* ========================================
   MODERN CARDS & SEGMENTS
   ======================================== */

.ui.segment {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
    padding: var(--space-xl);
    transition: all var(--transition-base);
}

.ui.segment:hover {
    border-color: var(--color-primary);
    box-shadow: var(--card-shadow-hover);
}

.ui.secondary.segment {
    background: rgba(20, 184, 166, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.1);
}

.ui.segment .ui.list .list > .item .header,
.ui.segment .ui.list > .item .header {
    display: inline-block;
    color: var(--text-primary);
}

.ui.segment .ui.header {
    color: var(--text-primary);
}

.ui.segment .ui.header .sub.header {
    color: var(--text-secondary);
}

.ui.inverted.segment {
    background: var(--bg-primary);
    border-color: var(--card-border);
    color: var(--text-primary);
}

/* ========================================
   MODERN FORUM STYLING
   ======================================== */

#forum-node #last-post {
    width: auto;
    padding: var(--space-lg);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(99, 102, 241, 0.1);
}

#forum-node #last-post .avatar {
    margin: 0 var(--space-md) 0 0;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    overflow: hidden;
}

/* Forum Tables */
#sticky-threads,
#normal-threads {
    width: 100%;
    border-collapse: collapse;
}

#sticky-threads tbody tr,
#normal-threads tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: background var(--transition-fast);
}

#sticky-threads tbody tr:hover,
#normal-threads tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

#sticky-threads tbody tr td,
#normal-threads tbody tr td {
    padding: var(--space-lg);
    color: var(--text-secondary);
}

#sticky-threads tbody tr td:last-child:not(:first-child),
#normal-threads tbody tr td:last-child:not(:first-child) {
    text-align: right;
}

#sticky-threads .badge,
#sticky-threads .ui.label,
#normal-threads .badge,
#normal-threads .ui.label {
    position: relative;
    top: initial;
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
    margin: 0;
    margin-right: var(--space-sm);
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary-light);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
}

/* News Posts */
#news-post {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#news-post .badge,
#news-post .ui.label {
    position: absolute;
    margin: 0;
    padding: var(--space-md) var(--space-lg);
    width: auto;
    top: 0;
    right: 0;
    text-transform: uppercase;
    background: var(--color-primary);
    color: var(--text-primary);
    border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ========================================
   MODERN TOPIC/POST STYLING
   ======================================== */

.topic-post,
#topic-reply {
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
    border-radius: var(--radius-md);
    overflow: visible;
}

.topic-post.ui.segments,
#topic-reply.ui.segment {
    border: 1px solid var(--card-border);
    box-shadow: none;
    background: var(--card-bg);
}

.topic-post > .ui.attached.segment,
#topic-reply {
    border: 0;
    box-shadow: none;
    background: var(--card-bg);
}

.topic-post .post-sidebar,
#topic-reply #reply-sidebar {
    background: transparent;
    border: 0;
    border-right: 1px solid var(--card-border);
    border-radius: 0;
    padding: var(--space-lg);
    text-align: center;
}

.topic-post .post-sidebar .ui.small.image,
#topic-reply #reply-sidebar .ui.small.image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto var(--space-md);
    border: 2px solid var(--color-primary);
}

.topic-post .post-sidebar h3,
#topic-reply #reply-sidebar h3 {
    margin: 0 0 var(--space-md);
    color: var(--text-primary);
}

.topic-post .post-content,
#topic-reply #reply-content {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
}

/* Keep quick reply layout stable and force full-width editor on desktop. */
#topic-reply #reply-content {
    display: block;
    min-width: 0;
}

#topic-reply #reply-content .ui.form,
#topic-reply #reply-content .field,
#topic-reply #reply-content #quickreply {
    width: 100%;
    max-width: 100%;
}

#topic-reply #reply-content .tox.tox-tinymce {
    width: 100% !important;
    max-width: 100% !important;
}

#topic-reply #reply-sidebar .ui.small.image {
    object-fit: cover;
}

.topic-post .post-meta {
    background: var(--bg-secondary);
    border-top: 1px solid var(--card-border);
}

.ui.dropdown.hover-dropdown .menu {
    will-change: transform, opacity;
    transform: translateZ(0);
}

@media (max-width: 768px) {
    .topic-post,
    #topic-reply {
        overflow: hidden;
    }

    .topic-post .post-sidebar,
    #topic-reply #reply-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--card-border);
    }

    .topic-post .post-sidebar .ui.list,
    #topic-reply #reply-sidebar .ui.list {
        display: none;
    }

    #topic-reply #reply-content,
    #topic-reply #reply-content .ui.form,
    #topic-reply #reply-content .field,
    #topic-reply #reply-content #quickreply,
    #topic-reply #reply-content .tox.tox-tinymce {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.ui.comments {
    max-width: none;
}

.blockquote {
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    padding: var(--space-md) var(--space-lg);
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================================
   REACTIONS
   ======================================== */

#reactions {
    margin-top: auto;
    padding: var(--space-md);
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

#reaction-button,
.reaction-button,
.reaction-button-selected {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-primary);
    color: var(--color-primary-light);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.reaction-button {
    opacity: 0.6;
}

.reaction-button:hover,
.reaction-button-selected {
    opacity: 1;
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--color-accent);
    transform: scale(1.05);
}

#modal-reactions .ui.menu {
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.ui.menu .item > img:not(.ui) {
    width: 1.5em;
}

/* ========================================
   ACCOUNT & MESSAGING
   ======================================== */

#view-message #message {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

#view-message #message .header {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

#view-message #message .meta {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

#messages table {
    width: 100%;
    border-collapse: collapse;
}

#messages table thead {
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 2px solid var(--card-border);
}

#messages table thead tr th {
    color: var(--text-primary);
    padding: var(--space-lg);
    text-align: left;
    font-weight: 600;
}

#messages table tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: background var(--transition-fast);
}

#messages table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

#messages table tbody tr td {
    padding: var(--space-lg);
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    #messages table thead tr th:first-child {
        width: 100%;
    }

    #messages table thead tr th:not(:first-child),
    #messages table tbody tr td:not(:first-child) {
        display: none;
    }
}

/* ========================================
   PROFILE PAGE
   ======================================== */

#profile-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    position: relative;
}

#profile-header .ui.header {
    margin: var(--space-md) 0;
    color: var(--text-primary);
}

#profile-header .ui.label {
    margin: 0;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid var(--color-primary);
    color: var(--color-primary-light);
}

#profile-header .actions {
    position: absolute;
    right: var(--space-lg);
    top: var(--space-lg);
}

#profile a.ui.circular.image.avatar img {
    max-height: 48px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
}

.ui.image.label img {
    vertical-align: top !important;
    border-radius: 50%;
    margin-right: var(--space-sm);
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

.ui.form .field > label {
    color: var(--text-primary);
    font-weight: 600;
}

.ui.form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="reset"]):not([type="button"]),
.ui.form textarea,
.ui.form select {
    background: var(--bg-tertiary);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all var(--transition-fast);
}

.ui.form input:focus,
.ui.form textarea:focus,
.ui.form select:focus {
    background: var(--bg-secondary);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    outline: none;
}

.ui.button {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.ui.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.ui.button.secondary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--color-primary-light);
    border: 1px solid var(--color-primary);
}

.ui.button.secondary:hover {
    background: rgba(99, 102, 241, 0.2);
}

.inline.fields.labels {
    flex-wrap: wrap;
}

.ui.form .inline.fields.labels .field {
    padding-bottom: var(--space-lg);
}

/* ========================================
   ERROR PAGES
   ======================================== */

#error-403 .ui.container,
#error-404 .ui.container,
#maintenance .ui.container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#error-403 .ui.segment,
#error-404 .ui.segment,
#maintenance .ui.segment {
    width: 100%;
    max-width: 500px;
    text-align: center;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#error-403 .ui.segment h1,
#error-404 .ui.segment h1,
#maintenance .ui.segment h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   FOOTER
   ======================================== */

.ui.inverted.segment:last-child {
    background: linear-gradient(to bottom, var(--card-bg), var(--bg-primary));
    border-top: 1px solid var(--card-border);
    margin-top: var(--space-2xl);
    padding: var(--space-2xl) var(--space-lg);
}

.ui.inverted.divided.grid > .row > .column > h4,
.ui.inverted.divided.grid > .row > h4 {
    color: var(--text-primary);
    font-weight: 600;
}

.ui.inverted.divided.grid > .row > .column > a,
.ui.inverted.divided.grid > .row > .column > p {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.ui.inverted.divided.grid > .row > .column > a:hover {
    color: var(--color-accent);
}

/* ========================================
   WIDGETS
   ======================================== */

[id*="widget"] {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

[id*="widget"] .header {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 2px solid var(--card-border);
}

[id*="widget"] .item {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--card-border);
    transition: all var(--transition-fast);
}

[id*="widget"] .item:last-child {
    border: none;
}

[id*="widget"] .item:hover {
    padding-left: var(--space-md);
}

[id*="widget"] .item .content {
    width: calc(100% - 40px) !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

[id*="widget"] .item .content * {
    overflow: hidden;
    text-overflow: ellipsis;
}

[id*="widget"] .item .description {
    width: calc(100% - 120px) !important;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

[id*="widget"] .item .description * {
    overflow: hidden;
}

#widget-online-users .content {
    padding-bottom: var(--space-md);
}

#widget-online-users .ui.image.label {
    margin-bottom: var(--space-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-primary);
}

#widget-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* ========================================
   LEADERBOARD
   ======================================== */

.ui.grid.segment.leaderboard_table {
    margin-top: 0;
}

.leaderboard_table .ui.list {
    margin-left: -0.625rem;
}

.leaderboard_table .ui.list li {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--card-border);
}

.leaderboard_table .ui.list li:last-child {
    border: none;
}

.leaderboard_table .ui.list li a {
    display: block;
    height: 100%;
    width: 100%;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.leaderboard_table .ui.list li a:hover {
    color: var(--color-accent);
    padding-left: var(--space-md);
}

.leaderboard_table .middle.aligned.content {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard_table ol li:before {
    display: none;
}

/* ========================================
   SEARCH RESULTS
   ======================================== */

#forum-search-result h3.ui.header {
    margin-top: 0;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

#forum-search-result .ui.segment {
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid var(--card-border);
}

/* ========================================
   SERVER STATUS & PLAYERS
   ======================================== */

[id*="server"] #server-status {
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    background: rgba(20, 184, 166, 0.05);
    border: 1px solid rgba(20, 184, 166, 0.2);
}

[id*="server"] #server-status.offline {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
}

[id*="server"] #server-players a {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    margin: var(--space-xs);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    color: var(--color-primary-light);
    text-decoration: none;
    transition: all var(--transition-fast);
}

[id*="server"] #server-players a:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

[id*="server"] #server-players a:not(:last-child) {
    margin-right: var(--space-md);
}

/* ========================================
   GLOBAL UI COMPONENTS
   ======================================== */

.ui.header {
    color: var(--text-primary) !important;
}

.ui.header .sub.header {
    color: var(--text-secondary) !important;
}

.ui.divider {
    border-color: var(--card-border);
}

.ui.list .item {
    color: var(--text-secondary);
}

.ui.list .item a {
    color: var(--color-primary-light);
    transition: color var(--transition-fast);
}

.ui.list .item a:hover {
    color: var(--color-accent);
}

.ui.container {
    max-width: 1200px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .ui.masthead {
        padding: 2rem var(--space-lg);
    }

    .ui.segment {
        padding: var(--space-lg);
    }

    .topic-post .post-meta {
        text-align: center;
    }

    .topic-post .post-meta [class*="res right floated"] {
        margin-top: 0;
    }
}

/* ========================================
   LIGHT MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: light) {
    :root {
        --bg-primary: #ffffff;
        --bg-secondary: #f8fafc;
        --bg-tertiary: #f1f5f9;
        --text-primary: #0f172a;
        --text-secondary: #334155;
        --text-muted: #64748b;
        --card-bg: #f8fafc;
        --card-border: #e2e8f0;
        --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        --card-shadow-hover: 0 10px 25px rgba(99, 102, 241, 0.15);
    }

    .ui.secondary.menu {
        background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
        border-bottom: 1px solid #e2e8f0;
    }

    .ui.masthead {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }

    .ui.inverted.segment:last-child {
        background: linear-gradient(to bottom, #f8fafc, #ffffff);
        border-top: 1px solid #e2e8f0;
    }
}

/* ========================================
   FOMANTIC UI OVERRIDES
   ======================================== */

.ui.button {
    transition: all var(--transition-fast);
}

.ui.button:hover {
    transform: translateY(-2px);
}

.ui.checkbox input[type=checkbox]:checked ~ label:before,
.ui.checkbox input[type=radio]:checked ~ label:before {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.ui.checkbox label {
    color: var(--text-secondary);
}

.ui.checkbox label:hover {
    color: var(--text-primary);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modern-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-base);
}

.modern-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--card-shadow-hover);
}

#widget-online-staff .ui.list .item {
    display: flex;
    align-items: center;
}

#widget-online-staff .ui.list .item .content {
    display: flex;
    align-items: center;
}

#widget-online-staff .ui.list .item .content .badge {
    margin-left: .35rem;
}

.fb-page {
    padding-bottom: 14px;
}

/*
   *  -[ FOOTER ]-
   */

.ui.footer.segment {
    position: relative;
    margin: auto 0 -.5rem 0;
    padding: 3em 0;
}

@media only screen and (max-width: 768px) {
    .ui.footer.segment {
        text-align: center;
    }
}

.ui.link.list.list .active.item {
    color: rgba(255, 255, 255, .5);
}

.ui.link.list.list .active.item a:not(.ui) {
    color: rgba(0, 0, 0, .87) !important;
}

.ui.link.list.list .active.item a:not(.ui):hover {
    background: rgba(0, 0, 0, .05) !important;
}

/*
   *  [ TABLE ]
   */

@media (max-width: 576px) {
    .ui.table.res thead tr th:first-child {
        width: 100%;
    }

    .ui.table.res thead tr th:not(:first-child),
    .ui.table.res tbody tr td:not(:first-child) {
        display: none;
    }
}

@media (max-width: 992px) {

    .ui.table.res thead tr th:first-child,
    .ui.table.res thead tr th:last-child {
        width: 50%;
    }

    .ui.table.res thead tr th:not(:first-child):not(:last-child),
    .ui.table.res tbody tr td:not(:first-child):not(:last-child) {
        display: none;
    }
}

/*
   *  -[ GRID ]-
   */

.ui.grid+.grid {
    margin-top: 0.3rem;
}

.ui.row+.row {
    padding-top: 0.3rem;
}

.ui.padded.grid:not(.vertically):not(.horizontally) {
    margin: 0 -1rem 0 -1rem !important;
}

@media only screen and (max-width: 768px) {
    .ui.padded.grid:not(.vertically):not(.horizontally) {
        margin: 0 !important;
    }
}

/*
   *  [ LINK LIST ]
   */

.ui.link.list.list .item a:not(.ui):hover,
.ui.link.list.list a.item:hover {
    background: none;
}

.ui.link.list.list .ui.divider {
    margin: 0.5rem 0;
}

/*
   *  [ USES POPUP ]
   */

#user-popup .header {
    text-align: center;
}

#user-popup .header .ui.header {
    padding: .5rem 0;
}

#user-popup .header .ui.image {
    margin: auto;
}

/*
   *  [ COOKIE NOTICE ]
   */

.cc-window.cc-floating {
    padding: 1rem 1.5rem;
    background-color: #fff !important;
    color: rgba(0, 0, 0, .68) !important;
    -webkit-box-shadow: 0 1px 3px 0 #bababb, 0 0 1px 1px #bababb;
    box-shadow: 0 1px 3px 0 #bababb, 0 0 1px 1px #bababb;
    border: none;
    border-radius: .28571429rem;
    cursor: default;
    font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 18px;
    opacity: 1;
    transition: .5s all ease;
}

.cc-window.cc-floating .cc-highlight .cc-btn:first-child {
    color: rgba(0, 0, 0, .68);
}

.cc-window.cc-floating .cc-highlight .cc-btn.cc-allow {
    -webkit-box-shadow: 0 0 0 0 rgb(34 36 38 / 15%) inset;
    box-shadow: 0 0 0 0 rgb(34 36 38 / 15%) inset;
    background-color: #2185d0;
    border-color: #fff;
    border-radius: 5px;
    color: #fff;
}

.cc-revoke.cc-bottom.cc-right {
    color: #fff;
}

/*
   *  [ SPOILER ]
   */

#tinymce .spoiler,
.spoiler {
    color: rgba(0, 0, 0, .87);
    border-radius: .28571429rem;
    -webkit-box-shadow: 0 0 0 1px rgba(34, 36, 38, .22) inset, 0 0 0 0 transparent;
    box-shadow: 0 0 0 1px rgba(34, 36, 38, .22) inset, 0 0 0 0 transparent;
    border: none;
}

#tinymce .spoiler-toggle,
.spoiler-toggle {
    color: rgba(0, 0, 0, .87);
}

#tinymce .spoiler-text,
.spoiler-text {
    color: rgba(0, 0, 0, .87);
}

/*
   *  [ MESSAGE ]
   */

.ui.message>.close.icon {
    right: .8em;
}

/*
   *  [ UPDATE MESSAGE ]
   */

#update-message {
    margin-bottom: 1rem;
}

#update-message>a {
    color: inherit;
    transition: all .2s ease;
}

#update-message>a:hover {
    filter: contrast(2);
}

#update-message>a>.icon {
    margin-right: .5em;
}

#update-message>a>.icon:not(.close) {
    display: block;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: auto;
    line-height: 1;
    font-size: 3em;
    opacity: .8;
}

/*
   *  [ PAGINATION ]
   */

.ui.mini.pagination.menu .item:first-child,
.ui.mini.pagination.menu .item:last-child {
    padding-top: .5rem;
}

/*
   *  -[ ALIGNMENTS ]-
   */

[class*="left aligned"] {
    text-align: left;
}

[class*="center aligned"] {
    text-align: center;
}

[class*="right aligned"] {
    text-align: right;
}

/*
   *  [ FLOATS ]
   */

[class*="left floated"],
[class*="res left floated"] {
    float: left;
}

[class*="right floated"],
[class*="res right floated"] {
    float: right;
}

[class*="right floated"]+.ui.segment,
[class*="res right floated"]+.ui.segment {
    margin-top: 1rem;
}

@media only screen and (max-width: 576px) {

    [class*="res right floated"],
    [class*="res left floated"] {
        margin-top: 1rem;
        float: none;
    }

    [class*="res right floated"] .button:not(.mini),
    [class*="res left floated"] .button:not(.mini) {
        width: 100%;
        text-align: center;
    }

    [class*="res right floated"] .button:not(:first-child),
    [class*="res left floated"] .button:not(:first-child) {
        margin-top: 0.5rem;
    }
}

/*
   *  [ DISPLAY ]
   */

[display="block"] {
    display: block !important;
}

[display="inline"] {
    display: inline !important;
}

[display="inline block"] {
    display: inline-block !important;
}

/*
   *  [ VISIBILITY ]
   */

@media only screen and (max-width: 576px) {

    [class*="mobile hidden"],
    [class*="tablet only"]:not(.mobile),
    [class*="computer only"]:not(.mobile),
    [class*="large screen only"]:not(.mobile),
    [class*="widescreen only"]:not(.mobile),
    [class*="or lower hidden"] {
        display: none !important;
    }
}

@media only screen and (min-width: 576px) and (max-width: 768px) {

    [class*="mobile only"]:not(.tablet),
    [class*="tablet hidden"],
    [class*="computer only"]:not(.tablet),
    [class*="large screen only"]:not(.tablet),
    [class*="widescreen only"]:not(.tablet),
    [class*="or lower hidden"]:not(.mobile) {
        display: none !important;
    }
}

@media only screen and (min-width: 768px) and (max-width: 992px) {

    [class*="mobile only"]:not(.computer),
    [class*="tablet only"]:not(.computer),
    [class*="computer hidden"],
    [class*="large screen only"]:not(.computer),
    [class*="widescreen only"]:not(.computer),
    [class*="or lower hidden"]:not(.tablet):not(.mobile) {
        display: none !important;
    }
}

@media only screen and (min-width: 992px) and (max-width: 1280px) {

    [class*="mobile only"]:not([class*="large screen"]),
    [class*="tablet only"]:not([class*="large screen"]),
    [class*="computer only"]:not([class*="large screen"]),
    [class*="large screen hidden"],
    [class*="widescreen only"]:not([class*="large screen"]),
    [class*="or lower hidden"]:not(.computer):not(.tablet):not(.mobile) {
        display: none !important;
    }
}

@media only screen and (min-width: 1280px) {

    [class*="mobile only"]:not([class*="widescreen"]),
    [class*="tablet only"]:not([class*="widescreen"]),
    [class*="computer only"]:not([class*="widescreen"]),
    [class*="large screen only"]:not([class*="widescreen"]),
    [class*="widescreen hidden"],
    [class*="widescreen or lower hidden"] {
        display: none !important;
    }
}

/*
   *  [ USER BADGES ]
   */

.badge {
    display: inline-block;
    line-height: 1;
    vertical-align: baseline;
    margin: 0 .14285714em;
    background-color: #e8e8e8;
    background-image: none;
    padding: 0.3em .3em;
    color: rgba(0, 0, 0, .6);
    text-transform: none;
    font-size: .85714286rem;
    font-weight: 700;
    border: 0 solid transparent;
    border-radius: .28571429rem;
    -webkit-transition: background .1s ease;
    transition: background .1s ease;
}

a.badge:hover,
a.badge:focus {
    text-decoration: none;
}

.badge:empty {
    display: none;
}

.badge-primary {
    color: #fff;
    background-color: #007bff;
}

a.badge-primary:hover,
a.badge-primary:focus {
    color: #fff;
    background-color: #0062cc;
}

.badge-secondary {
    color: #fff;
    background-color: #6c757d;
}

a.badge-secondary:hover,
a.badge-secondary:focus {
    color: #fff;
    background-color: #545b62;
}

.badge-success {
    color: #fff;
    background-color: #28a745;
}

a.badge-success:hover,
a.badge-success:focus {
    color: #fff;
    background-color: #1e7e34;
}

.badge-info {
    color: #fff;
    background-color: #17a2b8;
}

a.badge-info:hover,
a.badge-info:focus {
    color: #fff;
    background-color: #117a8b;
}

.badge-warning {
    color: #212529;
    background-color: #ffc107;
}

a.badge-warning:hover,
a.badge-warning:focus {
    color: #212529;
    background-color: #d39e00;
}

.badge-danger {
    color: #fff;
    background-color: #dc3545;
}

a.badge-danger:hover,
a.badge-danger:focus {
    color: #fff;
    background-color: #bd2130;
}

.badge-light {
    color: #212529;
    background-color: #f8f9fa;
}

a.badge-light:hover,
a.badge-light:focus {
    color: #212529;
    background-color: #dae0e5;
}

.badge-dark {
    color: #fff;
    background-color: #343a40;
}

a.badge-dark:hover,
a.badge-dark:focus {
    color: #fff;
    background-color: #1d2124;
}

/*
   *  [ OTHER ]
   */

select {
    font-family: Lato, 'Helvetica Neue', Arial, Helvetica, sans-serif;
    font-size: 0.9rem;
    padding: 10px !important;
}

.ui.popup {
    z-index: 99999;
    text-align: left;
}

.ui.popup .ui.header {
    margin: 0;
}

.ui.message {
    margin: 0.5em 0;
}

.tox-tinymce {
    min-height: 300px;
}

.forum_post {
    word-wrap: break-word;
}

.forum_post img {
    overflow: auto;
    max-width: 100%;
    height: auto;
}

.post-content .forum_post {
    margin-bottom: 1rem;
}

.ui.checkbox .box:before {
    margin-top: 4px;
}

.ui.checkbox input:checked~.box:after {
    margin-top: 4px;
}

.ui.header .topic.title .label,
.ui.header .topic.title .badge {
    margin-top: -4px;
    vertical-align: middle;
}

#ie-message {
    display: none;
}

@media all and (-ms-high-contrast: none),
(-ms-high-contrast: active) {
    #ie-message {
        display: initial;
    }
}

#darkmode {
    display: inline-block;
}

.darkmode-toggle {
    opacity: 0;
    position: absolute;
}

.darkmode-toggle:checked+.darkmode-toggle-label .darkmode-ball {
    transform: translateX(24px);
}

.darkmode-toggle-label {
    background-color: #111;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 50px;
    position: relative;
    padding: 5px;
    height: 26px;
    width: 50px;
    cursor: pointer;
    transition: background-color var(--transition-slow), border-color var(--transition-slow), box-shadow var(--transition-slow);
}

.darkmode-ball {
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    height: 22px;
    width: 22px;
    transition: transform 0.2s linear;
}

body:not(.dark) .darkmode-toggle-label,
.darkmode-toggle-label.light-mode {
    background-color: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

body:not(.dark) .darkmode-ball,
.darkmode-toggle-label.light-mode .darkmode-ball {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
}

body:not(.dark) .fa-moon,
.darkmode-toggle-label.light-mode .fa-moon {
    color: #64748b;
}

body:not(.dark) .fa-sun,
.darkmode-toggle-label.light-mode .fa-sun {
    color: #f59e0b;
}

body.dark .darkmode-toggle-label {
    background-color: #111;
}

.fa-moon {
    color: #f1c400;
}

.fa-sun {
    color: #f39c00;
}

/*
 Member list search images
 */
.ui.search>.results .result .image {
    border-radius: 0;
}

/*
 Make new members grid avatars fit nicer
 */
#new-members-grid {
    padding: 0.5em;
}

#new-members-grid .column {
    padding: 0.5em;
}

/*
 *  [ EMOJI SIZING ]
 */

.joypixels,
.twemoji {
    height: 1em;
    width: 1em;
    vertical-align: middle;
}

/*
   *  [ DARK MODE ]
   */

body.dark,
body.dark>.pusher,
body.dark .ui.pointing.dropdown>.menu:after {
    background: #222;
}

body.dark .ui.secondary.menu:not(.inverted) {
    background: #303030;
    color: #fff;
}

body.dark .ui.secondary.menu {
    border-bottom: none !important;
    box-shadow: none !important;
}

body.dark .ui.secondary.menu .item.active {
    color: #fff;
}

body.dark .ui.top.attached.menu:not(.inverted) {
    background: #282828;
    border: 1px solid #282828;
}

body.dark .ui.top.attached.menu:not(.inverted) .item {
    color: #fff;
}

body.dark .ui.form input:not(.button) {
    background-color: #303030 !important;
}

body.dark .ui.modal {
    background-color: #303030;
    border: none;
}

body.dark .ui.modal>.content {
    background-color: #303030;
    border: 1px solid rgba(0, 0, 0, 0.125);
    color: #fff;
    -webkit-box-shadow: none;
    box-shadow: none;
}

body.dark .ui.modal>.actions,
body.dark .ui.modal>.header {
    color: rgba(255, 255, 255, 0.6);
    background-color: #444;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

body.dark .ui.popup,
body.dark .ui.secondary.menu .ui.popup,
body.dark .ui.menu .dropdown.item .menu,
body.dark .ui.dropdown .menu {
    background-color: #222;
    border: 1px solid #444;
    color: rgba(255, 255, 255, 0.6);
}

body.dark .ui.default.button,
body.dark .ui.mini.icon.button,
body.dark .ui.top.right.attached.label {
    background-color: #282828;
    color: rgba(255, 255, 255, 0.6);
}

body.dark .ui.button.red {
    background-color: #db2828;
    color: #fff;
}

body.dark .ui.image.label,
body.dark .ui.selection.dropdown,
body.dark .ui.selection.visible.dropdown>.text:not(.default) {
    background-color: #282828;
    color: #fff;
}

body.dark .ui.selection.dropdown .ui.label {
    background-color: #303030;
    color: #fff;
}

body.dark .ui.form .ui.selection.dropdown input:not(.button) {
    background-color: #282828 !important;
}

body.dark .ui.form .field .ui.selection.active.dropdown .menu {
    border: 1px solid #282828;
}

body.dark .ui.form .field .ui.dropdown .menu .item {
    background-color: #282828;
    border-top: 1px solid #303030;
    color: #fff;
}

body.dark .ui.form .ui.text input:not(.button) {
    background-color: #282828 !important;
}

body.dark .ui.form .field input {
    background-color: #282828 !important;
}

body.dark .ui.card,
body.dark .ui.segment,
body.dark .ui.segment.attached:not(.basic),
body.dark .ui.vertical.menu {
    background-color: #303030;
    border: 1px solid rgba(0, 0, 0, 0.125);
    -webkit-box-shadow: none;
    box-shadow: none;
}

body.dark .ui.vertical.menu .active.item {
    background-color: #464646;
}

body.dark .ui.vertical.pointing.menu .active.item:after {
    background-color: #464646;
    border-top: 1px solid #464646;
    border-right: 1px solid #464646;
}

body.dark .ui.segment#profile-header {
    border: none;
}

body.dark .ui.attached.tabular.menu {
    border-bottom: none;
}

body.dark .ui.attached.tabular.menu .item.active {
    background-color: #303030;
    border-color: transparent;
}

body.dark .ui.card .content.header {
    background-color: #444;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

body.dark .ui.card>.content>.description,
body.dark .ui.cards>.card>.content>.description,
body.dark .ui.card>.content>.description .list .right.floated,
body.dark .ui.card>.content>.header a,
body.dark .ui.segment a,
body.dark .ui.checkbox label,
body.dark .ui.checkbox+label,
body.dark .ui.list .list>.item .description,
body.dark .ui.list>.item .description,
body.dark .ui.vertical.menu .item.active,
body.dark .ui.vertical.menu .item:hover,
body.dark #user-popup .description,
body.dark .ui.search.dropdown.active>input.search,
body.dark .ui.search.selection.dropdown>input.search,
body.dark .ui.selection.dropdown .menu>.message,
body.dark .ui.attached.tabular.menu .item.active,
body.dark .ui.threaded.comments .comment .text {
    color: #fff;
}

body.dark .ui.segment .forum_post a,
body.dark .ui.comments .comment .forum_post a {
    color: #62b6f7;
}

body.dark .ui.card .meta,
.ui.cards>.card .meta,
body.dark .ui.header,
body.dark .ui.header .sub.header,
body.dark .ui.card>.content>.header,
body.dark .ui.cards>.card>.content>.header,
body.dark .ui.secondary.menu .item:not(.active),
body.dark .ui.card>.content>.description .list .item .text,
body.dark .ui.card>.extra,
body.dark .ui.cards>.card>.extra,
body.dark .ui.pointing.dropdown>.menu>.header,
body.dark .ui.dropdown .menu>.item,
body.dark .ui.breadcrumb .icon.divider,
body.dark .ui.vertical.menu .item,
body.dark .ui.segment,
body.dark .ui.form .field>label,
body.dark .ui.list .list>.item .header,
body.dark .ui.list>.item .header,
body.dark .ui.attached.tabular.menu .item,
body.dark .ui.comments .comment .metadata,
body.dark .ui.comments .comment .actions a,
body.dark .ui.card>.extra a:not(.ui),
body.dark .ui.cards>.card>.extra a:not(.ui),
body.dark .ui.relaxed.list .item .content,
body.dark .ui.horizontal.divider,
body.dark .ui.dropdown .menu>.header:not(.ui),
body.dark .ui.link.list.list .active.item,
body.dark .ui.link.list.list .active.item a:not(.ui) {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.dark .ui.menu .ui.dropdown .menu>.item:hover {
    background-color: rgba(0, 0, 0, .05) !important;
}

body.dark .ui.secondary.inverted.menu .popup .list a.item,
body.dark .ui.pointing.dropdown>.menu>.item {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.dark .ui.menu .ui.dropdown .menu>.item:hover,
body.dark .ui.dropdown .menu>.item:hover,
body.dark .ui.menu .ui.dropdown .menu>.item.active,
body.dark .ui.list>.item a.header,
body.dark .ui.link.list.list .active.item a:not(.ui):hover {
    color: #fff !important;
}

body.dark .ui.top.left.popup:before {
    background: #222;
    -webkit-box-shadow: 1px 1px 0 0 #444;
    box-shadow: 1px 1px 0 0 #444;
}

body.dark .ui.right.center.popup:before {
    background: #222;
    -webkit-box-shadow: -1px 1px 0 0 #444;
    box-shadow: -1px 1px 0 0 #444;
}

body.dark .ui.left.center.popup:before {
    background: #222;
    -webkit-box-shadow: 1px -1px 0 0 #444;
    box-shadow: 1px -1px 0 0 #444;
}

body.dark .ui.bottom.left.popup:before {
    background: #222;
    -webkit-box-shadow: 1px 1px 0 0 #222;
    box-shadow: 1px 1px 0 0 #222;
}

body.dark .ui.form textarea {
    background-color: #303030;
    border: 2px solid #282828;
    color: #fff;
}

body.dark .ui.form input:not([type]),
body.dark .ui.form input[type=date],
body.dark .ui.form input[type=datetime-local],
body.dark .ui.form input[type=email],
body.dark .ui.form input[type=file],
body.dark .ui.form input[type=number],
body.dark .ui.form input[type=password],
body.dark .ui.form input[type=search],
body.dark .ui.form input[type=tel],
body.dark .ui.form input[type=text],
body.dark .ui.form input[type=time],
body.dark .ui.form input[type=url] {
    color: #fff;
}

body.dark .ui.mini.message,
body.dark .ui.mini.info.message {
    background-color: #282828;
    box-shadow: 0 0 0 1px #282828 inset, 0 0 0 0 transparent;
    -webkit-box-shadow: 0 0 0 1px #282828 inset, 0 0 0 0 transparent;
}

body.dark .ui.pagination {
    background-color: #303030;
}

body.dark .ui.pagination.menu .item {
    color: #fff;
}

body.dark .ui.pagination.menu .item.active {
    background-color: #282828;
}

body.dark .ui.pagination .disabled.item {
    background-color: rgba(0, 0, 0, .05) !important;
    color: rgba(255, 255, 255, 0.6) !important;
}

body.dark .ui.table {
    background: #303030;
    color: rgba(255, 255, 255, 0.6);
}

body.dark .ui.table thead th {
    background-color: #282828;
    color: rgba(255, 255, 255, 0.6);
}

body.dark .ui.top.attached.header {
    background-color: #282828;
    border-color: #282828;
    color: rgba(255, 255, 255, 0.6);
}

body.dark .ui.table a {
    color: #fff;
}

body.dark .ui.selectable.table tbody tr:hover,
body.dark .ui.table tbody tr td.selectable:hover {
    color: rgba(255, 255, 255, 0.6) !important;
}

@media only screen and (min-width: 768px) {

    body.dark .topic-post .post-sidebar:after,
    body.dark #topic-reply #reply-sidebar:after {
        border-right: none;
    }
}

body.dark .forum_post,
body.dark .ui.comments .forum_post.text {
    color: #fff;
}

body.dark .ui.comments .comment .author {
    color: #fff;
}

body.dark .tox .tox-toolbar {
    background-color: #222;
}

body.dark .tox .tox-tbtn {
    color: #fff;
}

body.dark .tox .tox-tbtn:hover,
body.dark .tox .tox-tbtn--enabled,
body.dark .tox .tox-split-button:focus,
body.dark .tox .tox-edit-area__iframe {
    color: #fff;
}

body.dark .tox .tox-tbtn svg {
    fill: #fff;
}

/* Override TinyMCE blue-ish dark theme with neutral dark theme */

body.dark .tox .tox-menu,
body.dark .tox .tox-statusbar,
body.dark .tox .tox-menubar,
body.dark .tox .tox-toolbar,
body.dark .tox .tox-toolbar__overflow,
body.dark .tox .tox-toolbar__primary,
body.dark .tox .tox-dialog,
body.dark .tox .tox-dialog__header,
body.dark .tox .tox-dialog__footer,
body.dark .tox .tox-listboxfield .tox-listbox--select,
body.dark .tox .tox-textarea,
body.dark .tox .tox-textfield,
body.dark .tox .tox-toolbar-textfield,
body.dark .tox .tox-selectfield select {
    background-color: #222;
}

body.dark .tox .tox-dialog-wrap__backdrop {
    background-color: rgba(34, 34, 34, 0.7);
}

body.dark .tox .tox-collection--list .tox-collection__item--enabled {
    background-color: #444;
}

body.dark .tox .tox-collection--list .tox-collection__item--active {
    background-color: #666;
}

body.dark .ui.cards>.green.card,
body.dark .ui.green.card,
body.dark .ui.green.cards>.card {
    -webkit-box-shadow: 0 0 0 1px #d4d4d5, 0 5px 0 0 #178f2b, 0 1px 3px 0 #d4d4d5;
    box-shadow: 0 0 0 1px #d4d4d5, 0 5px 0 0 #178f2b, 0 1px 3px 0 #d4d4d5;
}

body.dark .ui.cards>.red.card,
body.dark .ui.red.card,
body.dark .ui.red.cards>.card {
    -webkit-box-shadow: 0 0 0 1px #d4d4d5, 0 5px 0 0 #db2828, 0 1px 3px 0 #d4d4d5;
    box-shadow: 0 0 0 1px #d4d4d5, 0 5px 0 0 #db2828, 0 1px 3px 0 #d4d4d5;
}

body.dark .ui.tabular.menu {
    border-color: #282828;
}

body.dark .ui.tabular.menu .item {
    color: #fff;
}

body.dark .ui.tabular.menu .active.item {
    background-color: #282828;
    border-color: #282828;
}

body.dark .cc-window.cc-floating {
    -webkit-box-shadow: 0 1px 3px 0 #444, 0 0 1px 1px #444;
    box-shadow: 0 1px 3px 0 #444, 0 0 1px 1px #444;
    background-color: #303030 !important;
    border: 1px solid rgba(0, 0, 0, 0.125);
    color: #fff !important;
}

body.dark .cc-window.cc-floating .cc-highlight .cc-btn:first-child,
body.dark .cc-window.cc-floating .cc-link {
    color: rgba(255, 255, 255, 0.6);
}

body.dark .cc-window.cc-floating .cc-highlight .cc-btn.cc-allow {
    background-color: #282828;
    border-color: transparent;
}

body.dark #reactions.ui.mini.message span {
    color: #fff;
}

body.dark #modal-reactions .ui.menu {
    background-color: #282828;
}

body.dark #modal-reactions .ui.menu .item {
    color: #fff;
}

body.dark #modal-reactions .ui.menu .item.active {
    background-color: #222;
}

body.dark #modal-reactions .ui.large.selection.divided.list.middle.aligned .item .content {
    color: #fff;
}

body.dark ::-webkit-scrollbar-corner {
    background-color: transparent;
}

/*
 * Colours
 */

body.dark .white {
    color: #fff;
}

body.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-light: #f1f5f9;
    --bg-lighter: #f8fafc;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --card-bg: #1e293b;
    --card-border: #334155;
    --card-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    --card-shadow-hover: 0 25px 70px rgba(99, 102, 241, 0.2);
    color-scheme: dark;
}

body.dark,
body.dark>.pusher {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark .ui.container,
body.dark .ui.segment,
body.dark .ui.card,
body.dark .ui.message,
body.dark .ui.table,
body.dark .ui.modal,
body.dark .ui.popup,
body.dark .ui.menu,
body.dark .ui.form,
body.dark .ui.list,
body.dark .ui.breadcrumb {
    color: var(--text-secondary);
}

body.dark .ui.header,
body.dark .ui.card>.content>.header,
body.dark .ui.cards>.card>.content>.header,
body.dark .ui.form .field>label,
body.dark h1,
body.dark h2,
body.dark h3,
body.dark h4,
body.dark h5,
body.dark h6 {
    color: var(--text-primary);
}

body.dark .ui.basic.segment,
body.dark .ui.raised.segment,
body.dark .ui.attached.segment,
body.dark .ui.card,
body.dark .ui.modal,
body.dark .ui.popup,
body.dark .ui.dropdown .menu,
body.dark .ui.message,
body.dark .cc-window.cc-floating {
    background-color: var(--card-bg);
    border-color: var(--card-border);
}

body.dark .ui.button:not(.primary):not(.red),
body.dark .ui.label,
body.dark .ui.selection.dropdown,
body.dark .ui.image.label,
body.dark input,
body.dark textarea,
body.dark select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--card-border);
}

body.dark a:not(.ui.button):not(.ui.label) {
    color: var(--color-primary-light);
}

body.dark #tinymce .spoiler,
body.dark .spoiler {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    box-shadow: 0 0 0 1px var(--card-border) inset, 0 0 0 0 transparent;
}

body.dark #footer,
body.dark #footer .header,
body.dark #footer .item,
body.dark #footer .link,
body.dark #footer .ui.dropdown.item,
body.dark #footer .ui.dropdown.item .menu,
body.dark #footer .ui.dropdown.item .menu .item {
    color: var(--text-secondary);
}

body.dark #footer {
    background: linear-gradient(to bottom, var(--card-bg), var(--bg-primary)) !important;
    border-top: 1px solid var(--card-border) !important;
}

body.dark #footer .ui.dropdown.item .menu {
    background: var(--card-bg) !important;
    border: 1px solid var(--card-border) !important;
}

body.dark #user-popup,
body.dark #user-popup .header,
body.dark #user-popup .ui.divider,
body.dark #user-popup .ui.list .item,
body.dark #user-popup .ui.list .item .text,
body.dark #user-popup .ui.list .item .description,
body.dark .ui.popup .ui.message,
body.dark .ui.popup .ui.list,
body.dark .ui.popup .item {
    color: var(--text-secondary);
}

body.dark #user-popup .header,
body.dark .ui.popup .ui.header {
    color: var(--text-primary);
}

body.dark #notification_settings .ui.table,
body.dark #notification_settings .ui.table thead th,
body.dark #notification_settings .ui.table tbody td,
body.dark #notification_settings .ui.definition.table tr td:first-child,
body.dark #notification_settings .ui.definition.table thead th {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--card-border) !important;
}

body.dark #notification_settings .ui.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.08);
}

body.dark #user-settings .ui.form input[type=text],
body.dark #user-settings .ui.form input[type=email],
body.dark #user-settings .ui.form input[type=password],
body.dark #user-settings .ui.form input[type=number],
body.dark #user-settings .ui.form input[type=date],
body.dark #user-settings .ui.form input[type=time],
body.dark #user-settings .ui.form input[type=url],
body.dark #user-settings .ui.form textarea,
body.dark #user-settings .ui.form select,
body.dark #user-settings .ui.form .ui.selection.dropdown,
body.dark #notification_settings .ui.form input[type=text],
body.dark #notification_settings .ui.form input[type=email],
body.dark #notification_settings .ui.form input[type=password],
body.dark #notification_settings .ui.form input[type=number],
body.dark #notification_settings .ui.form input[type=date],
body.dark #notification_settings .ui.form input[type=time],
body.dark #notification_settings .ui.form input[type=url],
body.dark #notification_settings .ui.form textarea,
body.dark #notification_settings .ui.form select,
body.dark #notification_settings .ui.form .ui.selection.dropdown,
body.dark .ui.form input[type=text],
body.dark .ui.form input[type=email],
body.dark .ui.form input[type=password],
body.dark .ui.form input[type=number],
body.dark .ui.form input[type=date],
body.dark .ui.form input[type=time],
body.dark .ui.form input[type=url],
body.dark .ui.form textarea,
body.dark .ui.form select,
body.dark .ui.form .ui.selection.dropdown,
body.dark .form-control,
body.dark .ui.input input {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--card-border) !important;
}

body.dark #user-settings .ui.form .field label,
body.dark #user-settings .ui.form .field .ui.label,
body.dark #notification_settings .ui.table thead th,
body.dark #notification_settings .ui.table tbody td {
    color: var(--text-primary) !important;
}

body.dark #user-settings .ui.form input::placeholder,
body.dark #user-settings .ui.form textarea::placeholder,
body.dark #notification_settings .ui.form input::placeholder,
body.dark #notification_settings .ui.form textarea::placeholder,
body.dark .ui.form input::placeholder,
body.dark .ui.form textarea::placeholder,
body.dark .form-control::placeholder,
body.dark .ui.input input::placeholder {
    color: var(--text-muted) !important;
}

body.dark .ui.form .field .ui.checkbox label,
body.dark .ui.form .field .ui.toggle.checkbox label,
body.dark .ui.checkbox label,
body.dark .ui.checkbox + label {
    color: var(--text-secondary) !important;
}

body.dark .ui.popup .ui.message,
body.dark .ui.popup .ui.icon.message,
body.dark .ui.popup .ui.basic.message {
    background-color: var(--card-bg) !important;
    border-color: var(--card-border) !important;
}

body.dark .ui.popup,
body.dark .ui.popup .content,
body.dark .ui.popup .header,
body.dark .ui.popup .description,
body.dark .ui.popup .item,
body.dark .ui.popup .list,
body.dark .ui.popup .ui.list .item,
body.dark .ui.popup .ui.list .item .description,
body.dark .ui.popup .ui.list .item .text {
    background-color: var(--card-bg) !important;
    color: var(--text-secondary) !important;
}

/*
 * Accessiblity
 */

.screenreader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
