/* ===============================
   MOBILE BOTTOM NAVIGATION
================================= */

.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-bottom-nav-height);
    background: #ffffff;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.mobile-bottom-nav a {
    text-decoration: none;
    color: #777;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    /* Was "transition: 0.2s ease" with no property - implicitly `all`,
       which transitions layout properties this rule never actually
       changes. Named explicitly to the two properties the rules below
       (.active color, :active transform) actually animate. */
    transition: transform 0.2s ease, color 0.2s ease;
}

.mobile-bottom-nav a.active {
    color: var(--brand-green-legacy);
}

.mobile-bottom-nav a:active {
    transform: scale(0.95);
}

.mobile-bottom-nav i {
    font-size: 20px;
    margin-bottom: 2px;
}

.mobile-badge {
    position: absolute;
    top: -3px;
    right: -8px;
    background: red;
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 50px;
    font-weight: bold;
}

body {
    padding-bottom: 80px;
}

/* Hide bottom nav on desktop */
@media(min-width: 768px){
    .mobile-bottom-nav {
        display: none;
    }
}

/* ===============================
   KNOWLEDGE BASE FLOATING
================================= */

/* Floating button */
#kb-widget-btn {
  position: fixed;
  bottom: 20px; /* Default for desktop */
  right: 20px;
  background: var(--brand-green);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  z-index: 10000;
  transition: all 0.3s ease;
}

/* Widget panel */
#kb-widget-panel {
  position: fixed;
  bottom: 90px; /* Default desktop spacing */
  right: 20px;
  width: 350px;
  height: 450px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 10000;
}

#kb-widget-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

/* Header */
#kb-header {
  background: var(--brand-green);
  color: white;
  padding: 12px;
  text-align: center;
  font-weight: bold;
  position: relative;
}

#kb-close {
  position: absolute;
  right: 12px;
  top: 10px;
  cursor: pointer;
  font-size: 16px;
}

/* Search bar */
#kb-search {
  width: 90%;
  margin: 10px auto;
  display: block;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* Tabs */
#kb-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
}

#kb-tabs button {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f9f9f9;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

#kb-tabs button:hover {
  background: #f1f1f1;
}

#kb-tabs button.active {
  background: #fff;
  border-bottom: 2px solid var(--brand-green);
}

/* Content */
.kb-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: none;
}

.kb-content.active { 
  display: block; 
}

.kb-item {
  margin-bottom: 18px;
  color: var(--brand-green);
}

.video-title {
  font-weight: bold;
  margin-bottom: 6px;
  font-size: 14px;
}

.kb-item iframe {
  width: 100%;
  height: 180px;
  border: none;
  border-radius: 8px;
}

/* Scrollbar */
.kb-content::-webkit-scrollbar {
  width: 6px;
}

.kb-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

/* ===============================
   MOBILE FIX (IMPORTANT)
================================= */

@media (max-width: 768px) {

  /* Push floating button above bottom nav */
  #kb-widget-btn {
    bottom: 95px; /* 65px nav + 30px spacing */
    right: 15px;
  }

  /* Push panel above button */
  #kb-widget-panel {
    bottom: 170px;
    right: 15px;
    width: 95%;
    height: 80%;
    border-radius: 12px;
  }

}















/* ================= SEARCH PAGE================= */

#mobileSearchOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000; /* Dark like X */
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

#mobileSearchOverlay.active {
    transform: translateX(0);
}

/* Top Search Bar */
.search-top-bar {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #000;
    border-bottom: 1px solid #222;
}

.search-top-bar i {
    color: #fff;
    font-size: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.search-top-bar input {
    flex: 1;
    height: 40px;
    border-radius: 25px;
    border: none;
    padding: 0 15px;
    background: #1a1a1a;
    color: #fff;
    font-size: 14px;
}

.search-top-bar input:focus {
    outline: none;
}

.search-top-bar button {
    background: none;
    border: none;
    color: #1d9bf0;
    font-size: 18px;
    margin-left: 8px;
    cursor: pointer;
}

/* Content Area */
.search-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    color: #fff;
}

/* Placeholder text */
.search-placeholder h4 {
    margin-bottom: 5px;
}

.search-placeholder p {
    font-size: 14px;
    color: #aaa;
}





/* ================= POPUP TO SHOW ON TOP OF HEADER AND BUTTOM================= */




/* Make popup modal appear above header and bottom nav */
.modal{
    z-index: 10550 !important;
}

.modal-backdrop{
    z-index: 10540 !important;
}

/* Prevent header from covering modal */
.navbar,
header{
    z-index: 1000;
}

/* Prevent mobile bottom nav from covering modal */
.mobile-bottom-nav{
    z-index: 1000;
}

/* Add spacing so modal is not hidden under header */
@media (max-width:768px){
    .modal-dialog{
        margin-top: 80px;
        margin-bottom: 80px;
    }
}














/* =========================
   KB WIDGET DARK MODE
========================= */

html.dark #kb-widget-panel {
  background-color: #1e1e1e !important;
  color: #eaeaea !important;
  border: 1px solid #2a2a2a !important;
}

/* header */
html.dark #kb-header {
  background-color: #181818 !important;
  color: #ffffff !important;
  border-bottom: 1px solid #2a2a2a !important;
}

/* close button */
html.dark #kb-close {
  color: #ffffff !important;
}

/* search area */
html.dark #kb-widget-panel input#kb-search {
  background-color: #2a2a2a !important;
  border: 1px solid #444 !important;
  color: #fff !important;
}

html.dark #kb-widget-panel input#kb-search::placeholder {
  color: #aaa !important;
}

/* tabs container */
html.dark #kb-tabs {
  border-bottom: 1px solid #2a2a2a !important;
}

/* tab buttons */
html.dark .tab-btn {
  background-color: transparent !important;
  color: #bbb !important;
  border: none !important;
}

html.dark .tab-btn.active {
  background-color: #2a2a2a !important;
  color: #fff !important;
  border-radius: 5px;
}

/* video items */
html.dark .kb-item {
  background-color: #1e1e1e !important;
  border-bottom: 1px solid #2a2a2a !important;
}

/* video title */
html.dark .video-title {
  color: #eaeaea !important;
}

/* contact section */
html.dark #kb-contact-container {
  background-color: #181818 !important;
  border-top: 1px solid #2a2a2a !important;
}

/* contact button */
html.dark #kb-contact-container a {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #fff !important;
}

/* floating button */
html.dark #kb-widget-btn {
  background-color: #2a2a2a !important;
  color: #fff !important;
  border: 1px solid #444 !important;
}

/* panel shadow in dark mode */
html.dark #kb-widget-panel {
  box-shadow: 0 10px 30px rgba(0,0,0,0.7) !important;
}









.roladel-referral-box{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    padding:22px;
    background:linear-gradient(180deg,#1c1c1c,#121212);
    border:1px solid #2d2d2d;
    border-radius:16px;
    overflow:hidden;
}

.roladel-referral-box:before{
    content:"";
    position:absolute;
    top:0;
    left:0;
    width:4px;
    height:100%;
    background:#fff;
    opacity:.9;
}

.referral-dismiss{
    position:absolute;
    top:10px;
    right:10px;
    border:none;
    background:none;
    color:#777;
    font-size:12px;
    cursor:pointer;
    padding:4px;
}

.referral-dismiss:hover{
    color:#fff;
}

.referral-left{
    display:flex;
    align-items:center;
    gap:15px;
    flex:1;
}

.referral-icon{
    width:60px;
    height:60px;
    min-width:60px;
    border-radius:14px;
    background:#222;
    border:1px solid #333;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:24px;
}

.referral-tag{
    display:inline-block;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:1px;
    color:#aaa;
    margin-bottom:6px;
}

.referral-content h4{
    margin:0 0 6px;
    color:#fff;
    font-size:26px;
    font-weight:800;
}

.referral-content p{
    margin:0;
    color:#bdbdbd;
    line-height:1.6;
    font-size:14px;
}

.referral-content strong{
    color:#fff;
}

.referral-arrow{
    width:48px;
    height:48px;
    min-width:48px;
    border-radius:50%;
    color:#000;
    display:flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    transition:.3s;
}

.referral-arrow:hover{
    transform:translateX(3px);
    color:#000;
    text-decoration:none;
}

@media(max-width:768px){

    .roladel-referral-box{
        padding:18px;
    }

    .referral-icon{
        width:50px;
        height:50px;
        min-width:50px;
        font-size:20px;
    }

    .referral-content h4{
        font-size:22px;
    }

    .referral-content p{
        font-size:13px;
    }

    .referral-arrow{
        width:42px;
        height:42px;
        min-width:42px;
    }
}

/* ---------- Shared banner carousel (includes/home_banner_carousel.php) ----------
   Loaded on home.php, user_home.php, category.php, search.php, and
   proposals/proposal.php (all 5 link this stylesheet already), so one
   definition here covers every placement instead of per-page CSS. The 4
   currently-active slide images are all exactly 1400x380 (3.684:1) -
   aspect-ratio keeps that ratio at any width instead of a fixed pixel
   height, and object-fit:contain (not cover) means a future image with a
   different ratio letterboxes on a neutral background rather than being
   cropped or stretched. max-width keeps the banner from becoming an
   unreasonably wide strip on large desktop monitors while still filling
   the available width on anything narrower. No new colors - the
   letterbox background reuses the existing --gray-100 token. */
.roladel-banner-wrap {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
}

.roladel-banner-wrap .roladel-home-carousel {
  aspect-ratio: 1400 / 380;
  overflow: hidden;
  border-radius: 8px;
  background: var(--gray-100);
}

html.dark .roladel-banner-wrap .roladel-home-carousel {
  background: var(--dark-surface-alt);
}

.roladel-banner-wrap .roladel-home-carousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (max-width: 767px) {
  .roladel-banner-wrap {
    margin: 12px auto;
    padding: 0 10px;
  }
}

/* ---------- Reduced motion ----------
   Loaded on every page (this file already is, site-wide). Shortens every
   CSS transition/animation to near-zero instead of removing them
   outright, so state changes (hover, favorite toggle, dropdown open)
   still happen correctly - just without the motion - for anyone who has
   asked their OS for reduced motion. Bootstrap's own fade/collapse
   transitions (not reduced-motion-aware in this vendored v4 build) are
   covered too since they're plain CSS transitions matched by the same
   wildcard. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}