/*!
 * muosdeibi — WebEngine CMS Template
 * Dark fantasy aesthetic, professional execution
 */

/* =====================================================
   DESIGN TOKENS
   ===================================================== */
:root {
    /* Background layers */
    --bg:           #0b0b0f;
    --bg-raised:    #111118;
    --bg-elevated:  #17171f;

    /* Borders */
    --border:       #1e1e2a;
    --border-mid:   #2a2a38;
    --border-hi:    #3a3a50;

    /* Text */
    --text:         #e8e8f0;
    --text-muted:   #8080a0;
    --text-dim:     #48485e;

    /* Accent — muted amber, used sparingly */
    --accent:       #c9a55a;
    --accent-dim:   #7a6030;

    /* Semantic */
    --green:  #4ade80;
    --red:    #f87171;
    --blue:   #60a5fa;
    --yellow: #fbbf24;

    /* Typography */
    --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Cinzel', serif;

    /* Radius */
    --r:    4px;
    --r-md: 6px;
    --r-lg: 8px;

    /* Transitions */
    --t: 140ms ease;

    /* Layout */
    --max-w: 1200px;
    --header-h: 56px;
    --topbar-h: 32px;
}

/* =====================================================
   RESET
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 14px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t);
}
a:hover { color: var(--text); }

h1,h2,h3,h4,h5,h6 {
    color: var(--text);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-top: 0;
    line-height: 1.3;
}

p { color: var(--text-muted); line-height: 1.75; margin: 0 0 12px; }

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

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* =====================================================
   TOP UTILITY BAR
   ===================================================== */
.topbar {
    height: var(--topbar-h);
    background: #080810;
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-right a {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-dim);
    transition: color var(--t);
}
.topbar-right a:hover { color: var(--text-muted); }

.topbar-sep {
    display: inline-block;
    width: 1px;
    height: 12px;
    background: var(--border-mid);
}

/* =====================================================
   LANGUAGE SWITCHER
   ===================================================== */
.lang-switcher {
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

.lang-switcher > li > a {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 4px 0;
    transition: color var(--t);
}
.lang-switcher > li > a:hover { color: var(--text-muted); }
.lang-switcher > li > a img { width: 14px; height: auto; }

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-md);
    list-style: none;
    margin: 4px 0 0;
    padding: 4px;
    min-width: 130px;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}
.lang-switcher:hover .lang-dropdown { display: block; }

.lang-dropdown li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--r);
    transition: background var(--t), color var(--t);
}
.lang-dropdown li a:hover {
    background: var(--bg-raised);
    color: var(--text);
}
.lang-dropdown li a img { width: 14px; }

/* =====================================================
   SITE HEADER / NAV
   ===================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(11,11,15,0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 20px;
    gap: 28px;
}

.site-logo img {
    height: 34px;
    width: auto;
    display: block;
}

/* Navigation */
.site-nav { flex: 1; }

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}

.site-nav ul li a {
    display: block;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-radius: var(--r);
    transition: color var(--t), background var(--t);
}
.site-nav ul li a:hover {
    color: var(--text);
    background: var(--bg-elevated);
}

/* =====================================================
   STATUS BAR
   ===================================================== */
.statusbar {
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
}

.statusbar-inner {
    display: flex;
    align-items: center;
    gap: 32px;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 8px 20px;
}

.sb-item {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sb-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.sb-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.sb-online { color: var(--green); }

.sb-bar {
    width: 64px;
    height: 3px;
    background: var(--border-mid);
    border-radius: 2px;
    overflow: hidden;
}
.sb-bar-fill {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    min-width: 2px;
    transition: width 1s ease;
}

/* =====================================================
   PAGE LAYOUT
   ===================================================== */
.page-wrap {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px 20px 48px;
}

/* Ensure Bootstrap grid rows clear floats */
#content.row { margin-left: -10px; margin-right: -10px; }
#content.row > [class*="col-"] { padding-left: 10px; padding-right: 10px; }

/* =====================================================
   PANELS / CARDS
   The modules output .panel.panel-default — style them here
   ===================================================== */
.panel {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: none;
    margin-bottom: 16px;
}

.panel-default { border-color: var(--border); }
.panel-default > .panel-heading { background: transparent; }

.panel-heading {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    background: transparent !important;
    border-radius: var(--r-md) var(--r-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0;
}

.panel-body {
    padding: 18px;
    color: var(--text-muted);
}

.panel-footer {
    padding: 10px 18px;
    background: transparent;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
    border-radius: 0 0 var(--r-md) var(--r-md);
}

/* =====================================================
   TABLES
   ===================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table > thead > tr > th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9898b8;           /* readable against dark bg */
    background: #13131c;
    border-bottom: 1px solid var(--border-mid);
    border-top: none;
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 11px 16px;
    color: #c8c8e0;           /* bright enough to read */
    border-bottom: 1px solid var(--border);
    border-top: none;
    vertical-align: middle;
    transition: background var(--t);
    line-height: 1.4;
}

.table > tbody > tr:last-child > td { border-bottom: none; }

.table > tbody > tr:hover > td {
    background: rgba(255,255,255,0.035);
    color: #e8e8f0;
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background: rgba(255,255,255,0.02);
}
.table-striped > tbody > tr:nth-of-type(odd):hover > td {
    background: rgba(255,255,255,0.035);
}

/* Rankings — top-3 rank number colors */
.rankings-table thead th { background: #13131c; }
.rankings-table tbody td { color: #c8c8e0; }
.rankings-table tbody td:first-child { color: #7070a0; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.rankings-table tbody tr:nth-child(1) td:first-child { color: var(--yellow); }
.rankings-table tbody tr:nth-child(2) td:first-child { color: #a0aab8; }
.rankings-table tbody tr:nth-child(3) td:first-child { color: #c07840; }

/* =====================================================
   FORMS
   ===================================================== */
.form-group { margin-bottom: 14px; }

label, .control-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-control {
    display: block;
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    border-radius: var(--r);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    transition: border-color var(--t), box-shadow var(--t);
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-hi);
    box-shadow: 0 0 0 3px rgba(201,165,90,0.08);
}

.form-control::placeholder { color: var(--text-dim); }

textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2348485e' d='M5 7L0 2h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0 16px;
    font-family: var(--font);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: var(--r);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--t), border-color var(--t), color var(--t);
    white-space: nowrap;
    text-decoration: none;
    vertical-align: middle;
    background: transparent;
    line-height: 1;
    user-select: none;
}

.btn:active { opacity: 0.85; }

.btn-default {
    color: var(--text-muted);
    border-color: var(--border-mid);
}
.btn-default:hover {
    color: var(--text);
    border-color: var(--border-hi);
    background: var(--bg-elevated);
}

.btn-primary {
    color: #0b0b0f;
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    color: #0b0b0f !important;
    background: #d4b070 !important;
    border-color: #d4b070 !important;
}

.btn-danger {
    color: var(--red);
    border-color: var(--red);
}
.btn-danger:hover { color: #0b0b0f; background: var(--red); border-color: var(--red); }

.btn-success {
    color: var(--green);
    border-color: var(--green);
}
.btn-success:hover { color: #0b0b0f; background: var(--green); border-color: var(--green); }

.btn-info {
    color: var(--blue);
    border-color: var(--blue);
}
.btn-info:hover { color: #0b0b0f; background: var(--blue); border-color: var(--blue); }

.btn-xs  { height: 24px; padding: 0 10px; font-size: 10px; }
.btn-sm  { height: 30px; padding: 0 12px; font-size: 11px; }
.btn-lg  { height: 42px; padding: 0 22px; font-size: 13px; }
.btn-block { width: 100%; }

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--r);
    border: 1px solid var(--border-mid);
    font-size: 13px;
    margin-bottom: 14px;
    background: var(--bg-elevated);
}

.alert-info    { border-color: #1d3a5f; color: #93c5fd; background: #0f1e33; }
.alert-success { border-color: #14532d; color: #86efac; background: #0a2015; }
.alert-warning { border-color: #78350f; color: #fcd34d; background: #2a1a05; }
.alert-danger  { border-color: #7f1d1d; color: #fca5a5; background: #200d0d; }

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

.pagination > li > a,
.pagination > li > span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-mid);
    border-radius: var(--r);
    color: var(--text-muted);
    background: transparent;
    transition: all var(--t);
}

.pagination > li > a:hover {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--border-hi);
}

.pagination > .active > a,
.pagination > .active > span {
    color: #0b0b0f;
    background: var(--accent);
    border-color: var(--accent);
}

.pagination > .disabled > a { color: var(--text-dim); pointer-events: none; }

/* =====================================================
   LABELS / BADGES
   ===================================================== */
.label {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.label-default { background: var(--bg-elevated); color: var(--text-muted); }
.label-primary  { background: rgba(201,165,90,0.15); color: var(--accent); }
.label-success  { background: rgba(74,222,128,0.12); color: var(--green); }
.label-danger   { background: rgba(248,113,113,0.12); color: var(--red); }
.label-warning  { background: rgba(251,191,36,0.12);  color: var(--yellow); }
.label-info     { background: rgba(96,165,250,0.12);  color: var(--blue); }

/* =====================================================
   THUMBNAILS (class selection grids)
   ===================================================== */
.thumbnail {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px;
    text-align: center;
    display: block;
    transition: border-color var(--t);
    color: var(--text-muted);
}
a.thumbnail:hover { border-color: var(--accent); color: var(--text); }

/* =====================================================
   SIDEBAR
   ===================================================== */
.panel-sidebar { background: var(--bg-raised); border-color: var(--border); }

/* Usercp menu items
   HTML structure: <li><img ...><a href="...">Label</a></li>
   img and a are siblings — flex must go on the li, not on a
*/
.panel-usercp .panel-body ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.panel-usercp .panel-body ul li {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    padding: 0 2px;
    transition: background var(--t);
}
.panel-usercp .panel-body ul li:last-child { border-bottom: none; }
.panel-usercp .panel-body ul li:hover { background: rgba(255,255,255,0.03); }

.panel-usercp .panel-body ul li img {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    opacity: 0.45;
    filter: invert(1);
    display: block;
    /* img is a sibling of <a>, margin-left pushes it inward */
    margin-left: 2px;
}

.panel-usercp .panel-body ul li a {
    flex: 1;
    display: block;
    padding: 10px 0;
    color: #b0b0cc;
    font-size: 13px;
    font-weight: 500;
    transition: color var(--t);
    line-height: 1;
}
.panel-usercp .panel-body ul li:hover a { color: var(--text); }

/* Server info table — flush inside panel, compact rows */
.table-srvinfo { margin-bottom: 0; }
.table-srvinfo > tbody > tr > td {
    padding: 9px 16px;
    font-size: 12px;
    color: #8888a8;
    border-bottom: 1px solid var(--border);
}
.table-srvinfo > tbody > tr:last-child > td { border-bottom: none; }
.table-srvinfo > tbody > tr > td.srv-val {
    text-align: right;
    color: #d0d0e8;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.table-srvinfo > tbody > tr > td.srv-online { color: var(--green); }
.table-srvinfo > tbody > tr:hover > td { background: rgba(255,255,255,0.025); }

/* Login form inside sidebar — reduce panel-body padding slightly */
.panel-sidebar .panel-body { padding: 14px 16px; }

/* Sidebar banners */
.sidebar-banner {
    display: block;
    margin-bottom: 14px;
    border-radius: var(--r-md);
    overflow: hidden;
    border: 1px solid var(--border);
}
.sidebar-banner img { display: block; width: 100%; }

/* =====================================================
   RANKINGS CLASS FILTER
   ===================================================== */
.rankings-class-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
a.rankings-class-filter-selection {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--border-mid);
    border-radius: var(--r);
    color: var(--text-muted);
    transition: all var(--t);
    cursor: pointer;
}
a.rankings-class-filter-selection:hover { color: var(--text); border-color: var(--border-hi); }
a.rankings-class-filter-selection.rankings-class-filter-grayscale { opacity: 0.3; filter: grayscale(1); }
a.rankings-class-filter-selection img { width: 18px; height: 18px; }

/* =====================================================
   ONLINE BAR (used in some modules)
   ===================================================== */
.webengine-online-bar {
    width: 100%;
    height: 3px;
    background: var(--border-mid);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}
.webengine-online-bar-progress {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    min-width: 2px;
    transition: width 1s ease;
}

/* =====================================================
   EVENT SCHEDULE
   ===================================================== */
.event-schedule-open     { color: var(--green); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.event-schedule-inprogress { color: var(--blue); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }

/* =====================================================
   WELLS / CODE
   ===================================================== */
.well {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 16px;
    box-shadow: none;
    color: var(--text-muted);
}

/* =====================================================
   SITE FOOTER
   ===================================================== */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-raised);
}

.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 28px 20px;
}

.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0; margin-bottom: 20px; }
.footer-nav a {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-dim);
    padding: 0 10px;
    border-right: 1px solid var(--border-mid);
    line-height: 1;
    transition: color var(--t);
}
.footer-nav a:first-child { padding-left: 0; }
.footer-nav a:last-child  { border-right: none; }
.footer-nav a:hover { color: var(--text-muted); }

.footer-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.7;
}
.footer-copy p { color: var(--text-dim); margin: 0; }

.footer-socials { display: flex; align-items: center; gap: 8px; }

.footer-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-mid);
    border-radius: var(--r);
    transition: border-color var(--t), opacity var(--t);
    opacity: 0.4;
}
.footer-social-btn:hover { opacity: 1; border-color: var(--border-hi); }
.footer-social-btn img { width: 16px; height: 16px; filter: invert(1); display: block; }

/* =====================================================
   CASTLE WIDGET (sidebar)
   ===================================================== */
.castle-owner-widget {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 14px;
    background: var(--bg-raised) url('../img/castle_owner_bg.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
}
.castle-owner-widget::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(11,11,15,0.78);
}
.castle-owner-widget > * { position: relative; z-index: 1; }

.cw-heading {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.cw-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
}
.cw-body { padding: 14px 16px; }
.cw-footer { margin-top: 12px; text-align: center; }

.cw-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2px;
    margin-top: 8px;
}
.cw-value {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,0.85);
}

.btn-castlewidget {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 0 14px;
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--r);
    cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
    margin-top: 8px;
}
.btn-castlewidget:hover { color: #0b0b0f !important; background: #fff !important; border-color: #fff !important; }

/* =====================================================
   UTILITIES
   ===================================================== */
.text-muted   { color: var(--text-dim) !important; }
.text-primary { color: var(--accent) !important; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }
.text-warning { color: var(--yellow) !important; }
.text-info    { color: var(--blue) !important; }

.nopadding { padding: 0 !important; margin: 0 !important; }
.vcenter { display: inline-block; vertical-align: middle; float: none; }
.pull-right { float: right; }
.pull-left  { float: left; }

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hi); }

::selection { background: rgba(201,165,90,0.2); color: var(--text); }
