/* ============================================================
   Johan HiTech — Main Stylesheet
   ============================================================ */

:root {
  --primary:   #1a1a2e;
  --secondary: #16213e;
  --accent:    #00d4ff;
  --accent2:   #7b2ff7;
  --dark:      #0f0f1a;
  --card-bg:   #1e2a3a;
  --text-muted:#8899aa;
  --border:    rgba(255,255,255,.08);
  --radius:    12px;
  --shadow:    0 8px 32px rgba(0,0,0,.3);
  --transition:.25s ease;
}

/* ── Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background: var(--dark);
  color: #e0e6f0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

::selection { background: var(--accent); color: var(--primary); }

a { color: var(--accent); transition: color var(--transition); }
a:hover { color: #fff; }

h1,h2,h3,h4,h5,h6 { font-weight: 700; letter-spacing: -.3px; }

/* ── Utilities ───────────────────────────────────────────── */
.text-accent    { color: var(--accent) !important; }
.bg-card        { background: var(--card-bg); }
.border-subtle  { border-color: var(--border) !important; }

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #0088cc);
  border: none;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  transition: transform var(--transition), box-shadow var(--transition);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,212,255,.4);
  color: #fff;
}

.btn-outline-accent {
  border: 2px solid var(--accent);
  color: var(--accent);
  border-radius: 8px;
  font-weight: 600;
  background: transparent;
}
.btn-outline-accent:hover { background: var(--accent); color: var(--primary); }

.badge-notif {
  position: absolute; top: 2px; right: 2px;
  font-size: 9px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; padding: 0;
}

/* ── Navbar ──────────────────────────────────────────────── */
.jht-navbar {
  background: rgba(15,15,26,.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
.jht-navbar .navbar-brand { font-size: 1.4rem; }
.brand-icon { color: var(--accent); margin-right: 4px; }
.jht-navbar .nav-link {
  color: #bcc8d8;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all var(--transition);
}
.jht-navbar .nav-link:hover,
.jht-navbar .nav-link.active {
  color: #fff;
  background: rgba(0,212,255,.1);
}
.notif-dropdown {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.notif-dropdown .dropdown-item {
  color: #bcc8d8;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-dropdown .dropdown-item:hover { background: rgba(0,212,255,.1); color: #fff; }

/* ── Hero ────────────────────────────────────────────────── */
.jht-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 60%, #0d1b2a 100%);
  min-height: 92vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
}
.jht-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 40%, rgba(0,212,255,.08), transparent);
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
}
.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent), #7b2ff7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,212,255,.1);
  border: 1px solid rgba(0,212,255,.3);
  border-radius: 50px; padding: 6px 16px;
  font-size: 13px; color: var(--accent);
  margin-bottom: 20px;
}
.hero-stats { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 32px; }
.stat-item { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Floating hero visual */
.hero-visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.hero-card-float {
  background: rgba(30,42,58,.8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

/* ── Section ─────────────────────────────────────────────── */
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: 3px;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.section-title { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.section-divider {
  width: 48px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px; margin: 12px 0 24px;
}

/* ── Cards ───────────────────────────────────────────────── */
.jht-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.jht-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(0,212,255,.25);
}
.service-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px;
}
.si-blue   { background: rgba(0,212,255,.15); color: var(--accent); }
.si-purple { background: rgba(123,47,247,.15); color: #a78bfa; }
.si-green  { background: rgba(34,197,94,.15);  color: #4ade80; }
.si-orange { background: rgba(249,115,22,.15); color: #fb923c; }
.si-pink   { background: rgba(236,72,153,.15); color: #f472b6; }
.si-yellow { background: rgba(234,179,8,.15);  color: #facc15; }

/* ── Course cards ────────────────────────────────────────── */
.course-card { border-radius: var(--radius); overflow: hidden; }
.course-thumb {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: var(--secondary);
}
.course-thumb-placeholder {
  width: 100%; aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--secondary), var(--card-bg));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: var(--accent);
}
.course-level {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; border-radius: 4px; padding: 2px 8px;
}
.level-beginner     { background: rgba(34,197,94,.15);  color: #4ade80; }
.level-intermediate { background: rgba(249,115,22,.15); color: #fb923c; }
.level-advanced     { background: rgba(236,72,153,.15); color: #f472b6; }

/* ── Progress ────────────────────────────────────────────── */
.progress { background: rgba(255,255,255,.08); border-radius: 50px; }
.progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 50px; }

/* ── Testimonials ────────────────────────────────────────── */
.testimonial-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.testimonial-card::before {
  content: '\201C';
  font-size: 64px; line-height: 1; color: var(--accent);
  opacity: .3; position: absolute; top: 12px; left: 20px;
  font-family: Georgia, serif;
}
.stars { color: #facc15; font-size: 14px; }

/* ── Live session feed ───────────────────────────────────── */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.4);
  border-radius: 50px; padding: 4px 14px;
  font-size: 12px; color: #f87171; font-weight: 700;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #f87171; animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}
.update-feed { max-height: 70vh; overflow-y: auto; scroll-behavior: smooth; }
.update-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  animation: slideIn .3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.update-item.type-code pre { margin: 0; border-radius: 8px; }
.update-item.type-instruction {
  border-left: 3px solid var(--accent);
  background: rgba(0,212,255,.05);
}
.update-timestamp { font-size: 11px; color: var(--text-muted); }

/* ── Certificate ─────────────────────────────────────────── */
.cert-container {
  max-width: 800px; margin: 0 auto;
  background: #fff; color: #222;
  border-radius: var(--radius);
  padding: 60px 50px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  border: 8px solid transparent;
  background-clip: padding-box;
  position: relative;
}
.cert-container::before {
  content: ''; position: absolute; inset: -8px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: calc(var(--radius) + 8px);
  z-index: -1;
}
.cert-watermark {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 200px; opacity: .03; pointer-events: none; color: var(--accent2);
  overflow: hidden;
}

/* ── Dashboard sidebar ───────────────────────────────────── */
.jht-sidebar {
  background: var(--secondary);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 70px);
  position: sticky; top: 70px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: #8899aa;
  text-decoration: none; font-size: 14px;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sidebar-link:hover, .sidebar-link.active {
  color: #fff; background: rgba(0,212,255,.08);
  border-left-color: var(--accent);
}
.sidebar-link i { font-size: 18px; width: 22px; flex-shrink: 0; }

/* ── AI Chat widget ──────────────────────────────────────── */
.ai-fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: none; color: #fff; font-size: 24px;
  box-shadow: 0 4px 20px rgba(0,212,255,.5);
  cursor: pointer; z-index: 1050;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.ai-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(0,212,255,.7); }
.ai-chat-box {
  position: fixed; bottom: 96px; right: 28px;
  width: 360px; max-height: 480px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 1049; display: none; flex-direction: column;
}
.ai-chat-box.open { display: flex; }
.ai-chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(90deg, rgba(0,212,255,.1), transparent);
}
.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.ai-msg.user   { background: rgba(0,212,255,.15); align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg.bot    { background: var(--card-bg); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-chat-input { padding: 12px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.ai-chat-input textarea {
  flex: 1; background: var(--card-bg); border: 1px solid var(--border);
  color: #e0e6f0; border-radius: 8px; padding: 8px 12px; font-size: 13px; resize: none;
}
.ai-chat-input textarea:focus { outline: none; border-color: var(--accent); }

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select, .form-check-input {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: #e0e6f0;
  border-radius: 8px;
}
.form-control:focus, .form-select:focus {
  background: var(--card-bg);
  border-color: var(--accent);
  color: #e0e6f0;
  box-shadow: 0 0 0 3px rgba(0,212,255,.15);
}
.form-label { font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.form-control::placeholder { color: #556677; }
.input-group-text { background: var(--card-bg); border-color: var(--border); color: var(--text-muted); }

/* ── Tables ──────────────────────────────────────────────── */
.table { color: #e0e6f0; }
.table th { background: var(--secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); border-color: var(--border); }
.table td { border-color: var(--border); vertical-align: middle; }
.table tbody tr:hover { background: rgba(0,212,255,.04); }

/* ── Footer ──────────────────────────────────────────────── */
.jht-footer {
  background: var(--primary);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
}
.footer-link { color: #667788; text-decoration: none; display: block; margin-bottom: 6px; transition: color var(--transition); }
.footer-link:hover { color: var(--accent); }
.social-link {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); color: #8899aa;
  text-decoration: none; transition: all var(--transition);
}
.social-link:hover { background: rgba(0,212,255,.15); color: var(--accent); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--primary); }
::-webkit-scrollbar-thumb { background: #334455; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { font-size: 2rem; }
  .jht-hero { min-height: 70vh; padding: 60px 0; }
  .hero-stats { gap: 20px; }
  .ai-chat-box { width: calc(100vw - 32px); right: 16px; }
}

/* ── Animations ──────────────────────────────────────────── */
.fade-up {
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.fade-up.visible { opacity: 1; transform: none; }
