/* ============================================================
   ADV Radius — custom premium theme + DARK MODE (overrides prosilver)
   Loaded after prosilver CSS. RTL-safe (logical properties).
   Dark mode = html.adv-dark (toggled + persisted via JS).
   ============================================================ */
:root{
  --navy:#0d2440; --navy2:#143a63; --blue:#1e6fd9; --blue-lt:#2f8ae0; --cyan:#12b0e6;
  --accent:#1e6fd9; --link:#1e6fd9; --link-h:#0d2440;
  --bg:#e9eef5; --page-glow1:rgba(30,111,217,.10); --page-glow2:rgba(18,176,230,.08);
  --card:#ffffff; --card-2:#f4f8fd; --ink:#213247; --muted:#6a7b8e; --line:#dde5ee;
  --hdr:linear-gradient(125deg,#0d2440 0%,#143a63 52%,#1b4f86 100%);
  --cat:linear-gradient(120deg,#0d2440,#1e6fd9);
  --radius:14px; --shadow:0 2px 10px rgba(13,36,64,.07); --shadow-hi:0 8px 26px rgba(13,36,64,.14);
}

/* ---------- theme switching = INSTANT. NO transition on color/background whose value
   comes from var() — it gets stuck mid-fade on a live toggle (elements stay ~light). */

/* ---------- base / typography ---------- */
html{ scroll-behavior:smooth; }
body,input,select,textarea,button,.forumtitle,.topictitle,.navbar,.postbody,.content,
h1,h2,h3,dl.row-item dt .list-inner{ font-family:'Cairo','Segoe UI',Tahoma,Arial,sans-serif !important; }
body{
  color:var(--ink) !important;
  background:
    radial-gradient(1200px 420px at 100% -10%, var(--page-glow1), transparent 60%),
    radial-gradient(1000px 400px at 0% -6%, var(--page-glow2), transparent 55%),
    var(--bg) !important;
}
.wrap{ max-width:1180px; }
a{ color:var(--link); }
a:hover{ color:var(--link-h); }

/* ---------- header ---------- */
#site-header,.headerbar{ background:transparent; }
.headerbar{
  position:relative; overflow:hidden; background:var(--hdr) !important;
  border-radius:var(--radius); box-shadow:0 10px 28px rgba(13,36,64,.24);
  padding:20px 26px; margin-bottom:14px;
  border:1px solid rgba(255,255,255,.06);
}
.headerbar::after{
  content:""; position:absolute; inset-block-start:-60%; inset-inline-end:-6%;
  width:360px; height:360px; border-radius:50%;
  background:radial-gradient(circle,rgba(18,176,230,.38),transparent 62%); pointer-events:none;
}
.headerbar,.headerbar a,.headerbar .site-description h1 a,.headerbar .site-description p{ color:#eaf3ff !important; }
.site-description h1{ font-weight:800; letter-spacing:.3px; }
.site-description p{ opacity:.85; }
#search-box{ position:relative; z-index:2; }
#search-box .inputbox{ border-radius:10px; border:0; box-shadow:0 2px 8px rgba(0,0,0,.18); }
#search-box .button-search,#search-box .button-search-end{ background:var(--cyan); border-color:var(--cyan); }

/* ---------- navbar ---------- */
.navbar{ background:var(--card) !important; border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:14px; }
.navbar .linklist{ padding:4px 8px; }
#nav-main>li>a,#nav-breadcrumbs>li>a{ border-radius:8px; }
#nav-main>li>a:hover{ background:rgba(30,111,217,.10); color:var(--link-h); }
#nav-main>li>a[href*="demo.advnodes.net"],#nav-main>li>a[href*="adv64.iso"]{ color:var(--blue) !important; font-weight:700; }
#adv-theme-toggle{ cursor:pointer; }
#adv-theme-toggle .icon{ color:var(--blue); }

/* ---------- category blocks ---------- */
.forabg{ background:transparent !important; border:0 !important; border-radius:var(--radius) !important; box-shadow:var(--shadow); overflow:hidden; margin-bottom:16px; }
.forabg>.inner{ border-radius:var(--radius); overflow:hidden; background:var(--card); border:1px solid var(--line); }
.forabg ul.topiclist>li.header{ background:var(--cat) !important; border-bottom:2px solid rgba(18,176,230,.55); }
.forabg li.header dl.row-item dt .list-inner{ color:#eaf3ff !important; font-weight:800; font-size:1.05em; letter-spacing:.2px; padding-block:11px; }
.forabg li.header dd{ color:#cfe0f4 !important; font-weight:600; }
.forabg ul.topiclist.forums{ background:var(--card); }
.forabg ul.topiclist.forums li.row{ background:var(--card); }
.forabg ul.topiclist.forums li.row:hover{ background:var(--card-2); }
dl.row-item{ border-bottom:1px solid var(--line) !important; }
.forabg ul.topiclist.forums li.row dl{ padding-block:9px; border-inline-start:3px solid transparent; }
.forabg ul.topiclist.forums li.row:hover dl{ border-inline-start-color:var(--blue); }
a.forumtitle{ color:var(--ink) !important; font-weight:800; font-size:1.16em; }
a.forumtitle:hover{ color:var(--blue) !important; text-decoration:none; }
.forum-image .icon{ color:var(--blue) !important; }
dl.row-item dd.topics,dl.row-item dd.posts{ color:var(--muted); }

/* generic forumbg (viewforum etc.) */
.forumbg{ background:var(--card) !important; border:1px solid var(--line) !important; border-radius:var(--radius) !important; box-shadow:var(--shadow); overflow:hidden; }
.forumbg ul.topiclist>li.header{ background:var(--cat) !important; }
.forumbg li.header dl>dt,.forumbg li.header dl>dd{ color:#eaf3ff !important; font-weight:700; }
a.topictitle{ color:var(--ink) !important; font-weight:700; }
a.topictitle:hover{ color:var(--blue) !important; }

/* ---------- buttons ---------- */
.button,a.button,input.button1,input.button2,.submit.button1{ border-radius:10px !important; font-family:'Cairo',sans-serif !important; font-weight:700; transition:transform .12s ease,box-shadow .15s ease,background .15s ease,border-color .15s ease; }
.button.button-secondary{ border-color:var(--line); color:var(--ink); background:var(--card); }
.button-search,.button-primary,a.button1,input.button1,.submit.button1{ background:linear-gradient(120deg,var(--blue),var(--blue-lt)) !important; border-color:var(--blue) !important; color:#fff !important; box-shadow:0 3px 10px rgba(30,111,217,.28); }
.button-primary:hover,a.button1:hover,input.button1:hover,.button-search:hover{ background:var(--navy) !important; border-color:var(--navy) !important; transform:translateY(-1px); box-shadow:0 6px 16px rgba(13,36,64,.30); }

/* ---------- panels / posts / blocks ---------- */
.panel,.post,.postbody{ border-radius:var(--radius) !important; }
.post{ box-shadow:var(--shadow); background:var(--card); }
.stat-block,.online-list,.panel{ border-radius:var(--radius); background:var(--card); border:1px solid var(--line); box-shadow:var(--shadow); padding:14px 16px; }
h3{ color:var(--ink); }
dl.details dt{ color:var(--muted); }
.inputbox{ border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--ink); }
.dropdown-container .dropdown,.notification_list{ border-radius:12px; box-shadow:var(--shadow-hi); border:1px solid var(--line); overflow:hidden; background:var(--card); }
.badge{ background:var(--blue); border-radius:10px; }
#page-footer .copyright{ color:var(--muted); }
hr{ border-color:var(--line); }
::selection{ background:rgba(30,111,217,.22); }
*::-webkit-scrollbar{ width:11px; height:11px; }
*::-webkit-scrollbar-thumb{ background:#c3cfdd; border-radius:8px; border:2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover{ background:#9fb2c6; }

/* ============================================================
   DARK MODE
   ============================================================ */
html.adv-dark{
  --bg:#0e1622; --page-glow1:rgba(30,111,217,.16); --page-glow2:rgba(18,176,230,.10);
  --card:#172433; --card-2:#1e2d40; --ink:#dbe6f1; --muted:#93a6ba; --line:#29394d;
  --link:#4c9bea; --link-h:#7dc0ff;
  --hdr:linear-gradient(125deg,#0a1a30 0%,#102a4a 55%,#123a63 100%);
  --cat:linear-gradient(120deg,#0c2140,#1a5bb0);
  --shadow:0 2px 12px rgba(0,0,0,.35); --shadow-hi:0 10px 30px rgba(0,0,0,.5);
}
html.adv-dark body{ color:var(--ink) !important; }
html.adv-dark .headerbar{ box-shadow:0 10px 30px rgba(0,0,0,.5); border-color:rgba(255,255,255,.05); }
html.adv-dark .navbar,html.adv-dark .forabg>.inner,html.adv-dark .forumbg,
html.adv-dark .post,html.adv-dark .panel,html.adv-dark .stat-block,html.adv-dark .online-list{ background:var(--card) !important; border-color:var(--line) !important; }
html.adv-dark #nav-main>li>a:hover{ background:rgba(76,155,234,.14); color:var(--link-h); }
html.adv-dark .forabg ul.topiclist.forums li.row,html.adv-dark .forabg ul.topiclist.forums{ background:var(--card) !important; }
html.adv-dark .forabg ul.topiclist.forums li.row:hover{ background:var(--card-2) !important; }
html.adv-dark a.forumtitle,html.adv-dark a.topictitle,html.adv-dark h3,html.adv-dark .content{ color:var(--ink) !important; }
html.adv-dark a.forumtitle:hover,html.adv-dark a.topictitle:hover{ color:var(--link-h) !important; }
html.adv-dark .inputbox{ background:#0f1b2a !important; border-color:var(--line) !important; color:var(--ink) !important; }
html.adv-dark #search-box .inputbox{ background:rgba(255,255,255,.10) !important; color:#fff; }
html.adv-dark .button.button-secondary{ background:var(--card-2); color:var(--ink); border-color:var(--line); }
html.adv-dark .dropdown-container .dropdown,html.adv-dark .notification_list{ background:var(--card) !important; border-color:var(--line) !important; }
html.adv-dark table.table1 tbody td,html.adv-dark .forumbg td,html.adv-dark dl.row-item{ border-color:var(--line) !important; }
html.adv-dark *::-webkit-scrollbar-thumb{ background:#33465c; border-color:var(--bg); }
html.adv-dark #page-body,html.adv-dark .page-body{ color:var(--ink); }

/* --- comprehensive dark surfaces (forms, panels, tables, bg1/2/3, ucp/mcp) --- */
html.adv-dark .bg1,html.adv-dark .bg2,html.adv-dark .bg3,
html.adv-dark .panel,html.adv-dark .panel.bg1,html.adv-dark .panel.bg2,html.adv-dark .panel.bg3,
html.adv-dark .panel .inner,html.adv-dark table.table1,html.adv-dark table.table1 tbody tr,
html.adv-dark table.table1 td,html.adv-dark table.table1 th,html.adv-dark .cp-main,html.adv-dark .cp-mini,
html.adv-dark .cp-content,html.adv-dark .cp-menu,html.adv-dark .action-bar,html.adv-dark fieldset.fields1,
html.adv-dark fieldset.fields2,html.adv-dark .codebox,html.adv-dark .notice,html.adv-dark dl.mini,
html.adv-dark .phpbb_alert,html.adv-dark .post,html.adv-dark .postbody,html.adv-dark .post .content,
html.adv-dark .forabg,html.adv-dark .forumbg{
  background-color:var(--card) !important; color:var(--ink) !important; border-color:var(--line) !important;
}
html.adv-dark .bg2,html.adv-dark .panel.bg2,html.adv-dark blockquote,html.adv-dark .codebox,
html.adv-dark .cp-mini{ background-color:var(--card-2) !important; }
html.adv-dark .content,html.adv-dark .postbody,html.adv-dark p,html.adv-dark td,html.adv-dark li,
html.adv-dark dt,html.adv-dark dd,html.adv-dark label,html.adv-dark h1,html.adv-dark h2,html.adv-dark h4,
html.adv-dark .cp-main h2,html.adv-dark fieldset dl>dt,html.adv-dark .column1,html.adv-dark .column2,
html.adv-dark strong,html.adv-dark .author{ color:var(--ink); }
/* form fields (content) — NOT the header search box */
html.adv-dark .inputbox,html.adv-dark input.inputbox,html.adv-dark textarea,html.adv-dark textarea.inputbox,
html.adv-dark select,html.adv-dark select.inputbox,html.adv-dark input[type=text],html.adv-dark input[type=password],
html.adv-dark input[type=email],html.adv-dark input[type=number],html.adv-dark input[type=search]{
  background-color:#0f1b2a !important; color:var(--ink) !important; border-color:var(--line) !important;
}
html.adv-dark #search-box .inputbox{ background-color:rgba(255,255,255,.10) !important; color:#fff !important; }
html.adv-dark .button2,html.adv-dark input.button2,html.adv-dark a.button2,
html.adv-dark .button.button-secondary{ background:var(--card-2) !important; color:var(--ink) !important; border-color:var(--line) !important; }
/* re-assert LIGHT text on the gradient header/category bars (overrides the td/dd color rule above) */
html.adv-dark li.header dl.row-item dt .list-inner,html.adv-dark .forabg li.header dt,
html.adv-dark .forabg li.header dd,html.adv-dark .forumbg li.header dt,html.adv-dark .forumbg li.header dd,
html.adv-dark ul.topiclist li.header dd,html.adv-dark ul.topiclist li.header dt{ color:#eaf3ff !important; }
html.adv-dark .navbar{ background-color:var(--card) !important; }
html.adv-dark hr,html.adv-dark .divider,html.adv-dark fieldset,html.adv-dark dl.row-item{ border-color:var(--line) !important; }
html.adv-dark .pagination a,html.adv-dark .pagination span{ background:var(--card-2) !important; color:var(--ink) !important; border-color:var(--line) !important; }
html.adv-dark .pagination .active span{ background:var(--blue) !important; color:#fff !important; }
/* editor panel tabs (posting page: Options / Attachments) */
html.adv-dark .minitabs li a,html.adv-dark #minitabs li a,html.adv-dark ul.tabs li a,
html.adv-dark li.tab>a,html.adv-dark .tabs-container li a{ background:var(--card-2) !important; color:var(--muted) !important; border-color:var(--line) !important; }
html.adv-dark li.tab.activetab>a,html.adv-dark li.activetab>a,html.adv-dark #minitabs li.activetab a{ background:var(--card) !important; color:var(--ink) !important; }

/* --- dark text-contrast fixes --- */
html.adv-dark a{ color:var(--link); }
html.adv-dark a:hover{ color:var(--link-h); }
html.adv-dark a.mark-read,html.adv-dark .rightside>a,html.adv-dark .action-bar a,
html.adv-dark #nav-main>li>a,html.adv-dark #nav-breadcrumbs a{ color:var(--link) !important; }
html.adv-dark #nav-main>li>a span,html.adv-dark .navbar a span{ color:inherit !important; }
/* readable group/username colours in dark: brighten any INLINE colour (keeps the hue).
   :not([style*=background]) so inline background-colours aren't brightened. */
html.adv-dark .username-coloured,html.adv-dark a.username-coloured,
html.adv-dark [style*="color:"]:not([style*="background"]){ filter:brightness(1.95) saturate(1.08); }
/* keep gradient-bar text pure light (no filter/link colour leaking in) */
html.adv-dark li.header dl.row-item dt .list-inner,html.adv-dark ul.topiclist li.header dt,
html.adv-dark ul.topiclist li.header dd{ color:#eaf3ff !important; filter:none; }

/* --- floating dark-mode toggle (prominent, always visible) --- */
#adv-dark-fab{
  position:fixed; inset-block-end:22px; inset-inline-start:22px; z-index:99999;
  width:56px; height:56px; border-radius:50%; border:0; cursor:pointer; padding:0;
  background:linear-gradient(135deg,#0d2440,#1e6fd9); color:#fff; font-size:25px; line-height:1;
  box-shadow:0 8px 22px rgba(13,36,64,.42); display:flex; align-items:center; justify-content:center;
}
#adv-dark-fab:hover{ transform:translateY(-3px) scale(1.06); box-shadow:0 12px 28px rgba(13,36,64,.52); }
#adv-dark-fab:active{ transform:scale(.95); }
html.adv-dark #adv-dark-fab{ background:linear-gradient(135deg,#f7c948,#f39c12); box-shadow:0 8px 22px rgba(0,0,0,.5); }

/* --- per-forum custom icons (forum_image) --- */
.forum-image{ display:inline-flex; align-items:center; justify-content:center;
  width:46px; height:46px; margin-inline-end:10px; border-radius:12px;
  background:rgba(30,111,217,.08); vertical-align:middle; flex:0 0 auto; }
.forum-image img{ width:32px; height:32px; }
html.adv-dark .forum-image{ background:rgba(76,155,234,.12); }
/* the forum row title area sits inline with the icon */
li.row dl.row-item>dt{ display:flex; align-items:center; }
li.row dl.row-item>dt .list-inner{ flex:1 1 auto; }

/* ============================================================
   GUIDE 3-LANGUAGE SWITCHER (English / عربي فصحى / مصري)
   Segments delimited in post body by @@LANG=EN/AR/EG@@ markers,
   wrapped by JS into .adv-seg blocks; toggled by html[data-advlang].
   ============================================================ */
.adv-seg{ display:none; }
.adv-seg-common{ display:block; }              /* shared preamble (before first marker) */
html[data-advlang="en"] .adv-seg-en,
html[data-advlang="ar"] .adv-seg-ar,
html[data-advlang="eg"] .adv-seg-eg,
html[data-advlang="tr"] .adv-seg-tr,
html[data-advlang="fr"] .adv-seg-fr,
html[data-advlang="hi"] .adv-seg-hi,
html[data-advlang="ur"] .adv-seg-ur{ display:block; }
.adv-seg-en,.adv-seg-tr,.adv-seg-fr,.adv-seg-hi{ direction:ltr; text-align:left; }
.adv-seg-en ul,.adv-seg-en ol,.adv-seg-tr ul,.adv-seg-tr ol,
.adv-seg-fr ul,.adv-seg-fr ol,.adv-seg-hi ul,.adv-seg-hi ol{ text-align:left; }
.adv-seg-ur{ direction:rtl; text-align:right; }

/* sticky language bar at top of the topic */
#adv-langbar{
  position:sticky; top:0; z-index:60;
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
  padding:10px 14px; margin:0 0 16px;
  background:var(--hdr); border:1px solid rgba(255,255,255,.08);
  border-radius:var(--radius); box-shadow:0 6px 18px rgba(13,36,64,.22);
}
#adv-langbar .adv-lb-label{ color:#eaf3ff; font-weight:800; font-size:15px; margin-inline-end:4px; }
#adv-langbar button{
  cursor:pointer; font-family:'Cairo','Segoe UI',sans-serif; font-weight:700; font-size:15px;
  color:#dbe8fb; background:rgba(255,255,255,.10); border:1px solid rgba(255,255,255,.18);
  padding:7px 18px; border-radius:9px; transition:background .15s ease,transform .1s ease,box-shadow .15s ease;
}
#adv-langbar button:hover{ background:rgba(255,255,255,.20); transform:translateY(-1px); }
#adv-langbar button.active{
  background:linear-gradient(120deg,var(--cyan),var(--blue-lt)); color:#fff;
  border-color:var(--cyan); box-shadow:0 3px 10px rgba(18,176,230,.4);
}
html.adv-dark #adv-langbar{ border-color:rgba(255,255,255,.06); }
/* avoid the raw-markers flash before JS runs: hide content that still holds a marker
   is not possible in CSS, so JS wraps on DOMContentLoaded (single guide post = negligible). */

/* global language selector injected into the navbar (available from ANY page) */
#adv-lang-nav{ display:flex; align-items:center; gap:6px; padding:0 6px; }
#adv-lang-nav .adv-nav-globe{ font-size:15px; line-height:1; }
#adv-lang-select{
  font-family:'Cairo','Segoe UI',sans-serif; font-weight:700; font-size:13.5px;
  color:var(--ink); background:var(--card-2); border:1px solid var(--line);
  border-radius:8px; padding:4px 8px; cursor:pointer; max-width:150px;
}
#adv-lang-select:hover{ border-color:var(--blue); }
#adv-lang-select:focus{ outline:none; border-color:var(--blue); box-shadow:0 0 0 2px rgba(30,111,217,.18); }
html.adv-dark #adv-lang-select{ background:#0f1b2a; color:var(--ink); border-color:var(--line); }
html.adv-dark #adv-lang-select option{ background:#0f1b2a; color:var(--ink); }

/* site-wide Google Translate widget (any language) — the guide body is notranslate */
#adv-gtrans-li{ display:flex; align-items:center; gap:5px; padding:0 6px; }
#google_translate_element{ display:inline-block; vertical-align:middle; }
.goog-te-gadget{ font-size:0 !important; color:transparent !important; font-family:'Cairo',sans-serif !important; }
.goog-te-gadget .goog-te-combo{
  font-size:13.5px !important; font-weight:700; color:var(--ink);
  background:var(--card-2); border:1px solid var(--line); border-radius:8px; padding:4px 8px; margin:0; cursor:pointer; max-width:150px;
}
.goog-te-gadget .goog-te-combo:hover{ border-color:var(--blue); }
.goog-te-gadget span,.goog-logo-link{ display:none !important; }
html.adv-dark .goog-te-gadget .goog-te-combo{ background:#0f1b2a; color:var(--ink); border-color:var(--line); }
/* neutralize Google's top banner + body shift */
.goog-te-banner-frame,.skiptranslate iframe.goog-te-banner-frame{ display:none !important; visibility:hidden !important; }
body{ top:0 !important; position:static !important; }
.goog-tooltip,.goog-tooltip:hover{ display:none !important; }
.goog-text-highlight{ background:none !important; box-shadow:none !important; }
