/* ==========================================================================
   COOP-SAKSHAM 360 - Futuristic AI Operating System Design System
   National Council for Cooperative Training (NCCT)
   ========================================================================== */

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

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass: rgba(255, 255, 255, 0.82);
  --bg-glass-dark: rgba(15, 23, 42, 0.94);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;

  --navy-950: #060b14;
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;

  --blue-primary: #2563eb;
  --blue-glow: #3b82f6;
  --blue-light: #60a5fa;
  --blue-soft: #eff6ff;

  --teal-accent: #0d9488;
  --emerald-accent: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.25);
  --emerald-soft: #ecfdf5;

  --amber-accent: #f59e0b;
  --amber-soft: #fffbeb;

  --purple-accent: #8b5cf6;
  --purple-soft: #f5f3ff;

  --border-subtle: rgba(226, 232, 240, 0.9);
  --border-glow: rgba(59, 130, 246, 0.35);
  --border-emerald: rgba(16, 185, 129, 0.35);

  --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, 0.1), 0 0 0 1px rgba(226, 232, 240, 0.8);
  --shadow-glow: 0 0 35px -5px rgba(37, 99, 235, 0.2);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-width: 250px;
  --sidebar-collapsed-width: 72px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background Cyber Grid */
.cyber-grid-bg {
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 100% 40%, rgba(16, 185, 129, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 0% 70%, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
    linear-gradient(to right, rgba(226, 232, 240, 0.45) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 232, 240, 0.45) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 48px 48px, 48px 48px;
  background-position: center top;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--navy-900);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Glass Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.3);
  box-shadow: var(--shadow-lg);
}

/* Top Sticky Navigation Bar */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 20px -5px rgba(15, 23, 42, 0.05);
}

/* Fixed Sidebar Navigation */
.app-sidebar {
  position: fixed;
  top: 73px; /* Just below top navbar */
  left: 0;
  bottom: 0;
  width: var(--sidebar-collapsed-width);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(226, 232, 240, 0.9);
  z-index: 40;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.app-sidebar:hover, .app-sidebar.expanded {
  width: var(--sidebar-width);
  box-shadow: 10px 0 30px -10px rgba(15, 23, 42, 0.08);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  margin: 4px 8px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-link svg, .nav-link i {
  min-width: 22px;
  width: 22px;
  height: 22px;
  margin-right: 14px;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-link:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue-primary);
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--blue-primary), var(--blue-glow));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.sidebar-label {
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.app-sidebar:hover .sidebar-label, .app-sidebar.expanded .sidebar-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

/* Main Content Layout Container */
.main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  min-height: calc(100vh - 73px);
}

/* Page Views for Router */
.page-view {
  display: block;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-view.hidden {
  display: none !important;
  opacity: 0;
  transform: translateY(12px);
}

/* Animated Gradient Border for Insights */
.glow-border-animated {
  position: relative;
  border-radius: 24px;
  padding: 1.5px;
  background: linear-gradient(90deg, #3b82f6, #10b981, #8b5cf6, #3b82f6);
  background-size: 300% 300%;
  animation: gradientBorder 6s ease infinite;
}

.glow-border-animated > .inner-content {
  background: #ffffff;
  border-radius: 22.5px;
  height: 100%;
  width: 100%;
}

@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pulse Indicators */
.pulse-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--emerald-accent);
  position: relative;
  display: inline-block;
}

.pulse-indicator::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid var(--emerald-accent);
  animation: pulseRipple 1.8s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

@keyframes pulseRipple {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.pulse-indicator-blue {
  background: var(--blue-glow);
}
.pulse-indicator-blue::after {
  border-color: var(--blue-glow);
}

/* Metric Cards */
.metric-card {
  position: relative;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.metric-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 35px -8px rgba(37, 99, 235, 0.14), 0 0 0 1.5px var(--blue-glow);
}

/* Digital Skill Passport 3D Holographic */
.passport-card-container {
  perspective: 1200px;
}

.passport-card {
  position: relative;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 249, 255, 0.92) 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(37, 99, 235, 0.15);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  transform-style: preserve-3d;
  overflow: hidden;
}

.passport-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.12) 0%, transparent 60%),
              linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.5) 50%, transparent 60%);
  pointer-events: none;
  transform: rotate(25deg);
  opacity: 0.7;
}

/* Laser Scanner */
.laser-scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #3b82f6, #60a5fa, #3b82f6, transparent);
  box-shadow: 0 0 15px #3b82f6, 0 0 30px #60a5fa;
  animation: laserSweep 3s ease-in-out infinite alternate;
  z-index: 10;
}

@keyframes laserSweep {
  0% { top: 4%; opacity: 0.3; }
  50% { opacity: 1; }
  100% { top: 96%; opacity: 0.3; }
}

/* Floating SAKSHAM AI Orb */
.ai-orb-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #60a5fa 0%, #2563eb 55%, #1e1b4b 100%);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4), 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 30px rgba(59, 130, 246, 0.5);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: orbBreath 4s ease-in-out infinite;
}

.ai-orb-button:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.6), 0 0 0 4px rgba(255, 255, 255, 1);
}

.ai-orb-core {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, #93c5fd 60%, transparent 100%);
}

@keyframes orbBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* AI Assistant Drawer */
.ai-assistant-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(37, 99, 235, 0.15);
  z-index: 998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-assistant-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Kinetic Words Outro */
.kinetic-word {
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-block;
}

.kinetic-word.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.3);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.94) translateY(15px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-card {
  transform: scale(1) translateY(0);
}

/* Radar Sweep */
.radar-sweep-circle {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
}

.radar-sweep-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 50%;
  transform-origin: 0% 0%;
  background: linear-gradient(45deg, rgba(37, 99, 235, 0.25) 0%, rgba(37, 99, 235, 0.05) 50%, transparent 100%);
  animation: radarSpin 4s linear infinite;
  pointer-events: none;
}

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 9px 20px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-secondary {
  background: #ffffff;
  color: var(--navy-900);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 9px 18px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  border-color: var(--blue-light);
  color: var(--blue-primary);
  transform: translateY(-1.5px);
  box-shadow: var(--shadow-md);
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-pill-emerald {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-pill-blue {
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.status-pill-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    height: 60px;
    flex-direction: row;
    border-right: none;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    padding: 0 8px;
    align-items: center;
    justify-content: space-around;
  }
  .app-sidebar .sidebar-label, .app-sidebar .sidebar-bottom-action {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
    padding-bottom: 75px !important;
  }
}
