/* ─── Fonts ─── */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap");

/* ─── Design Tokens ─── */
:root {
  --bg-primary: #0d0f1a;
  --bg-secondary: #131528;
  --bg-card: rgba(255, 255, 255, 0.025);
  --bg-card-hover: rgba(255, 255, 255, 0.05);
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text-primary: #e8eaed;
  --text-secondary: #8b8fa3;
  --text-muted: #484c64;
  --accent: #c8ff00;
  --accent-dim: rgba(200, 255, 0, 0.15);
  --accent-glow: rgba(200, 255, 0, 0.08);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.5), 0 6px 12px rgba(0,0,0,0.4);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.6);
}

/* ─── Base ─── */
html {
  background: var(--bg-primary);
}

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  color: #c0c4d6;
}

/* ─── Noise Overlay ─── */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* ─── Gradient Background ─── */
.gradient-bg {
  background: linear-gradient(-45deg, #0d0f1a, #141830, #0d0f1a, #111428);
  background-size: 400% 400%;
  animation: gradientShift 20s ease infinite;
}

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

/* ─── Floating Orbs ─── */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  animation: orbFloat 25s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.06), transparent 70%);
  top: -200px;
  right: -100px;
  filter: blur(100px);
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.04), transparent 70%);
  bottom: -150px;
  left: -100px;
  filter: blur(100px);
  animation-delay: -8s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(200, 255, 0, 0.03), transparent 70%);
  top: 40%;
  left: 30%;
  filter: blur(120px);
  animation-delay: -16s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(20px, -20px) scale(1.03); }
  50% { transform: translate(-15px, 15px) scale(0.97); }
  75% { transform: translate(10px, -10px) scale(1.01); }
}

/* ─── Dot Grid ─── */
.dot-grid {
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* ─── 3-Tier Glassmorphism ─── */
.glass {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
}

.glass-card {
  background: rgba(19, 21, 40, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.glass-strong {
  background: rgba(13, 15, 26, 0.90);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-lg);
}

/* ─── Animated Gradient Border ─── */
.gradient-border {
  position: relative;
}

.gradient-border::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(200,255,0,0.4), rgba(200,255,0,0.1), rgba(200,255,0,0.05), rgba(200,255,0,0.4));
  background-size: 300% 300%;
  animation: gradientBorderRotate 6s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

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

/* ─── Accent Button ─── */
.btn-glow {
  background: var(--accent);
  color: #0d0f1a;
  font-weight: 700;
  box-shadow:
    0 0 15px rgba(200, 255, 0, 0.2),
    0 0 40px rgba(200, 255, 0, 0.06),
    0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glow:hover {
  box-shadow:
    0 0 25px rgba(200, 255, 0, 0.35),
    0 0 60px rgba(200, 255, 0, 0.1),
    0 8px 25px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

.btn-glow:active {
  transform: translateY(0) scale(0.98);
  box-shadow:
    0 0 10px rgba(200, 255, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ─── Secondary Button ─── */
.btn-outline {
  background: transparent;
  border: 1px solid rgba(200, 255, 0, 0.25);
  color: var(--accent);
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: rgba(200, 255, 0, 0.06);
  border-color: rgba(200, 255, 0, 0.4);
}

/* ─── Ripple ─── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(13,15,26,0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.btn-ripple:active::after {
  transform: scale(0);
  opacity: 1;
  transition: 0s;
}

/* ─── Loading Spinner ─── */
.btn-loading {
  pointer-events: none;
  opacity: 0.85;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(13,15,26, 0.3);
  border-top-color: #0d0f1a;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ─── Gradient Text (lime) ─── */
.gradient-text {
  background: linear-gradient(135deg, #c8ff00, #a0e000, #d0ff40, #c8ff00);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientTextShift 4s linear infinite;
}

@keyframes gradientTextShift {
  to { background-position: 200% center; }
}

/* ─── Typing ─── */
.typing-cursor::after {
  content: "|";
  animation: blink 1s step-end infinite;
  color: var(--accent);
  font-weight: 300;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ─── Link Underline ─── */
.link-hover {
  position: relative;
  text-decoration: none;
}

.link-hover::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.link-hover:hover::after {
  width: 100%;
}

/* ─── Feature Cards ─── */
.feature-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 50px rgba(200, 255, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ─── Floating Labels ─── */
.float-label {
  position: relative;
}

.float-label input {
  transition: border-color 0.2s ease, box-shadow 0.3s ease;
}

.float-label input:focus {
  border-color: rgba(200, 255, 0, 0.35);
  box-shadow: 0 0 0 3px rgba(200, 255, 0, 0.06), 0 0 20px rgba(200, 255, 0, 0.03);
}

.float-label label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  color: #484c64;
  font-size: 0.875rem;
}

.float-label.has-icon label {
  left: 44px;
}

.float-label input:focus ~ label,
.float-label input:not(:placeholder-shown) ~ label {
  top: -8px;
  transform: translateY(0);
  font-size: 0.70rem;
  color: var(--accent);
  background: var(--bg-secondary);
  padding: 0 6px;
  letter-spacing: 0.02em;
}

/* ─── Sidebar ─── */
#sidebar {
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid transparent;
  position: relative;
}

.nav-link:hover {
  background: rgba(200, 255, 0, 0.04);
  color: #d0d4e0;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(200,255,0,0.08), rgba(200,255,0,0.01));
  color: var(--accent);
  border-left-color: transparent;
}

.nav-link.active svg {
  color: var(--accent);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  width: 3px;
  height: 70%;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

/* ─── Sidebar Sections ─── */
.sidebar-section {
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.sidebar-section-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #3a3e54;
  padding: 4px 12px 6px;
  font-weight: 600;
}

/* ─── Sidebar Collapsed ─── */
#sidebar.collapsed {
  width: 72px;
}

#sidebar.collapsed .nav-label,
#sidebar.collapsed .sidebar-title,
#sidebar.collapsed .sidebar-section-label {
  display: none;
}

#sidebar.collapsed .nav-link {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

/* ─── Session Table ─── */
.session-row {
  transition: all 0.15s ease;
}

.session-row:hover {
  background: rgba(200, 255, 0, 0.02);
}

.session-row:hover td:first-child .session-email {
  color: var(--accent);
}

/* ─── Status Badges ─── */
.pulse-dot {
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 0, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(200, 255, 0, 0); }
}

/* ─── Stat Cards ─── */
.stat-card {
  background: rgba(19, 21, 40, 0.5);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.stat-card-accent {
  background: linear-gradient(135deg, rgba(200,255,0,0.05), rgba(200,255,0,0.01));
  border: 1px solid rgba(200,255,0,0.10);
  box-shadow: var(--shadow-sm);
}

.stat-card-green {
  background: linear-gradient(135deg, rgba(34,197,94,0.06), rgba(34,197,94,0.01));
  border: 1px solid rgba(34,197,94,0.10);
  box-shadow: var(--shadow-sm);
}

.stat-card-red {
  background: linear-gradient(135deg, rgba(239,68,68,0.06), rgba(239,68,68,0.01));
  border: 1px solid rgba(239,68,68,0.10);
  box-shadow: var(--shadow-sm);
}

.stat-card-violet {
  background: linear-gradient(135deg, rgba(139,92,246,0.05), rgba(139,92,246,0.01));
  border: 1px solid rgba(139,92,246,0.08);
  box-shadow: var(--shadow-sm);
}

/* ─── Drop Zone ─── */
.drop-zone {
  border: 2px dashed rgba(200, 255, 0, 0.15);
  transition: all 0.3s ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: rgba(200, 255, 0, 0.4);
  background: rgba(200, 255, 0, 0.02);
}

/* ─── Stat Counter ─── */
.stat-number {
  font-variant-numeric: tabular-nums;
}

/* ─── Skeleton ─── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 25%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.02) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── Stagger ─── */
.stagger-in {
  opacity: 0;
  transform: translateY(14px);
  animation: staggerFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.stagger-in:nth-child(1) { animation-delay: 0.04s; }
.stagger-in:nth-child(2) { animation-delay: 0.08s; }
.stagger-in:nth-child(3) { animation-delay: 0.12s; }
.stagger-in:nth-child(4) { animation-delay: 0.16s; }
.stagger-in:nth-child(5) { animation-delay: 0.20s; }
.stagger-in:nth-child(6) { animation-delay: 0.24s; }
.stagger-in:nth-child(7) { animation-delay: 0.28s; }
.stagger-in:nth-child(8) { animation-delay: 0.32s; }

@keyframes staggerFadeIn {
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Card Entrance ─── */
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Toast ─── */
.toast {
  animation: toastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
}

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ─── Modal ─── */
.modal-backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

/* ─── View Transitions ─── */
.view-section {
  animation: fadeSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Scroll Reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Activity Timeline ─── */
.activity-item {
  position: relative;
  padding-left: 28px;
}

.activity-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 22px;
  bottom: -16px;
  width: 1px;
  background: linear-gradient(180deg, rgba(200,255,0,0.1), transparent);
}

.activity-item:last-child::before {
  display: none;
}

.activity-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Code Block ─── */
.code-block {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  font-family: "JetBrains Mono", "Fira Code", "SF Mono", monospace;
}

/* ─── Steps ─── */
.steps-connector {
  position: absolute;
  top: 28px;
  left: 50%;
  width: calc(100% - 48px);
  height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, rgba(200,255,0,0.3), rgba(200,255,0,0.15), rgba(200,255,0,0.3));
  opacity: 0.5;
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(200, 255, 0, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 255, 0, 0.2);
}

::selection {
  background: rgba(200, 255, 0, 0.2);
  color: #f1f5f9;
}

/* ─── Glow Line ─── */
.glow-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,255,0,0.3), transparent);
}

/* ─── User Dropdown ─── */
.user-dropdown {
  animation: dropdownIn 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Progress Ring ─── */
.progress-ring circle {
  transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    height: 100vh;
  }

  #sidebar.mobile-open {
    transform: translateX(0);
  }

  #sidebar-overlay {
    transition: opacity 0.3s ease;
  }
}

@media (min-width: 769px) {
  #sidebar-overlay {
    display: none !important;
  }
}

/* ─── Service Cards ─── */
.service-card {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  border-color: rgba(200, 255, 0, 0.1);
}

/* ─── Service Select Button ─── */
.service-select-btn {
  transition: all 0.15s ease;
  position: relative;
}

.service-select-btn:hover {
  border-color: rgba(200, 255, 0, 0.15);
}

/* ─── Scrollbar Hide ─── */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ─── Upload Steps ─── */
#upload-step-1,
#upload-step-2 {
  animation: fadeSlideIn 0.25s ease-out;
}

/* ─── Logo Container ─── */
.logo-container {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-container img {
  object-fit: contain;
}

/* ─── Permission Badge ─── */
.permission-badge {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── Status Badge Yellow ─── */
.stat-card-yellow {
  background: linear-gradient(135deg, rgba(234,179,8,0.06), rgba(234,179,8,0.01));
  border: 1px solid rgba(234,179,8,0.10);
  box-shadow: var(--shadow-sm);
}

/* ─── Color Picker ─── */
input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 6px;
}

/* ─── Checkbox Styling ─── */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #2a2d42;
  border-radius: 4px;
  background: rgba(19, 21, 40, 0.4);
  cursor: pointer;
  position: relative;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #0d0f1a;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
