/* ========================================================
   DINAS PENDIDIKAN KOTA KEDIRI
   DYNAMIC THEME PALETTE & COMPREHENSIVE DARK MODE SYSTEM
   ======================================================== */

/* Smooth transitions for theme switches */
body,
.rbt-header-wrapper,
.card,
.rbt-card,
.modal-content,
.quick-sidedock-panel,
.quick-sidedock-flyout,
.office-info-pill,
.rbt-footer,
.form-control,
.form-select {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* ========================================================
   DARK MODE OVERRIDES (html[data-theme="dark"])
   ======================================================== */
html[data-theme="dark"] {
  --color-heading: #f8fafc !important;
  --color-body: #94a3b8 !important;
  --color-bodyest: #f1f5f9 !important;
  --color-white: #0f172a !important;       /* Base card & section white replacement */
  --color-white-off: #1e293b !important;   /* Input / off-white replacement */
  --color-light: #0b0f19 !important;       /* Body / section background */
  --color-lighter: #1e293b !important;
  --color-border: #334155 !important;
  --color-border-2: #1e293b !important;
  --color-darker: #020617 !important;
  --color-gray-light: #1e293b !important;
  --color-gray-lighter: #0f172a !important;
  --shadow-primary: 0px 4px 14px rgba(0, 0, 0, 0.5) !important;
  --shadow-1: 0px 6px 30px rgba(0, 0, 0, 0.6) !important;
  --shadow-2: 0 15px 34px rgba(0, 0, 0, 0.7) !important;
  --gradient-1: linear-gradient(#0f172a 0%, #1e293b 100%) !important;
  --gradient-2: linear-gradient(0deg, #0f172a 0%, #1e293b 100%) !important;
  --gradient-4: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
  background-color: #0b0f19 !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] body {
  background-color: #0b0f19 !important;
  color: #94a3b8 !important;
}

/* Top bar marquee */
html[data-theme="dark"] .rbt-header-campaign {
  filter: brightness(0.9);
}

/* Header Navbar */
html[data-theme="dark"] .rbt-header-wrapper,
html[data-theme="dark"] .rbt-header-wrapper.header-sticky,
html[data-theme="dark"] .rbt-header-wrapper.bg-color-white {
  background-color: #0f172a !important;
  border-bottom: 1px solid #1e293b !important;
}

html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu > li > a {
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu > li.active > a,
html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu > li > a:hover {
  color: var(--color-primary) !important;
}

/* Submenu dropdown */
html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu li.has-dropdown .submenu,
html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu li.with-megamenu .rbt-megamenu {
  background-color: #0f172a !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu li.has-dropdown .submenu li a {
  color: #cbd5e1 !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .rbt-header .mainmenu-nav .mainmenu li.has-dropdown .submenu li a:hover {
  color: var(--color-primary) !important;
  background-color: #1e293b !important;
}

/* Round Buttons & Icons in Header */
html[data-theme="dark"] .rbt-round-btn {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .rbt-round-btn:hover {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
}

/* Search Dropdown */
html[data-theme="dark"] .rbt-search-dropdown {
  background-color: #0f172a !important;
  border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .rbt-search-dropdown input {
  background-color: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

/* Cards & Sections */
html[data-theme="dark"] .card,
html[data-theme="dark"] .rbt-card,
html[data-theme="dark"] .rbt-card-body,
html[data-theme="dark"] .bg-color-white,
html[data-theme="dark"] .bg-color-extra2,
html[data-theme="dark"] .bg-color-light,
html[data-theme="dark"] .bg-white {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .rbt-card .rbt-card-body .rbt-card-title a,
html[data-theme="dark"] .rbt-card .rbt-card-title a,
html[data-theme="dark"] h1, 
html[data-theme="dark"] h2, 
html[data-theme="dark"] h3, 
html[data-theme="dark"] h4, 
html[data-theme="dark"] h5, 
html[data-theme="dark"] h6 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .text-dark {
  color: #f1f5f9 !important;
}

html[data-theme="dark"] .text-muted {
  color: #94a3b8 !important;
}

/* Modals */
html[data-theme="dark"] .modal-content {
  background-color: #0f172a !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8) !important;
}

html[data-theme="dark"] .modal-header {
  border-color: #1e293b !important;
}

html[data-theme="dark"] .modal-body,
html[data-theme="dark"] .modal-footer {
  background-color: #0f172a !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .office-info-pill {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}

/* Form inputs & selects */
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background-color: #1e293b !important;
  border-color: var(--color-primary) !important;
  color: #f8fafc !important;
}

/* Footer Area */
html[data-theme="dark"] .footer-style-1,
html[data-theme="dark"] .rbt-footer,
html[data-theme="dark"] .copyright-area {
  background-color: #020617 !important;
  border-top: 1px solid #1e293b !important;
}

/* Side Dock Dark Mode */
html[data-theme="dark"] .quick-sidedock-panel {
  background: #0f172a !important;
  border-color: #334155 !important;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .quick-sidedock-flyout {
  background: #0f172a !important;
  border-color: #334155 !important;
  box-shadow: 8px 0 30px rgba(0, 0, 0, 0.7) !important;
}

html[data-theme="dark"] .sidedock-flyout-header {
  background: #020617 !important;
  border-color: #1e293b !important;
}

html[data-theme="dark"] .sidedock-flyout-header h6 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sidedock-flyout-footer {
  background: #020617 !important;
  border-color: #1e293b !important;
  color: #94a3b8 !important;
}

html[data-theme="dark"] .sidedock-item-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .sidedock-item-card:hover {
  background: #273549 !important;
  border-color: var(--color-primary) !important;
}

html[data-theme="dark"] .sidedock-item-title {
  color: #f8fafc !important;
}

html[data-theme="dark"] .sidedock-item-desc {
  color: #94a3b8 !important;
}

/* Mobile Menu z-index guarantee over Quick Side Dock */
.popup-mobile-menu {
  z-index: 99999 !important;
}
.popup-mobile-menu .inner-wrapper {
  z-index: 99999 !important;
}

body:has(.popup-mobile-menu.active) .quick-sidedock-trigger,
body:has(.popup-mobile-menu.active) .quick-sidedock-flyout,
body:has(.popup-mobile-menu.active) .quick-sidedock-backdrop,
.popup-mobile-menu.active ~ .quick-sidedock-trigger,
.popup-mobile-menu.active ~ .quick-sidedock-flyout,
.popup-mobile-menu.active ~ .quick-sidedock-backdrop {
  z-index: 10 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Logo Switching */
html[data-theme="dark"] .logo .logo-dark {
  display: none !important;
}
html[data-theme="dark"] .logo .logo-light {
  display: block !important;
}
html:not([data-theme="dark"]) .logo .logo-dark {
  display: block !important;
}
html:not([data-theme="dark"]) .logo .logo-light {
  display: none !important;
}

/* ========================================================
   BORDER GRADIENT BUTTONS (Lihat Semua Video & Lihat Semua FAQ)
   ======================================================== */
.rbt-btn.btn-border-gradient {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)) !important;
  transition: all 0.3s ease !important;
  border: none !important;
}

/* Light Mode: White pill with gradient border & theme text */
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient {
  color: var(--color-heading) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06) !important;
}
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient::before {
  background: #ffffff !important;
  transition: background 0.3s ease !important;
}
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient:hover {
  color: #ffffff !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12) !important;
}
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient:hover::before {
  background: transparent !important;
}
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient:hover .btn-text,
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient:hover .btn-icon,
html:not([data-theme="dark"]) .rbt-btn.btn-border-gradient:hover i {
  color: #ffffff !important;
}

/* Dark Mode: Dark pill (#0f172a) with gradient border & clear white text */
html[data-theme="dark"] .rbt-btn.btn-border-gradient {
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary)) !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5) !important;
}
html[data-theme="dark"] .rbt-btn.btn-border-gradient::before {
  background: #0f172a !important;
  transition: background 0.3s ease !important;
}
html[data-theme="dark"] .rbt-btn.btn-border-gradient .btn-text,
html[data-theme="dark"] .rbt-btn.btn-border-gradient .btn-icon,
html[data-theme="dark"] .rbt-btn.btn-border-gradient i {
  color: #f8fafc !important;
}
html[data-theme="dark"] .rbt-btn.btn-border-gradient:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .rbt-btn.btn-border-gradient:hover::before {
  background: transparent !important;
}
html[data-theme="dark"] .rbt-btn.btn-border-gradient:hover .btn-text,
html[data-theme="dark"] .rbt-btn.btn-border-gradient:hover .btn-icon,
html[data-theme="dark"] .rbt-btn.btn-border-gradient:hover i {
  color: #ffffff !important;
}

/* ========================================================
   FAQ SECTION & ACCORDION DARK MODE
   ======================================================== */
html[data-theme="dark"] .faq-section-bg,
html[data-theme="dark"] .service-wrapper.faq-section-bg {
  background-color: #0b0f19 !important;
  border-top: 1px solid #1e293b !important;
  border-bottom: 1px solid #1e293b !important;
}

html[data-theme="dark"] .faq-section-bg .section-title h2.title,
html[data-theme="dark"] .faq-section-bg .section-title .title,
html[data-theme="dark"] .faq-section-bg h2 {
  color: #f8fafc !important;
}

html[data-theme="dark"] .faq-section-bg .section-title p {
  color: #94a3b8 !important;
}

html[data-theme="dark"] .faq-section-bg .section-title .subtitle {
  background: rgba(219, 112, 147, 0.15) !important;
  color: #f472b6 !important;
}

/* Accordion Card */
html[data-theme="dark"] .faq-section-bg .rbt-accordion-style.rbt-accordion-04 .card,
html[data-theme="dark"] .rbt-accordion-style .card,
html[data-theme="dark"] .accordion-item.card {
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

/* Accordion Card Header */
html[data-theme="dark"] .faq-section-bg .rbt-accordion-style.rbt-accordion-04 .card .card-header,
html[data-theme="dark"] .rbt-accordion-style .card .card-header,
html[data-theme="dark"] .accordion-header.card-header {
  background: #0f172a !important;
  border-bottom: 0 none !important;
}

/* Accordion Button (Collapsed) */
html[data-theme="dark"] .rbt-accordion-style .card .card-header button,
html[data-theme="dark"] .rbt-accordion-style .card .card-header button.collapsed,
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .accordion-button.collapsed {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

/* Accordion Button Icon (+ / -) */
html[data-theme="dark"] .rbt-accordion-style .card .card-header button::before,
html[data-theme="dark"] .rbt-accordion-style .card .card-header button.collapsed::before {
  color: #94a3b8 !important;
  opacity: 0.9;
}

/* Accordion Button (Active / Expanded) */
html[data-theme="dark"] .rbt-accordion-style .card .card-header button[aria-expanded="true"],
html[data-theme="dark"] .accordion-button:not(.collapsed) {
  background-color: #0f172a !important;
  color: var(--color-primary) !important;
}

html[data-theme="dark"] .rbt-accordion-style .card .card-header button[aria-expanded="true"]::before {
  color: var(--color-primary) !important;
}

/* Accordion Body */
html[data-theme="dark"] .faq-section-bg .rbt-accordion-style.rbt-accordion-04 .card .card-body,
html[data-theme="dark"] .rbt-accordion-style .card .card-body,
html[data-theme="dark"] .accordion-body.card-body {
  background: #1e293b !important;
  border-top: 1px solid #334155 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .rbt-accordion-style .card .card-body a {
  color: var(--color-primary) !important;
  text-decoration: underline;
}

/* ========================================================
   YOUTUBE & APLIKASI DARK MODE
   ======================================================== */
html[data-theme="dark"] .yt-home-card {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}
html[data-theme="dark"] .yt-home-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .yt-home-date {
  color: #94a3b8 !important;
  border-top-color: #334155 !important;
}
html[data-theme="dark"] .yt-home-channel {
  background: rgba(220, 38, 38, 0.15) !important;
  color: #f87171 !important;
}

html[data-theme="dark"] .dindik-app-section {
  background: #0f172a !important;
  border-top-color: #1e293b !important;
  border-bottom-color: #1e293b !important;
}
html[data-theme="dark"] .dindik-section-badge {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #38bdf8 !important;
}
html[data-theme="dark"] .dindik-app-tile {
  background: #1e293b !important;
  border-color: #334155 !important;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3) !important;
}
html[data-theme="dark"] .dindik-app-tile:hover {
  background: #273549 !important;
  border-color: var(--tile-color, var(--color-primary)) !important;
}
html[data-theme="dark"] .dindik-app-tile-title {
  color: #f8fafc !important;
}
html[data-theme="dark"] .dindik-app-tile-desc {
  color: #94a3b8 !important;
}
html[data-theme="dark"] .dindik-app-tile-footer {
  border-top-color: #334155 !important;
}

/* Dark Mode Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.btn-theme-toggle:hover {
  background: #f1f5f9;
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.btn-theme-toggle i {
  font-size: 17px;
  line-height: 1;
}

html[data-theme="dark"] .btn-theme-toggle {
  background: #1e293b;
  border-color: #475569;
  color: #facc15 !important; /* Golden sun */
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
html[data-theme="dark"] .btn-theme-toggle:hover {
  background: #334155;
  border-color: #facc15;
  color: #fde047 !important;
}

/* Side dock theme toggle item */
.sidedock-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 4px;
}
.sidedock-theme-btn:hover {
  background: #f8fafc;
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: scale(1.08);
}
html[data-theme="dark"] .sidedock-theme-btn {
  background: #1e293b;
  border-color: #475569;
  color: #facc15;
}
html[data-theme="dark"] .sidedock-theme-btn:hover {
  background: #334155;
  border-color: #facc15;
}

/* ========================================================
   COMPREHENSIVE BOOTSTRAP 5 & CORE THEME OVERRIDES
   ======================================================== */
.text-primary, a.text-primary, a.text-primary:hover, a.text-primary:focus {
  color: var(--color-primary) !important;
}
.bg-primary, .badge.bg-primary {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
}
.bg-primary-subtle {
  background-color: var(--color-primary-light, rgba(5, 150, 105, 0.12)) !important;
  color: var(--color-primary) !important;
}
.border-primary, .border-primary-subtle {
  border-color: var(--color-primary) !important;
}
.btn-primary {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
  background-color: var(--color-secondary) !important;
  border-color: var(--color-secondary) !important;
  color: #ffffff !important;
}
.btn-outline-primary {
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
.btn-outline-primary:hover, .btn-outline-primary:focus {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}

/* Pagination */
.page-item.active .page-link,
.pagination .page-item.active .page-link,
.rbt-pagination li.active a,
.rbt-pagination li.active span {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  color: #ffffff !important;
}
.page-link:hover, .rbt-pagination li a:hover {
  color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
.page-link:focus {
  box-shadow: 0 0 0 0.25rem var(--primary-opacity, rgba(5, 150, 105, 0.25)) !important;
}

/* Accessibility & Back-to-top */
.asw-menu-btn, .asw-menu-btn svg, #asw-btn, .sienna-widget button {
  background-color: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
}
.rbt-progress-parent svg.rbt-back-circle path {
  stroke: var(--color-primary) !important;
}
.rbt-progress-parent::after {
  color: var(--color-primary) !important;
}
