/* =====================================================
   GLOBAL RESET & BASE
   ===================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
  background: #0b0f14;
  color: #e5e7eb;
  line-height: 1.6;
}

img { max-width: 100%; }

a {
  color: #00f2ff;
  text-decoration: none;
}

a:hover { text-decoration: underline; }

/* =====================================================
   SHARED WIDTH CONTAINER (KEY)
   ===================================================== */

.site-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* =====================================================
   HEADER / NAVBAR (FIXED)
   ===================================================== */

header {
  background: #0f172a;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 20px;
  font-weight: 700;
}

.menu-icon {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

nav {
  display: flex;
  gap: 20px;
}

nav a {
  font-size: 14px;
  color: #e5e7eb;
}

@media (max-width: 768px) {
  .menu-icon { display: block; }

  nav {
    display: none;
    position: absolute;
    right: 24px;
    top: 64px;
    flex-direction: column;
    background: #0f172a;
    padding: 16px;
    width: 200px;
  }

  nav.active { display: flex; }
}

/* =====================================================
   LANDING PAGE (CLEAN)
   ===================================================== */

.landing-main {
  padding: 48px 0 24px;
  text-align: center;
}

/* HERO */

.hero h1 {
  font-size: 36px;
  margin-bottom: 12px;
}

.hero p {
  font-size: 16px;
  color: #9ca3af;
  max-width: 600px;
  margin: 0 auto 24px;
}

/* SUBSCRIBE FORM */

#subscribe-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

#subscribe-form input {
  width: 280px;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
  text-align: center;
}

#subscribe-form button {
  margin-top: 12px;
  padding: 12px 28px;
  border: none;
  border-radius: 6px;
  background: #00f2ff;
  color: #000;
  font-weight: 600;
  cursor: pointer;
}

.note {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 32px;
}

/* HERO VISUAL */

.hero-visual {
  margin: 40px 0;
}

.banner {
  max-width: 420px;
  margin: 0 auto;
  display: block;
}

.cta-button {
  display: inline-block;
  margin-top: 20px;
  padding: 14px 32px;
  background: #00f2ff;
  color: #000;
  border-radius: 8px;
  font-weight: 600;
}

/* =====================================================
   TESTIMONIALS (ROTATION SAFE)
   ===================================================== */

.testimonial-section {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid #1f2937;
}

.testimonial-section h2 {
  margin-bottom: 20px;
}

.testimonial {
  display: none;
  max-width: 600px;
  margin: 0 auto;
  color: #cbd5f5;
}

.testimonial.active {
  display: block;
}

.testimonial img {
  border-radius: 50%;
  margin-bottom: 12px;
}

/* =====================================================
   VIDEO
   ===================================================== */

.video-section {
  margin-top: 60px;
  display: flex;
  justify-content: center;
}

.video-section video {
  max-width: 720px;
  border-radius: 10px;
}

/* =====================================================
   AUTH PAGES
   ===================================================== */

.auth-container {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: #121826;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

.auth-card h1 { font-size: 24px; }

.auth-subtitle {
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 24px;
}

.auth-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 14px;
  border-radius: 6px;
  border: 1px solid #1f2937;
  background: #020617;
  color: #e5e7eb;
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: #00f2ff;
  color: #000;
  border-radius: 6px;
  border: none;
  font-weight: 600;
}

/* =====================================================
   FOOTER
   ===================================================== */

footer {
  margin-top: 60px;
  padding: 24px 0;
  background: #020617;
  text-align: center;
  font-size: 12px;
}

.captcha-wrapper {
  display: flex;
  justify-content: center;
  margin: 15px 0;
}

/* ==================================================
   MOBILE RESPONSIVE FIXES (Tabler-compatible)
   ================================================== */

@media (max-width: 768px) {

  /* ===== Sidebar / Nav ===== */
  .sidebar,
  .nav-sidebar,
  .side-nav {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    left: 0 !important;
    top: 0 !important;
    margin: 0 !important;
    z-index: 10;
  }

  /* ===== Main Content ===== */
  .page-wrapper,
  .content,
  .main-content,
  .dashboard-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 12px !important;
  }

  /* ===== Cards ===== */
  .card {
    width: 100% !important;
    margin-bottom: 14px;
  }

  /* ===== Charts / Canvas ===== */
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* ===== Tabulator ===== */
  .tabulator {
    width: 100% !important;
    overflow-x: auto;
  }

  .tabulator-tableHolder {
    overflow-x: auto;
  }

  /* ===== Dashboard Grid ===== */
  .dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
}


@media (max-width: 768px) {

  /* Nuclear option: flatten layout */
  body * {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Kill ANY fixed or absolute sidebar */
  aside,
  nav,
  .sidebar,
  [class*="sidebar"],
  [class*="nav"] {
    position: relative !important;
    width: 100% !important;
    left: 0 !important;
    top: 0 !important;
    height: auto !important;
  }

  /* Kill desktop offsets */
  main,
  section,
  .content,
  .container,
  .wrapper,
  .layout,
  [class*="content"],
  [class*="container"],
  [class*="wrapper"] {
    margin-left: 0 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    width: 100% !important;
  }
}


/* ==========================
   MOBILE HAMBURGER NAV
   ========================== */

.mobile-nav-toggle {
  display: none;
}

@media (max-width: 768px) {

  /* Show hamburger button */
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #fff;
    cursor: pointer;
  }

  /* Hide sidebar/menu by default on mobile */
  #mobileNavPanel {
    display: none;
  }

  /* When open, show it as dropdown */
  body.mobile-nav-open #mobileNavPanel {
    display: block;
    width: 100%;
  }

  /* Dropdown styling */
  #mobileNavPanel {
    margin: 10px 12px 0 12px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  }

  /* Make sure content isn't pushed weirdly */
  .main-content,
  .dashboard-content,
  .page-wrapper,
  .content {
    margin-left: 0 !important;
    width: 100% !important;
    padding: 12px !important;
  }
}

/* ===============================
   MOBILE DASHBOARD SIDEBAR
   =============================== */

@media (max-width: 768px) {

  /* Sidebar hidden by default */
  .navbar-vertical {
    position: fixed;
    top: 56px;
    left: -100%;
    width: 260px;
    height: calc(100vh - 56px);
    background: #0b1220;
    z-index: 1200;
    transition: left 0.3s ease;
    overflow-y: auto;
  }

  /* When toggled ON */
  body.mobile-sidebar-open .navbar-vertical {
    left: 0;
  }

  /* Dim background */
  body.mobile-sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1100;
  }
}

@media (max-width: 768px) {

  .navbar-vertical {
    position: fixed;
    top: 56px;
    left: -280px;
    width: 280px;
    height: calc(100vh - 56px);
    background: #0b1220;
    z-index: 1200;
    transition: left 0.3s ease;
    overflow-y: auto;
  }

  body.mobile-sidebar-open .navbar-vertical {
    left: 0;
  }

  body.mobile-sidebar-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1100;
  }
}


/* ===== Mobile Navbar Full-Width Fix ===== */
@media (max-width: 767.98px) {

  /* Make dropdown occupy full width */
  #navbar-menu {
    width: 100vw;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 0;
  }

  /* Make menu items full width */
  #navbar-menu .nav-item,
  #navbar-menu .nav-link,
  #navbar-menu .btn {
    width: 100%;
    text-align: left;
  }

  /* Bigger tap targets */
  #navbar-menu .nav-link {
    padding: 14px 18px;
    font-size: 17px;
  }

  #navbar-menu .btn {
    padding: 14px 18px;
    font-size: 17px;
    margin-top: 8px;
  }
}

.navbar-dark .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,.75)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@media (max-width: 768px) {
  .navbar-vertical {
    display: block !important;
    width: 100%;
  }
}

/* Fix dropdown on mobile */
.navbar-nav .dropdown-menu {
  position: absolute;
  right: 0;
  left: auto;
}

.navbar-toggler-icon {
  background-image: var(--tblr-navbar-toggler-icon-bg);
}

/* === FIX: Show sidebar on mobile when toggled === */
@media (max-width: 767.98px) {

  .navbar-vertical {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 1050;
    background-color: #1e293b;
  }

  .page-wrapper {
    margin-left: 0 !important;
  }
}

/* FORCE SIDEBAR VISIBLE ON MOBILE */
@media (max-width: 768px) {
  .navbar-vertical {
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
  }

  #sidebar-menu {
    display: block !important;
  }
}

/* PROFILE DROPDOWN OVERLAY ABOVE SIDEBAR */
.profile-overlay {
  position: relative;
  z-index: 2000;
}

.profile-dropdown {
  position: fixed !important;
  top: 56px;          /* below top navbar */
  right: 12px;
  z-index: 3000;
  min-width: 220px;
}

/* Make sure sidebar never overlaps dropdown */
.navbar-vertical {
  z-index: 1000;
}

/* PROFILE DROPDOWN OVERLAY ABOVE SIDEBAR */
.profile-overlay {
  position: relative;
  z-index: 2000;
}

.profile-dropdown {
  position: fixed !important;
  top: 56px;
  right: 12px;
  z-index: 3000;
  min-width: 220px;
}

/* Sidebar stays underneath */
.navbar-vertical {
  z-index: 1000;
}

/* FORCE USER MENU TO TOP RIGHT */
.top-user-menu {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5000;
}

/* Prevent Tabler clipping */
.navbar {
  overflow: visible !important;
}
