/**
 * Softly dark mode — loads AFTER pesktop.css so it wins over legacy #303233 / black rules.
 * Calm charcoal surfaces, soft text, no pure-black panels.
 */

html.darkmode-pending,
html.darkmode-pending body {
  background: #12141a !important;
  color: #e8eaef !important;
}

body.darkmode {
  /* Tokens */
  --primary: #6b9dff;
  --primary-hover: #8bb0ff;
  --primary-light: rgba(107, 157, 255, 0.14);
  --primary-dark: #4d7fe0;
  --accent: #7dd3c0;
  --accent-light: rgba(125, 211, 192, 0.12);
  --accent-hover: #5fc4ad;

  --bg-body: #12141a;
  --bg-primary: #12141a;
  --bg-surface: #1a1d27;
  --bg-surface-elevated: #222632;
  --bg-card: #1a1d27;
  --bg-header: #161922;
  --bg-footer: #0e1016;

  --text-primary: #e8eaef;
  --text-secondary: #b4bcc8;
  --text-muted: #8b93a3;
  --text-on-dark: #e8eaef;
  --text-primary-dynamic: #e8eaef;
  --text-secondary-dynamic: #b4bcc8;

  --border-color: #2c3140;
  --border-light: #252936;
  --border-dynamic: #2c3140;

  --gray-50: #1a1d27;
  --gray-100: #222632;
  --gray-200: #2c3140;
  --gray-300: #3a4152;
  --gray-400: #8b93a3;
  --gray-500: #9aa3b2;
  --gray-600: #b4bcc8;
  --gray-700: #cfd5de;
  --gray-800: #e8eaef;
  --gray-900: #f5f6f8;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-card-hover: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-blue-glow: none;

  color: var(--text-primary) !important;
  background: var(--bg-body) !important;
}

html body.darkmode,
body.darkmode html {
  background: var(--bg-body) !important;
}

/* ---- Shell ---- */
body.darkmode .header {
  background: var(--bg-header) !important;
  box-shadow: 0 1px 0 var(--border-color) !important;
  border-bottom: 1px solid var(--border-color);
}

body.darkmode .content,
body.darkmode .content.uk-container,
body.darkmode {
  background: var(--bg-body) !important;
}

body.darkmode .footer {
  background: var(--bg-footer) !important;
  color: var(--text-secondary) !important;
  float: none !important;
}

body.darkmode .footer_2 {
  background: #0a0c10 !important;
  color: var(--text-muted) !important;
  border-top: 1px solid var(--border-color);
}

body.darkmode .footer a,
body.darkmode .footer_title,
body.darkmode .footer_title a {
  color: var(--text-secondary) !important;
}

body.darkmode .footer a:hover {
  color: var(--primary) !important;
}

/* ---- Typography (stop washing every link to #eee) ---- */
body.darkmode,
body.darkmode p,
body.darkmode .dec-short,
body.darkmode .size_large,
body.darkmode .x3,
body.darkmode .program-main_v2,
body.darkmode .gird3 .program-main_v2 {
  color: var(--text-secondary) !important;
}

body.darkmode h1,
body.darkmode h2,
body.darkmode h3,
body.darkmode h4,
body.darkmode .text-name,
body.darkmode .deatlis_lable_v2,
body.darkmode .dectaion h2,
body.darkmode .section-headline-wrap h1,
body.darkmode .program_show_title,
body.darkmode h1.program_show_title {
  color: var(--text-primary) !important;
}

body.darkmode a {
  color: var(--primary) !important;
}

body.darkmode a:hover {
  color: var(--primary-hover) !important;
  opacity: 1 !important;
}

body.darkmode .text-name,
body.darkmode a .text-name,
body.darkmode .program-main_v2 a {
  color: var(--text-primary) !important;
}

body.darkmode .program-main_v2 a:hover .text-name {
  color: var(--primary) !important;
}

/* Don't force every icon white — kills brand/status colors */
body.darkmode i {
  color: inherit;
}

body.darkmode .header_2.hidfrom {
  background: #161922 !important;
  border-color: #2c3140 !important;
}

body.darkmode .softly-menu-toggle,
body.darkmode #serach_ico {
  color: #e8eaef !important;
}

/* ---- Cards / surfaces ---- */
body.darkmode .program-main_v2,
body.darkmode .tags_body,
body.darkmode .program_deatils_v2,
body.darkmode .comments_v2,
body.darkmode .slider_v2,
body.darkmode .dectaion,
body.darkmode .section_label_v2,
body.darkmode .section-headline-wrap,
body.darkmode .uk-card-default,
body.darkmode .uk-card.uk-card-default.uk-card-body.page,
body.darkmode .praimry_comment,
body.darkmode .a728_90,
body.darkmode .a300_600,
body.darkmode div#download-page,
body.darkmode .pesktop-download-card,
body.darkmode .tags_body .widget-wrapper,
body.darkmode .tags_body .widget {
  background: var(--bg-surface) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
  box-shadow: var(--shadow-card) !important;
}

body.darkmode .section-headline-wrap {
  background: var(--bg-surface) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

body.darkmode .section_label_v2 {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px 10px 0 0;
}

body.darkmode .program-main_v2 {
  border: 1px solid var(--border-color) !important;
  border-radius: 10px;
}

body.darkmode .program-main_v2:hover {
  border-color: #3d4558 !important;
  box-shadow: var(--shadow-card-hover) !important;
}

body.darkmode .program-main_v2 .x2 {
  border-left-color: var(--border-color) !important;
  border-right-color: transparent !important;
}

body.darkmode .program-main_v2 .x3 {
  border-color: var(--border-color) !important;
}

body.darkmode .program_img_v2,
body.darkmode .gird3 .program_img_v2 {
  background: var(--bg-surface-elevated) !important;
}

body.darkmode .deatlis_lable_v2,
body.darkmode .program_deatils_v2 .uk-list > :nth-child(n + 2),
body.darkmode .x2 {
  border-color: var(--border-color) !important;
}

/* ---- Search ---- */
body.darkmode .header .search input,
body.darkmode .search input,
body.darkmode .uk-search-input,
body.darkmode .uk-search-default .uk-search-input {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

body.darkmode .uk-search-input::placeholder {
  color: var(--text-muted) !important;
}

body.darkmode div#result2,
body.darkmode div#result4 {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-card) !important;
}

body.darkmode .result-aerch {
  color: var(--text-primary) !important;
}

body.darkmode .result-aerch:hover {
  background: var(--bg-surface-elevated) !important;
}

/* ---- Forms / comments ---- */
body.darkmode .comment_box textarea,
body.darkmode input[type="text"],
body.darkmode input[type="email"],
body.darkmode input[type="password"],
body.darkmode input[type="search"],
body.darkmode input[type="url"],
body.darkmode textarea,
body.darkmode select {
  background: var(--bg-surface-elevated) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
}

body.darkmode .addcoment,
body.darkmode button.addcoment {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.darkmode .download_link,
body.darkmode a.download_link {
  color: #fff !important;
}

/* ---- Dropdowns / modals ---- */
body.darkmode .uk-dropdown,
body.darkmode .header_3,
body.darkmode #aw23 {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-primary) !important;
}

body.darkmode .uk-dropdown a,
body.darkmode .header_3 a,
body.darkmode .langbutm a,
body.darkmode .sections li a,
body.darkmode .lang a {
  color: var(--text-secondary) !important;
}

body.darkmode .uk-dropdown a:hover,
body.darkmode .langbutm li:hover a {
  color: var(--text-primary) !important;
  background: var(--bg-surface-elevated) !important;
}

body.darkmode .uk-modal-dialog {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color);
}

body.darkmode #ser .search,
body.darkmode #cus.search {
  background: var(--bg-surface) !important;
}

/* ---- Pagination / filters ---- */
body.darkmode .uk-pagination > li > a,
body.darkmode .uk-pagination > li > span {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
}

body.darkmode .uk-pagination > li > a:hover,
body.darkmode .uk-pagination > li.uk-active > * {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}

body.darkmode .filter-options .custom-input input ~ span {
  background: var(--bg-surface-elevated) !important;
  border-color: #4a5163 !important;
}

body.darkmode .filter-widget-title,
body.darkmode .tags_body .widget-title,
body.darkmode .tags_list ul li a {
  color: var(--text-primary) !important;
}

body.darkmode .tags_list ul li a:hover {
  color: var(--primary) !important;
}

/* ---- Single / download ---- */
body.darkmode .down-page,
body.darkmode .pesktop-download-page {
  border-color: var(--border-color) !important;
  background: transparent !important;
}

body.darkmode .pesktop-download-title,
body.darkmode .pesktop-download-name,
body.darkmode .pesktop-download-name a {
  color: var(--text-primary) !important;
}

body.darkmode .pesktop-download-help,
body.darkmode .pesktop-download-help li {
  color: var(--text-muted) !important;
}

body.darkmode .program_deatils_v2 .uk-float-left,
body.darkmode li.download_links {
  color: var(--text-muted) !important;
}

/* ---- Misc legacy overrides ---- */
body.darkmode .section_box {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-card) !important;
}

body.darkmode .sys {
  background: transparent !important;
  color: var(--text-muted) !important;
}

body.darkmode .uk-button-default {
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  background: var(--bg-surface-elevated) !important;
}

body.darkmode .uk-breadcrumb > * > *,
body.darkmode .uk-breadcrumb > :nth-child(n + 2):not(.uk-first-column)::before {
  color: var(--text-muted) !important;
}

body.darkmode .uk-breadcrumb a {
  color: var(--primary) !important;
}

/* Dark toggle looks intentional */
body.darkmode .switch .slider {
  background-color: #3a4152 !important;
}

body.darkmode input:checked + .slider {
  background-color: var(--primary) !important;
}

body.darkmode span.slider.round i {
  color: #fbbf24 !important;
}

/* Soft primary chips stay readable */
body.darkmode .program_version,
body.darkmode .program_tag,
body.darkmode .tag {
  color: #fff !important;
}
