/* style.css - Design System V3 (Enterprise) */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  
  /* Dynamic Variables to be overwritten by JS for White-labeling */
  --primary: #1e3a8a;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  
  --success: #059669;
  --success-light: #ecfdf5;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  
  --border: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  
  --max-width: 700px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

h1 { font-size: 1.75rem; margin-bottom: 1rem; font-weight: 700; color: var(--primary); }
h2 { font-size: 1.25rem; margin-bottom: 0.75rem; font-weight: 600; }
h3 { font-size: 1.125rem; margin-bottom: 0.5rem; font-weight: 600; }
p { margin-bottom: 1rem; color: var(--text-secondary); }

/* Utilities */
.container { padding: 2rem 1.5rem; flex: 1; display: flex; flex-direction: column;}
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); font-size: 0.875rem; }
.text-danger { color: var(--danger); font-size: 0.875rem; font-weight:500;}
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-0 { margin-bottom: 0px !important; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.bg-secondary { background: var(--bg-primary) }
.bg-primary { background: var(--primary-light) }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-md); font-weight: 600;
  font-size: 1rem; cursor: pointer; transition: all 0.2s ease; border: none;
  width: 100%;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 4px 6px -1px var(--primary-light); }
.btn-primary:hover:not(:disabled) { background-color: var(--primary-hover); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-secondary { background-color: var(--bg-primary); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background-color: #e2e8f0; }
.btn-success { background-color: var(--success); color: white; }
.btn-danger { background-color: var(--danger); color: white; }
.btn-warning { background-color: var(--warning); color: white; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.875rem; width: auto; border-radius: var(--radius-sm); }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-primary); }
.form-input {
  width: 100%; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 1rem; transition: all 0.2s;
  background: white;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-select {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: white; font-size:1rem;
}

/* Color Picker */
.color-picker-wrapper { display: flex; align-items: center; gap: 1rem; }
input[type="color"] { border:none; width: 40px; height: 40px; border-radius: 8px; cursor:pointer; background:none; padding:0; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; box-shadow: var(--shadow-sm); }

/* Logo Presenter */
.brand-logo-preview { max-width: 150px; max-height: 80px; object-fit: contain; border-radius:var(--radius-sm); }

/* Cards */
.card {
  background: white; border-radius: var(--radius-lg); padding: 1.5rem;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem; transition: box-shadow 0.3s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

/* Tabs (Admin Dashboard) */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tab-btn {
  padding: 0.75rem 1rem; background: none; border: none; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; font-size: 1rem; transition: all 0.2s; white-space: nowrap;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Modules list */
.module-list { list-style: none; }
.module-item {
  display: flex; align-items: center; padding: 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 0.75rem; background: white;
  transition: all 0.2s ease;
}
.module-item.clickable:hover:not(.locked) { border-color: var(--primary); background: var(--primary-light); cursor:pointer; }
.module-item.locked { opacity: 0.6; cursor: not-allowed; background: var(--bg-primary); }
.module-item.update-mod { border-left: 4px solid var(--warning); }
.module-icon {
  width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; background: var(--primary-light); color: var(--primary);
  margin-right: 1.25rem; font-weight: 700; font-size:1.1rem;
}
.module-item.completed .module-icon { background: var(--success); color: white; }

/* Progress Bar */
.progress-wrapper { background: var(--border); border-radius: 99px; height: 10px; width: 100%; overflow: hidden; margin-bottom: 1rem; }
.progress-fill { height: 100%; background: var(--success); transition: width 0.5s ease; }

/* Media Containers */
.video-container { width: 100%; border-radius: var(--radius-lg); overflow: hidden; background: #000; margin-bottom: 1rem; }
video { width: 100%; display: block; }
.image-container { width: 100%; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1rem; border: 1px solid var(--border); }
.image-container img { width: 100%; object-fit: contain; max-height: 400px; display: block; }

/* Checklists */
.checklist-item {
  display: flex; align-items:flex-start; margin-bottom: 1rem; padding: 1rem;
  background: var(--bg-primary); border-radius: var(--radius-sm); border: 1px solid var(--border);
  cursor: pointer; transition: all 0.2s;
}
.checklist-item:hover { border-color: var(--primary); }
.checklist-item input[type="checkbox"] { width: 24px; height: 24px; margin-right: 1rem; accent-color: var(--primary); cursor:pointer; flex-shrink:0; }
.checklist-item label { cursor: pointer; display:block; padding-top:2px; font-weight:500; font-size:1rem; flex:1;}

/* Quiz Groups */
.quiz-block { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px dashed var(--border); }
.quiz-option-btn {
  display: flex; align-items: center; padding: 1rem; border: 2px solid var(--border);
  border-radius: var(--radius-md); margin-bottom: 0.75rem; cursor: pointer; transition: all 0.2s; background:white;
}
.quiz-option-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.quiz-option-btn input[type="radio"] { margin-right: 1rem; width: 20px; height: 20px; accent-color: var(--primary); pointer-events:none; }
.quiz-option-btn.selected { border-color: var(--primary); background: var(--primary-light); }

/* V3 Signatures Pad */
.signature-pad-container { border: 2px dashed var(--border); border-radius: var(--radius-md); background: #ffffff; padding: 0.5rem; touch-action: none; position: relative; margin-bottom: 1rem;}
.signature-canvas { width: 100%; height: 200px; background:transparent; cursor: crosshair; }
.signature-placeholder { position: absolute; pointer-events:none; top:50%; left:50%; transform:translate(-50%, -50%); color: var(--border); font-size: 1.5rem; font-weight:700; opacity:0.5; }

/* V3 Certificate */
.certificate-view { background: #fffdf5; border: 12px double #d4af37; padding: 2rem; border-radius: 8px; text-align: center; color: #333; box-shadow: inset 0 0 20px rgba(0,0,0,0.05);}
.cert-title { font-size: 2rem; font-family: Georgia, serif; font-weight: bold; color: #b8860b; margin-bottom: 0.5rem; }
.cert-subtitle { font-size: 1.125rem; font-style: italic; color: #555; margin-bottom: 2rem; }
.cert-name { font-size: 2.25rem; font-weight: bold; text-decoration: underline; margin-bottom: 2rem; font-family: Georgia, serif;}
.cert-footer { display: flex; justify-content: space-between; margin-top: 3rem; align-items: flex-end;}
.cert-sig-box { border-top: 1px solid #333; padding-top: 0.5rem; flex: 1; margin: 0 1rem; display: flex; flex-direction: column; align-items: center; justify-content:flex-end; min-height:80px;}
.cert-sig-img { max-height: 60px; max-width: 150px; object-fit: contain; margin-bottom: 5px; mix-blend-mode: multiply; }
.watermark { opacity: 0.05; position: absolute; top:50%; left:50%; transform:translate(-50%, -50%); font-size:5rem; font-weight:bold; pointer-events:none; }

/* Language Switcher */
.lang-switcher { position: absolute; top: 1rem; right: 1.5rem; display: flex; gap: 0.5rem; z-index: 100; }
.lang-btn { background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.25rem 0.5rem; font-size: 1rem; cursor: pointer; transition: 0.2s; }
.lang-btn:hover, .lang-btn.active { border-color: var(--primary); background: var(--primary-light); }

/* Modals & Loaders */
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity:0; pointer-events:none; transition: opacity 0.3s; }
.loader-overlay.active { opacity: 1; pointer-events:all; }
.spinner { width: 40px; height: 40px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom:1rem;}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Shared Layout */
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; background: white; border-bottom: 1px solid var(--border); position:sticky; top:0; z-index:50;}
.navbar-title { font-weight: 700; font-size: 1.125rem;}
.back-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-primary); padding: 0.5rem; margin-left: -0.5rem; }
.admin-header { background: var(--primary); color: white; padding: 2rem 1.5rem; text-align: center; }
.admin-header h1 { margin-bottom: 0.5rem; color: white; }
.stat-card {
  background: white; padding: 1rem; border-radius: var(--radius-md);
  border: 1px solid var(--border); margin-bottom: 0.75rem;
  display:flex; justify-content:space-between; align-items:center;
}
.stat-pill { background: var(--danger-light); color: var(--danger); font-weight:700; padding: 0.25rem 0.75rem; border-radius: 99px; font-size: 0.875rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade { animation: fadeIn 0.4s ease forwards; }

/* Custom Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: white;
  width: 90%;
  max-width: 450px;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-box {
  transform: translateY(0);
}
.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.modal-body {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 2rem;
}
.modal-actions {
  display: flex;
  gap: 1rem;
}

/* ============================================== */
/* V3 SaaS LumaKing (Dark Mode & Glassmorphism)   */
/* ============================================== */
.theme-lumaking-dark {
  --bg-primary: #020617; /* Noite profunda */
  --bg-secondary: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  
  /* Se for grátis, usa este dourado (Luma Gold). Se for VIP, JS injeta a cor do mentor. */
  --primary: #fbbf24; 
  --primary-hover: #f59e0b;
  --primary-light: rgba(251, 191, 36, 0.15); 
  
  --border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(15, 23, 42, 0.6);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0, 0.5);
}

.theme-lumaking-dark {
  background-color: var(--bg-primary) !important;
}

.theme-lumaking-dark #app {
  background: var(--bg-primary);
  background-image: radial-gradient(circle at 50% -20%, var(--primary-light) 0%, transparent 50%);
  box-shadow: none;
}

/* Glassmorphism Cards */
.theme-lumaking-dark .card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.theme-lumaking-dark .stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border);
  color: var(--text-primary);
}

.theme-lumaking-dark .module-item {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--border);
  color: var(--text-primary);
}

.theme-lumaking-dark .modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
}

/* Neon Glow Effect on Hover */
.theme-lumaking-dark .card-glow {
  transition: all 0.3s ease;
}
.theme-lumaking-dark .card-glow:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px var(--primary-light), inset 0 0 10px var(--primary-light);
  transform: translateY(-5px);
}

/* Progress bar dark mode overrides */
.theme-lumaking-dark .progress-wrapper {
  background: rgba(255,255,255,0.1);
}
.theme-lumaking-dark .progress-fill {
  box-shadow: 0 0 10px var(--success);
}

/* Pulse animation for Live Button */
@keyframes pulseLive {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(234, 179, 8, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}
.pulse-live {
  animation: pulseLive 2s infinite;
  background-color: var(--primary) !important;
  color: black !important;
  font-weight: bold;
}

/* ============================================== */
/* Responsive & Layout Enhancements (Mobile & PC) */
/* ============================================== */

/* 1. Full Width for Mentorship Mode (PC Experience) */
.theme-lumaking-dark #app {
  max-width: 100%;
  background: var(--bg-primary); 
  box-shadow: none;
}

/* 2. Container Safe Area padding */
.container {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
}

/* 3. Mobile formatting (Center everything and adjust) */
@media (max-width: 768px) {
  /* Center Top Headers */
  .theme-lumaking-dark .container > div:first-child {
    text-align: center;
    justify-content: center !important;
  }
  
  .theme-lumaking-dark h1 {
    font-size: 2rem !important;
  }
  
  /* Make Tabs grid on mobile so they fit and center */
  .tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-bottom: none;
  }
  .tab-btn {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    padding: 0.75rem 0.5rem;
  }
  .theme-lumaking-dark .tab-btn.active {
    background: var(--primary-light);
  }
  
  /* Center Module Items */
  .module-item {
    flex-direction: column;
    text-align: center;
    gap: 15px;
    padding: 1.5rem !important;
  }
  .module-item > div:last-child {
    width: 100%;
    justify-content: center;
  }
  
  /* Adjust Hub Cards */
  .theme-lumaking-dark .card-glow {
    padding: 20px 15px !important;
  }
  .theme-lumaking-dark .card-glow > div:first-child {
    font-size: 3.5rem !important;
  }
}

/* ============================================== */
/* V4 SaaS Admin Layout (Sidebar)                 */
/* ============================================== */
.admin-layout {
  display: flex;
  min-height: 100dvh;
  width: 100%;
  background: var(--bg-primary);
  flex-direction: column;
}
@media (min-width: 769px) {
  .admin-layout { flex-direction: row; }
}

.sidebar {
  width: 100%;
  background: #020617; /* Dark */
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}
@media (min-width: 769px) {
  .sidebar { width: 260px; height: 100vh; max-height: 100vh; align-self: flex-start; overflow-y: auto; border-bottom: none; border-right: 1px solid rgba(255,255,255,0.1); position: sticky; top: 0; }
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-nav {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}
.sidebar-nav-mobile-hidden {
  display: none;
}
@media (min-width: 769px) {
  .sidebar-nav-mobile-hidden { display: flex !important; }
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  color: #94a3b8;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 1rem;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}
.sidebar-item.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px -3px var(--primary-light);
}

.sidebar-icon {
  margin-right: 12px;
  font-size: 1.2rem;
}

.sidebar-badge {
  background: var(--danger);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}

.main-content {
  flex: 1;
  padding: 2rem;
  max-width: 100%;
  overflow-x: hidden;
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: block;
}
@media (min-width: 769px) {
  .mobile-menu-btn { display: none; }
}
