/* public/css/saas.css (REVISAO FINAL - CORRIGIDO) */

:root{
  --saas-bg: #0b1220;

  --saas-surface: rgba(255,255,255,.06);
  --saas-surface-2: rgba(255,255,255,.08);
  --saas-border: rgba(255,255,255,.12);

  --saas-text: rgba(255,255,255,.92);
  --saas-muted: rgba(255,255,255,.68);

  --saas-primary: #2f7bff;
  --saas-primary-2: #1f5fff;
  --saas-success: #19c37d;
  --saas-warning: #ffcc66;
  --saas-danger: #ff5a6f;

  --saas-radius: 16px;
  --saas-radius-sm: 12px;

  --saas-shadow: 0 18px 45px rgba(0,0,0,.35);
  --saas-shadow-soft: 0 10px 25px rgba(0,0,0,.22);
}

html, body{
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 15% 0%, rgba(47,123,255,.25), transparent 55%),
    radial-gradient(900px 500px at 85% 20%, rgba(25,195,125,.12), transparent 60%),
    linear-gradient(180deg, #090f1b, #070c16);
}

body{
  color: var(--saas-text);
}

.content-wrapper{
  background: transparent !important;
}

/* ============================= */
/* TOPBAR / FOOTER               */
/* ============================= */

.main-header.navbar{
  padding: 10px 14px !important;
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  background: rgba(10,16,29,.80) !important;
  backdrop-filter: blur(12px);
}

.main-footer{
  background: rgba(10,16,29,.55) !important;
  border-top: 1px solid rgba(255,255,255,.06) !important;
  color: rgba(255,255,255,.65);
}

/* botão hamburguer */
.main-header .nav-link[data-widget="pushmenu"]{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid !important;
  place-items: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.main-header .nav-link[data-widget="pushmenu"]:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(47,123,255,.25);
}

/* links topo */
.main-header .navbar-nav .nav-link{
  color: rgba(255,255,255,.90) !important;
}
.main-header .navbar-nav .nav-link:hover{
  color: rgba(255,255,255,.95) !important;
}

/* área do usuário */
.main-header .user-menu > .nav-link{
  padding: 6px 10px !important;
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.main-header .user-menu > .nav-link:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(47,123,255,.25);
}
.main-header .user-menu .user-image{
  width: 30px !important;
  height: 30px !important;
  margin-top: 0 !important;
}

/* dropdown do usuário */
.dropdown-menu.dropdown-menu-right,
.dropdown-menu.dropdown-menu-lg{
  background: rgba(10,16,29,.92) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  box-shadow: 0 22px 55px rgba(0,0,0,.45);
  border-radius: 16px !important;
  overflow: hidden;
  padding: 8px !important;
}

.user-header{
  border-radius: 14px !important;
  margin: 6px !important;
  background:
    radial-gradient(500px 180px at 20% 0%, rgba(47,123,255,.35), transparent 60%),
    rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}
.user-header p,
.user-header small{
  color: rgba(255,255,255,.92) !important;
}

.user-footer{
  border-top: 1px solid rgba(255,255,255,.08) !important;
  padding: 10px !important;
  display: flex;
  gap: 10px;
}
.user-footer .btn{
  flex: 1;
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(255,255,255,.06) !important;
  color: rgba(255,255,255,.92) !important;
  font-weight: 700;
}
.user-footer .btn:hover{
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(47,123,255,.25) !important;
}

/* ============================= */
/* SIDEBAR                        */
/* ============================= */

.main-sidebar{
  background: rgba(10,16,29,.78) !important;
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255,255,255,.06);
}

.brand-link{
  border-bottom: 1px solid rgba(255,255,255,.06) !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 14px 14px !important;
}
.brand-link .brand-text{
  display: inline-block !important;
  margin-left: 10px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 160px;
}
.brand-link .brand-image{
  float: none !important;
  margin-left: 0 !important;
}
.sidebar-mini.sidebar-collapse .main-sidebar .brand-link .brand-text{
  display: none !important;
}
.sidebar-mini.sidebar-collapse .main-sidebar .brand-link .brand-image{
  margin-left: 8px !important;
}

.main-sidebar .nav-header{
  padding: 10px 14px 4px !important;
  letter-spacing: .08em;
}

/* links */
.main-sidebar .nav-sidebar .nav-link{
  padding: 10px 12px !important;
  margin: 4px 8px !important;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.main-sidebar .nav-sidebar .nav-icon{
  width: 22px;
  text-align: center;
  opacity: .95;
}
.nav-sidebar .nav-link:hover{
  background: rgba(255,255,255,.06);
}
.nav-sidebar .nav-link.active{
  background: linear-gradient(135deg, rgba(47,123,255,.95), rgba(31,95,255,.80)) !important;
  box-shadow: 0 12px 30px rgba(47,123,255,.22);
}

/* ✅ Treeview (submenus do AdminLTE) */
.nav-sidebar .nav-treeview{
  padding-left: 10px;
}
.nav-sidebar .nav-treeview > .nav-item > .nav-link{
  margin: 4px 8px 4px 18px !important;
  padding: 9px 10px !important;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
}
.nav-sidebar .nav-treeview > .nav-item > .nav-link:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(47,123,255,.18);
}

/* ============================= */
/* FIX TEXTO (DARK MODE)         */
/* ============================= */

body,
.content-wrapper,
.card,
.nav-sidebar .nav-link,
.main-header,
.main-footer,
.dropdown-menu,
.navbar,
.brand-text,
.nav-link p,
.nav-treeview .nav-link p{
  color: rgba(255,255,255,.92) !important;
}

.small,
.text-muted,
.hint{
  color: rgba(255,255,255,.65) !important;
}

.content-wrapper h1,
.content-wrapper h2,
.content-wrapper h3,
.content-wrapper h4,
.content-wrapper h5,
.content-wrapper h6{
  color: #ffffff !important;
}

.badge{ color: #fff !important; }

/* ============================= */
/* COMPONENTES BOOTSTRAP 4       */
/* ============================= */

.card{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--saas-radius);
  box-shadow: var(--saas-shadow-soft);
}
.card-header,
.card-footer{
  background: transparent !important;
  border-color: rgba(255,255,255,.08) !important;
}

.form-control,
.custom-select{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
  border-radius: 12px !important;
}
.form-control:focus,
.custom-select:focus{
  border-color: rgba(47,123,255,.45) !important;
  box-shadow: 0 0 0 .2rem rgba(47,123,255,.15) !important;
}

/* tabelas */
.table{
  color: rgba(255,255,255,.90) !important;
}
.table thead th{
  border-bottom: 1px solid rgba(255,255,255,.10) !important;
}
.table td,
.table th{
  border-top: 1px solid rgba(255,255,255,.08) !important;
}
.table-hover tbody tr:hover{
  background: rgba(255,255,255,.04) !important;
}

/* paginação */
.page-link{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.88) !important;
}
.page-item.active .page-link{
  background: rgba(47,123,255,.85) !important;
  border-color: rgba(47,123,255,.35) !important;
  color: #fff !important;
}

/* modal */
.modal-content{
  background: rgba(10,16,29,.96) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 16px !important;
  color: rgba(255,255,255,.92) !important;
}
.modal-header,
.modal-footer{
  border-color: rgba(255,255,255,.08) !important;
}

/* ============================= */
/* DATATABLES (painel/admin)     */
/* ============================= */

.dataTables_wrapper{
  color: rgba(255,255,255,.88) !important;
}

.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_info{
  color: rgba(255,255,255,.72) !important;
  font-weight: 600;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.92) !important;
  border-radius: 12px !important;
  outline: none !important;
}

table.dataTable{
  border-collapse: separate !important;
  border-spacing: 0;
}

table.dataTable thead th{
  background: rgba(255,255,255,.03) !important;
}

table.dataTable tbody tr{
  background: transparent !important;
}

table.dataTable tbody tr:hover{
  background: rgba(255,255,255,.04) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button{
  color: rgba(255,255,255,.85) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current{
  background: rgba(47,123,255,.85) !important;
  border: 1px solid rgba(47,123,255,.35) !important;
  color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover{
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  color: rgba(255,255,255,.95) !important;
}

/* Botões do DataTables (se usar buttons) */
.dt-buttons .btn{
  border-radius: 12px !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  background: rgba(255,255,255,.06) !important;
  color: rgba(255,255,255,.92) !important;
  font-weight: 700;
}
.dt-buttons .btn:hover{
  background: rgba(255,255,255,.10) !important;
  border-color: rgba(47,123,255,.25) !important;
}

/* ============================= */
/* select2 dark                  */
/* ============================= */

.select2-container--default .select2-selection--single{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 12px !important;
  height: calc(2.25rem + 2px) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
  color: rgba(255,255,255,.92) !important;
  line-height: calc(2.25rem + 2px) !important;
}
.select2-container--default .select2-selection--single .select2-selection__arrow{
  height: calc(2.25rem + 2px) !important;
}
.select2-dropdown{
  background: rgba(10,16,29,.98) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: 14px !important;
  overflow: hidden;
}
.select2-container--default .select2-results__option{
  color: rgba(255,255,255,.90) !important;
}
.select2-container--default .select2-results__option--highlighted[aria-selected]{
  background: rgba(255,255,255,.06) !important;
}

/* ============================= */
/* SAAS BLOCO / HERO             */
/* ============================= */

.saas-page{ color: var(--saas-text); }

.saas-hero{
  border-radius: var(--saas-radius);
  background:
    radial-gradient(600px 250px at 20% 0%, rgba(47,123,255,.35), transparent 60%),
    radial-gradient(700px 260px at 85% 10%, rgba(25,195,125,.18), transparent 60%),
    rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--saas-shadow-soft);
  padding: 22px;
  margin-bottom: 18px;
}
.saas-hero h1{
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  font-size: 22px;
}
.saas-hero p{
  margin: 6px 0 0;
  color: var(--saas-muted);
}

/* Quick cards */
.quick-grid{
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.quick-card{
  grid-column: span 4;
  border-radius: var(--saas-radius);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--saas-shadow-soft);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none !important;
  color: var(--saas-text) !important;
}
.quick-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--saas-shadow);
  border-color: rgba(47,123,255,.25);
}
.quick-ic{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(47,123,255,.16);
  border: 1px solid rgba(47,123,255,.22);
}
.quick-ic.success{
  background: rgba(25,195,125,.14);
  border: 1px solid rgba(25,195,125,.20);
}
.quick-title{
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
}
.quick-sub{
  margin: 2px 0 0;
  color: var(--saas-muted);
  font-size: 13px;
}

@media (max-width: 991px){
  .quick-card{ grid-column: span 6; }
}
@media (max-width: 575px){
  .quick-card{ grid-column: span 12; }
}

/* Product cards */
.product-card{
  height: 100%;
  border-radius: var(--saas-radius);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--saas-shadow-soft);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.product-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--saas-shadow);
  border-color: rgba(47,123,255,.25);
}
.product-cover{
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  background: rgba(255,255,255,.04);
}
.product-body{
  padding: 14px 14px 8px;
}
.product-title{
  font-weight: 800;
  margin: 0;
  font-size: 14px;
}
.product-desc{
  margin: 6px 0 0;
  color: var(--saas-muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-foot{
  padding: 12px 14px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge-soft{
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 10px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(255,255,255,.80);
}
.badge-soft.danger{
  background: rgba(255,90,111,.12);
  border-color: rgba(255,90,111,.22);
  color: rgba(255,255,255,.88);
}
.badge-soft.success{
  background: rgba(25,195,125,.12);
  border-color: rgba(25,195,125,.22);
  color: rgba(255,255,255,.88);
}

.btn-saas{
  border-radius: 12px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  padding: 10px 12px !important;
}
.btn-saas-primary{
  background: linear-gradient(135deg, var(--saas-primary), var(--saas-primary-2)) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(47,123,255,.22);
}
.btn-saas-success{
  background: linear-gradient(135deg, #19c37d, #11a96a) !important;
  color: #fff !important;
  box-shadow: 0 12px 28px rgba(25,195,125,.18);
}

/* ============================= */
/* CURSOS / PLAYER UI            */
/* ============================= */

.course-layout{
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 991px){
  .course-layout{ grid-template-columns: 1fr; }
}

.course-sidebar{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.22);
  overflow: hidden;
}

.course-sidebar .course-sidebar-head{
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.90);
}

.course-sidebar .course-sidebar-body{
  max-height: calc(100vh - 180px);
  overflow: auto;
  padding: 10px;
}

.course-sidebar .lesson-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 14px;
  color: rgba(255,255,255,.86);
  text-decoration: none !important;
  border: 1px solid transparent;
  background: rgba(255,255,255,.04);
  margin-bottom: 8px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.course-sidebar .lesson-item:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.06);
  border-color: rgba(47,123,255,.20);
}

.course-sidebar .lesson-item.active{
  background: linear-gradient(135deg, rgba(47,123,255,.95), rgba(31,95,255,.80));
  border-color: rgba(255,255,255,.18);
  box-shadow: 0 12px 30px rgba(47,123,255,.18);
  color: #fff !important;
}

.course-content{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.22);
  padding: 16px;
}

.course-title{
  font-weight: 800;
  color: rgba(255,255,255,.92);
  margin: 0;
}

.video-wrap{
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.10);
}

.video-wrap iframe,
.video-wrap video{
  width: 100%;
  height: min(60vh, 520px);
  display: block;
}

.course-actions{
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

/* ajuste container do curso */
.content-wrapper .container-fluid{
  padding-left: 16px;
  padding-right: 16px;
}

/* menu do curso “inline” */
.course-inline-card .nav-sidebar .nav-link,
.course-inline-card .nav-treeview .nav-link{
  border-radius: 12px;
  margin: 4px 0;
  color: rgba(255,255,255,.86) !important;
}
.course-inline-card .nav-sidebar .nav-link:hover,
.course-inline-card .nav-treeview .nav-link:hover{
  background: rgba(255,255,255,.06) !important;
}
.course-inline-card .nav-sidebar .nav-link.active,
.course-inline-card .nav-treeview .nav-link.active{
  background: linear-gradient(135deg, rgba(47,123,255,.95), rgba(31,95,255,.80)) !important;
  box-shadow: 0 12px 30px rgba(47,123,255,.18);
  color: #fff !important;
}
.course-inline-card .nav-treeview{
  padding-left: 10px;
}

/* ============================= */
/* SCROLLBAR (opcional / SaaS)   */
/* ============================= */

::-webkit-scrollbar{
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track{
  background: rgba(255,255,255,.03);
}
::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.12);
  border-radius: 999px;
  border: 2px solid rgba(0,0,0,.0);
}
::-webkit-scrollbar-thumb:hover{
  background: rgba(255,255,255,.18);
}

/* =========================================================
   FIX DEFINITIVO: contraste dentro de cards no dark mode
   (colocado no FINAL, sem quebrar o CSS)
========================================================= */

body.dark-mode .content-wrapper .card,
body.dark-mode .content-wrapper .card *{
  color: rgba(255,255,255,.92) !important;
}

/* sobrescreve classes do Bootstrap/AdminLTE que deixam escuro */
body.dark-mode .content-wrapper .card .text-dark,
body.dark-mode .content-wrapper .card .text-body,
body.dark-mode .content-wrapper .card .text-secondary,
body.dark-mode .content-wrapper .card .text-muted,
body.dark-mode .content-wrapper .card small,
body.dark-mode .content-wrapper .card .card-text,
body.dark-mode .content-wrapper .card .card-title,
body.dark-mode .content-wrapper .card .card-subtitle,
body.dark-mode .content-wrapper .card .card-header,
body.dark-mode .content-wrapper .card .card-footer,
body.dark-mode .content-wrapper .card a:not(.btn){
  color: rgba(255,255,255,.82) !important;
  opacity: 1 !important;
}

/* títulos um pouco mais fortes */
body.dark-mode .content-wrapper .card .card-title,
body.dark-mode .content-wrapper .card h1,
body.dark-mode .content-wrapper .card h2,
body.dark-mode .content-wrapper .card h3,
body.dark-mode .content-wrapper .card h4,
body.dark-mode .content-wrapper .card h5,
body.dark-mode .content-wrapper .card h6{
  color: rgba(255,255,255,.94) !important;
  font-weight: 800;
}

/* melhorar fundo do card (pra texto destacar) */
body.dark-mode .content-wrapper .card{
  background: rgba(17, 24, 39, .55) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
}

/* caixas internas do card */
body.dark-mode .content-wrapper .card .p-3,
body.dark-mode .content-wrapper .card [style*="border:1px"]{
  background: rgba(255,255,255,.03) !important;
  border-color: rgba(255,255,255,.10) !important;
}

/* Código de acesso (caso exista) */
#codigoTexto{
  color: #ffffff !important;
  font-weight: 700;
}

/* textos com opacity baixo inline */
body.dark-mode .content-wrapper .card [style*="opacity"]{
  opacity: 1 !important;
}