@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 25, 41, 0.75);
  --bg-card-hover: rgba(26, 36, 61, 0.85);
  --border-glow: rgba(59, 130, 246, 0.2);
  --border-active: rgba(99, 102, 241, 0.5);
  
  --primary: #3b82f6;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-sub: #6b7280;

  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-glow: 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.12) 0px, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
}

/* App Layout */
#app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
aside.sidebar {
  width: 280px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: fixed;
  height: 100vh;
  z-index: 50;
  transition: width 0.3s ease, padding 0.3s ease;
}

aside.sidebar.collapsed {
  width: 75px;
  padding: 1.5rem 0.5rem;
}

aside.sidebar.collapsed .brand-text,
aside.sidebar.collapsed .role-switcher-card,
aside.sidebar.collapsed .menu-title-text,
aside.sidebar.collapsed .menu-badge,
aside.sidebar.collapsed .tree-category-header .cat-header-title span:nth-child(2),
aside.sidebar.collapsed .tree-category-header span[id^="cat-arrow-"] {
  display: none !important;
}

aside.sidebar.collapsed .menu-item {
  justify-content: center;
  padding: 0.75rem 0.25rem;
}

aside.sidebar.collapsed ~ main.content-area {
  margin-left: 75px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: var(--primary-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-switcher-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.role-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 0.5rem;
}

.role-badge.free { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.role-badge.premium { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.role-badge.agent { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.role-badge.admin { background: rgba(244, 63, 94, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }

nav.menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.menu-item:hover, .menu-item.active {
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
  border-left: 3px solid var(--primary);
}

/* Main Content Area */
main.content-area {
  margin-left: 280px;
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: 1400px;
  transition: margin-left 0.3s ease;
}

header.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.page-title h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
}

.page-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* Cards & Grid Layout */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border-glow);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Score Circle */
.score-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(59, 130, 246, 0.3);
}

.score-number {
  font-family: 'Outfit', sans-serif;
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.score-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Checklist Items & Interactive Recommendations */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
}

.checklist-item.interactive {
  cursor: pointer;
}

.checklist-item.interactive:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(96, 165, 250, 0.4);
  transform: translateX(4px);
}

.checklist-icon {
  color: var(--accent-emerald);
  font-size: 1.2rem;
  margin-top: 0.1rem;
}

.course-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  margin-top: 0.5rem;
}

/* Modal Popup Overlay */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #121929;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  width: 90%;
  max-width: 650px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  position: relative;
}

.close-modal-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  cursor: pointer;
}

/* QR Code Preview Box */
.qr-preview-card {
  text-align: center;
  background: #ffffff;
  color: #111827;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  position: relative;
}

.qr-preview-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.qr-img {
  width: 200px;
  height: 200px;
  margin: 1rem auto;
  border-radius: 12px;
}

/* Video Course Cards */
.video-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.video-thumb {
  width: 100%;
  height: 160px;
  background: #1e293b;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin-bottom: 1rem;
  background-size: cover;
  position: relative;
}

.lock-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--accent-amber);
}

/* Table */
table.data-table {
  width: 100%;
  border-collapse: collapse;
}

table.data-table th, table.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
}

table.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.02);
}

/* Dynamic Tab Visibility */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
