/* ===============================
   🚀 APEXIFY/CYBER-TECH DESIGN SYSTEM - CODE CHALLENGE
   Premium, Immersive, Futuristic Sci-Fi Platform
   =============================== */

:root {
  /* Primary Colors - Neon/Cyber Purple */
  --color-primary: #8A2BE2;
  --color-primary-hover: #9D4EDD;
  --color-primary-light: #C77DFF;
  --color-primary-dark: #5A189A;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #7B2CBF 0%, #9D4EDD 100%);
  --gradient-success: linear-gradient(135deg, #00B4D8 0%, #0077B6 100%);
  --gradient-warm: linear-gradient(135deg, #FF6D00 0%, #FF9100 100%);
  --gradient-cool: linear-gradient(135deg, #00E5FF 0%, #00B4D8 100%);
  --gradient-premium: linear-gradient(135deg, #FF006E 0%, #8338EC 100%);

  /* Semantic Colors */
  --color-success: #00E5FF;
  --color-success-dark: #00B4D8;
  --color-success-light: #CCF9FF;
  --color-warning: #FFBE0B;
  --color-warning-dark: #FB5607;
  --color-warning-light: #FFF2CC;
  --color-danger: #FF006E;
  --color-danger-dark: #D90429;
  --color-danger-light: #FFD6E0;
  --color-info: #3A86FF;
  --color-info-dark: #0077B6;
  --color-info-light: #CAF0F8;

  /* Neutral Colors - Light Mode (Clean, Refined Tech) */
  --color-bg: #F4F5F7;
  --color-bg-secondary: #E9ECEF;
  --color-surface: #FFFFFF;
  --color-surface-elevated: rgba(255, 255, 255, 0.85); /* Glass base */
  --color-text: #111418;
  --color-text-secondary: #495057;
  --color-text-muted: #868E96;
  --color-border: #DEE2E6;
  --color-border-light: #F1F3F5;
  --color-border-dark: #CED4DA;

  /* Sidebar & Navigation */
  --sidebar-bg: rgba(255, 255, 255, 0.75);
  --sidebar-border: rgba(255, 255, 255, 0.3);
  --topbar-bg: rgba(255, 255, 255, 0.7);
  --topbar-backdrop: blur(20px);

  /* Shadows - Elevated Glass and Flow */
  --shadow-xs: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 25px rgba(138, 43, 226, 0.4);

  /* Radius - Sharp, premium, professional */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-2xl: 12px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===============================
   DARK MODE - THE CYBER/APEXIFY HEART
   =============================== */
:root[data-theme="dark"] {
  /* Primary Colors - Vivid on dark */
  --color-primary: #B266FF;
  --color-primary-hover: #D4A1FF;
  --color-primary-light: #E5C3FF;
  --color-primary-dark: #7B2CBF;

  /* Semantic Colors - Dark Mode */
  --color-success: #00F5D4;
  --color-success-dark: #00BB9D;
  --color-success-light: rgba(0, 245, 212, 0.15);
  --color-warning: #FEE440;
  --color-warning-dark: #D4AF37;
  --color-warning-light: rgba(254, 228, 64, 0.15);
  --color-danger: #F15BB5;
  --color-danger-dark: #C9184A;
  --color-danger-light: rgba(241, 91, 181, 0.15);
  --color-info: #00F5D4;
  --color-info-dark: #00BB9D;
  --color-info-light: rgba(0, 245, 212, 0.15);

  /* Neutral Colors - Dark Mode - Deep Void */
  --color-bg: #090A0F;
  --color-bg-secondary: #12141D;
  --color-surface: rgba(20, 22, 31, 0.65); /* Glassmorphism background */
  --color-surface-elevated: rgba(28, 31, 46, 0.85);
  --color-text: #F3F4F6;
  --color-text-secondary: #9CA3AF;
  --color-text-muted: #6B7280;
  --color-border: rgba(255, 255, 255, 0.08); /* Extremely subtle border */
  --color-border-light: rgba(255, 255, 255, 0.04);
  --color-border-dark: rgba(0, 0, 0, 0.5);

  /* Sidebar & Navigation - Dark Mode Glass */
  --sidebar-bg: rgba(13, 14, 21, 0.75);
  --sidebar-border: rgba(255, 255, 255, 0.05);
  --topbar-bg: rgba(13, 14, 21, 0.6);
  
  /* Shadows - Dark Mode Glows */
  --shadow-xs: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 20px rgba(178, 102, 255, 0.3), 0 0 40px rgba(178, 102, 255, 0.1);
}

/* ===============================
   AMBIENT GLOW SYSTEM
   =============================== */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  transition: opacity var(--transition-slow);
}
:root[data-theme="dark"] .ambient-glow.glow-1 {
  width: 50vw;
  height: 50vh;
  top: -10vh;
  left: -10vw;
  background: radial-gradient(circle, rgba(138,43,226,0.15) 0%, rgba(0,0,0,0) 70%);
}
:root[data-theme="dark"] .ambient-glow.glow-2 {
  width: 60vw;
  height: 60vh;
  bottom: -20vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(0,229,255,0.1) 0%, rgba(0,0,0,0) 70%);
}
:root .ambient-glow.glow-1 {
  width: 60vw;
  height: 60vh;
  top: -20vh;
  left: -20vw;
  background: radial-gradient(circle, rgba(138,43,226,0.06) 0%, rgba(255,255,255,0) 70%);
}
:root .ambient-glow.glow-2 {
  width: 50vw;
  height: 50vh;
  bottom: -10vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(0,180,216,0.05) 0%, rgba(255,255,255,0) 70%);
}

/* ===============================
   RESET & BASE STYLES
   =============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0;
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5 {
  font-size: 1.125rem;
}

h6 {
  font-size: 1rem;
}

p {
  margin: 0;
  line-height: 1.7;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* ===============================
   LAYOUT PRINCIPAL
   =============================== */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
  background: var(--color-bg);
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===============================
   SIDEBAR - MODERN NAVIGATION
   =============================== */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-base);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Brand */
.sidebar__brand {
  padding: 0.5rem 0.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text);
  text-decoration: none;
  transition: all var(--transition-base);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  letter-spacing: -0.3px;
}

.brand:hover {
  color: var(--color-primary);
}

.brand-icon {
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(138, 43, 226, 0.5));
}

/* Navigation */
.sidebar__nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.navlink {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

.navlink:hover {
  background: rgba(138, 43, 226, 0.08);
  color: var(--color-text);
  border-color: rgba(138, 43, 226, 0.15);
}

.navlink:hover .icon {
  color: var(--color-primary);
}

.navlink.active {
  background: rgba(138, 43, 226, 0.15);
  color: #fff;
  border: 1px solid rgba(138, 43, 226, 0.3);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-primary);
}

.navlink.active .icon {
  color: var(--color-primary);
  filter: drop-shadow(0 0 6px rgba(138, 43, 226, 0.5));
}

.navlink .icon {
  flex-shrink: 0;
  transition: all var(--transition-base);
}

.navlink.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.badge-soon {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 8px;
  background: rgba(138, 43, 226, 0.15);
  border-radius: 999px;
  font-weight: 700;
  color: var(--color-primary);
  border: 1px solid rgba(138, 43, 226, 0.25);
}

.nav-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}

/* User Mini Card */
.sidebar__footer {
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.user-mini {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem;
  border-radius: var(--radius-md);
  background: var(--color-bg-secondary);
  transition: all var(--transition-base);
  cursor: pointer;
  border: 1px solid transparent;
}

.user-mini:hover {
  background: var(--color-border-light);
  border-color: var(--color-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.user-mini-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  overflow: hidden;
}

.user-mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-mini-info {
  flex: 1;
  min-width: 0;
}

.user-mini-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini-email {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===============================
   TOPBAR - GLASS EFFECT
   =============================== */
.topbar {
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle Button */
.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-xs);
}

.btn-icon:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.only-light {
  display: inline;
}

.only-dark {
  display: none;
}

:root[data-theme="dark"] .only-light {
  display: none;
}

:root[data-theme="dark"] .only-dark {
  display: inline;
}

/* Avatar Menu */
.avatar-menu {
  position: relative;
}

.avatar-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--gradient-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  overflow: hidden;
}

.avatar-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  font-weight: 700;
  color: white;
  font-size: 1rem;
}

.avatar-dropdown {
  position: absolute;
  right: 0;
  top: 52px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 240px;
  padding: 0.75rem;
  display: none;
  z-index: 50;
  animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.avatar-dropdown[aria-hidden="false"] {
  display: block;
}

.avatar-info {
  padding: 0.875rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.avatar-info .name {
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  font-size: 0.9375rem;
}

.avatar-info .email {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.dropdown-item svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  text-decoration: none;
}

.dropdown-item:hover svg {
  color: var(--color-primary);
}

.dropdown-item.danger {
  color: var(--color-danger);
}

.dropdown-item.danger svg {
  color: var(--color-danger);
}

.dropdown-item.danger:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.dropdown-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: all var(--transition-base);
}

.mobile-menu-btn:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.mobile-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ===============================
   CONTENT AREA
   =============================== */
.content {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

/* ===============================
   COMPONENTS - CARDS
   =============================== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ===============================
   BUTTONS
   =============================== */
.button,
.btn-primary,
.btn-secondary,
.btn-ghost {
  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-size: 0.9375rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

.button.primary,
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(138, 43, 226, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}

.button.primary:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(138, 43, 226, 0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}

.button.secondary,
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xs);
}

.button.secondary:hover,
.btn-secondary:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.button.ghost,
.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
}

.button.ghost:hover,
.btn-ghost:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.button.disabled,
.btn-primary.disabled,
.btn-secondary.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

.btn-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(138, 43, 226, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all var(--transition-base);
}

.btn-header-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(138, 43, 226, 0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* ===============================
   BADGES & PILLS
   =============================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: capitalize;
}

.badge.facil,
.badge-facil {
  background: rgba(0, 229, 160, 0.12);
  color: #00E5A0;
  border: 1px solid rgba(0, 229, 160, 0.3);
}

.badge.medio,
.badge-medio {
  background: rgba(255, 190, 11, 0.12);
  color: #FFBE0B;
  border: 1px solid rgba(255, 190, 11, 0.3);
}

.badge.dificil,
.badge-dificil {
  background: rgba(255, 61, 113, 0.12);
  color: #FF3D71;
  border: 1px solid rgba(255, 61, 113, 0.3);
}

.chip,
.chip-category {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  transition: all var(--transition-fast);
}

.chip:hover,
.chip-category:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

/* ===============================
   DASHBOARD
   =============================== */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Dashboard Header */
.dashboard-header {
  background: var(--gradient-primary);
  padding: 2.5rem;
  border-radius: var(--radius-2xl);
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.dashboard-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

.header-content {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.header-text h1 {
  font-size: 2rem;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-text p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.0625rem;
}

/* Stats Grid - equal columns */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 0;
}

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.stat-icon.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
  color: var(--color-primary);
}

.stat-icon.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
  color: var(--color-success);
}

.stat-icon.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
  color: var(--color-warning);
}

.stat-icon.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
  color: var(--color-info);
}

.stat-content {
  flex: 1;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  margin-bottom: 0.375rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
}

/* Section Headers */
.section-head {
  margin-bottom: 1.5rem;
}

.section-head h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.section-head p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.section-head.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.view-all-link {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.view-all-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Empty State */
.empty-state-card {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-secondary);
  border-radius: 50%;
  color: var(--color-primary);
}

.empty-state-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.empty-state-card p {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.empty-message {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

.empty-message svg {
  margin-bottom: 1rem;
  color: var(--color-text-muted);
  opacity: 0.5;
}

/* ===============================
   TABLES
   =============================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: transparent;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.table thead th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  background: transparent;
}

.table tbody tr {
  background: var(--color-surface);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: all var(--transition-base);
  border-radius: var(--radius-md);
}

.table tbody tr:hover {
  background: var(--color-bg-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.table tbody tr.current-user {
  background: linear-gradient(135deg, rgba(138,43,226, 0.15) 0%, rgba(0,229,255, 0.05) 100%);
  border-left: 4px solid var(--color-primary);
}

.table tbody td {
  padding: 1rem 1.25rem;
  font-size: 0.95rem;
  border: none;
}
.table tbody td:first-child { border-top-left-radius: var(--radius-md); border-bottom-left-radius: var(--radius-md); }
.table tbody td:last-child { border-top-right-radius: var(--radius-md); border-bottom-right-radius: var(--radius-md); }

.th-right,
.td-right {
  text-align: right;
}

.th-center,
.td-center {
  text-align: center;
}

/* Rank Badges */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.8125rem;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
  color: #8b6914;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

.rank-badge.silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
  color: #505050;
  box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #e89e66 100%);
  color: #6b3e1a;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.rank-index {
  color: var(--color-text-muted);
  font-weight: 600;
}

/* Medals */
.medal {
  font-size: 1.5rem;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.pos {
  font-weight: 700;
  color: var(--color-text-muted);
}

.pos.top-10 {
  color: var(--color-primary);
  font-weight: 800;
}

/* User Line */
.user-line {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.avatar.tiny {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.avatar.tiny.current {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.user-meta .name {
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.you-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: var(--color-primary-light);
  color: white;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
}

.user-meta .sub {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Table Stats */
.table-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.table-stat svg {
  color: var(--color-text-muted);
}

.table-stat.points {
  color: var(--color-primary);
}

.table-stat.points svg {
  color: var(--color-primary);
}

/* ===============================
   ACTIVITY LIST
   =============================== */
.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-border);
  transition: all var(--transition-fast);
}

.activity-item:hover {
  background: var(--color-border-light);
  transform: translateX(4px);
}

.activity-item.ok {
  border-left-color: var(--color-success);
}

.activity-item.err {
  border-left-color: var(--color-danger);
}

.activity-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  flex-shrink: 0;
}

.activity-item.ok .activity-dot {
  background: var(--color-success);
  box-shadow: 0 0 8px var(--color-success);
}

.activity-item.err .activity-dot {
  background: var(--color-danger);
  box-shadow: 0 0 8px var(--color-danger);
}

.activity-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.activity-title {
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.activity-title:hover {
  color: var(--color-primary);
}

.activity-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 600;
  font-size: 0.8125rem;
}

.status.ok {
  color: var(--color-success);
}

.status.err {
  color: var(--color-danger);
}

/* ===============================
   EXERCISE LIST
   =============================== */
.page-header {
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.header-main h1 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.header-main h1 svg {
  color: var(--color-primary);
}

.header-stats {
  display: flex;
  gap: 1.5rem;
}

.stat-mini {
  text-align: center;
}

.stat-mini-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-mini-label {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Filters */
.filters-card {
  margin-bottom: 2rem;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filters-header h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
}

.collapse-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.collapse-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-text);
}

.filters-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}


.filters-grid.collapsed {
  display: none;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text);
}

.filter-label svg {
  color: var(--color-primary);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  caret-color: var(--color-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-control:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.help-text {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 0.375rem;
}

.help-text svg {
  flex-shrink: 0;
}

.pill-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 0.875rem;
}

.pill:hover {
  background: var(--color-bg-secondary);
  border-color: var(--color-primary);
}

.pill input {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.radio-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.radio-label:hover {
  color: var(--color-primary);
}

.radio-label input {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-self: end;
  align-items: center;
}

.filter-actions .button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  white-space: nowrap;
}


/* Results Info */
.exercise-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.results-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.results-info svg {
  color: var(--color-primary);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-compact {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

/* Exercise List */
.exercise-list {
  display: grid;
  gap: 1.25rem;
}

.exercise-row {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.exercise-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gradient-primary);
  transform: scaleY(0);
  transition: transform var(--transition-base);
}

.exercise-row:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.exercise-row:hover::before {
  transform: scaleY(1);
}

.exercise-main {
  min-width: 0;
}

.exercise-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.exercise-title a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.exercise-title a:hover {
  color: var(--color-primary);
}

.exercise-meta {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.meta-item svg {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.meta-item.points {
  color: var(--color-primary);
  font-weight: 600;
}

.meta-item.points svg {
  color: var(--color-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.8125rem;
}

.status-badge.solved {
  background: var(--color-success-light);
  color: var(--color-success);
}

.status-badge.attempted {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.status-badge.unsolved {
  background: var(--color-bg-secondary);
  color: var(--color-text-muted);
}

.exercise-actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.fav-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-base);
}

.fav-btn:hover {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.05);
}

.fav-btn.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.solve-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all var(--transition-base);
}

.solve-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* Pagination */
.pagination-card {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.pagination-info {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.pagination-info strong {
  color: var(--color-primary);
}

/* ===============================
   LEADERBOARD (RANKING)
   =============================== */
.podium-section {
  margin-bottom: 2rem;
}

.podium-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.podium-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.podium-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.podium-1::before {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.podium-2::before {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.podium-3::before {
  background: linear-gradient(135deg, #cd7f32 0%, #e89e66 100%);
}

.podium-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.podium-rank {
  margin-bottom: 1rem;
}

.podium-medal {
  font-size: 3rem;
  display: inline-block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.podium-avatar {
  margin-bottom: 1.5rem;
}

.avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 3px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.avatar-large.current {
  border-color: var(--color-primary);
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.podium-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.podium-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.podium-stats {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.podium-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.podium-stat svg {
  color: var(--color-primary);
}

.podium-stat strong {
  color: var(--color-text);
}

/* Leaderboard Filters */
.leaderboard-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.rule-box {
  grid-column: 1 / -1;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.rule-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
}

.rule-box p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.rule-box p:last-child {
  margin-bottom: 0;
}

/* Leaderboard Card */
.leaderboard-card {
  padding: 0;
  overflow: hidden;
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.leaderboard-header h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
}

.leaderboard-count {
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.875rem;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table thead th {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-border);
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-fast);
}

.leaderboard-table tbody tr:hover {
  background: var(--color-bg-secondary);
}

.leaderboard-table tbody tr.current-user {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(129, 140, 248, 0.04) 100%);
  border-left: 3px solid var(--color-primary);
}

.leaderboard-table tbody td {
  padding: 1.25rem 1.5rem;
  font-size: 0.9375rem;
}

.pos-cell {
  text-align: center;
  width: 70px;
}

.user-cell {
  min-width: 200px;
}

.leaderboard-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
  flex-wrap: wrap;
}

.cta-info p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.cta-actions {
  display: flex;
  gap: 0.875rem;
}

.ranking-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.75rem;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.ranking-footer svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* ===============================
   EXERCISE DETAIL PAGE
   =============================== */
.breadcrumb-nav {
  margin-bottom: 1.5rem;
}

.breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
}

.breadcrumb-link:hover {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
}

.exercise-head {
  margin-bottom: 2rem;
  padding: 2rem;
}

.exercise-head-main {
  margin-bottom: 1.5rem;
}

.exercise-tags {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.exercise-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.exercise-description {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.exercise-head-side {
  display: flex;
  justify-content: flex-end;
}

.points-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: 1.125rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.points-badge svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.exercise-shell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

/* Panel */
.panel {
  display: flex;
  flex-direction: column;
  height: fit-content;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.panel-header h3 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.125rem;
}

.panel-body {
  padding: 1.5rem;
  flex: 1;
}

.exercise-statement {
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
}

/* History Section */
.history-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.history-section h4 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.history-item.success {
  border-left: 3px solid var(--color-success);
}

.history-item.error {
  border-left: 3px solid var(--color-danger);
}

.history-item.empty {
  justify-content: center;
  color: var(--color-text-muted);
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  flex-shrink: 0;
}

.history-item.success .history-dot {
  background: var(--color-success);
  box-shadow: 0 0 6px var(--color-success);
}

.history-item.error .history-dot {
  background: var(--color-danger);
  box-shadow: 0 0 6px var(--color-danger);
}

.history-time {
  font-weight: 500;
  color: var(--color-text-secondary);
}

.history-status {
  margin-left: auto;
  font-weight: 600;
}

.history-item.success .history-status {
  color: var(--color-success);
}

.history-item.error .history-status {
  color: var(--color-danger);
}

/* Editor Section */
.editor-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.editor-panel {
  padding: 0;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.editor-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.editor-actions {
  display: flex;
  gap: 0.5rem;
}

.CodeMirror {
  height: 400px !important;
  border-radius: 0 !important;
  font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

.runbar {
  display: flex;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

/* Results */
.results {
  padding: 0;
  overflow: hidden;
}

.result-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-secondary);
}

.result-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  padding: 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.result-tab:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.result-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  background: var(--color-surface);
}

.result-body {
  padding: 1.5rem;
  min-height: 200px;
}

.result-body pre {
  background: var(--color-bg-secondary);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: 'Fira Code', 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

.result-body code {
  color: var(--color-text);
}

.empty-result {
  text-align: center;
  padding: 2rem;
}

.empty-result svg {
  color: var(--color-text-muted);
  opacity: 0.5;
  margin-bottom: 1rem;
}

.empty-result p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

/* Banner Messages */
#banner-area {
  margin-bottom: 1rem;
}

.banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.banner svg {
  flex-shrink: 0;
}

.banner.ok {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.banner.err {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

/* ===============================
   AUTH PAGES
   =============================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 8s ease-in-out infinite;
}

.auth-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
}

.auth-container-wide {
  max-width: 520px;
}

.auth-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.875rem;
  margin-bottom: 0.5rem;
  color: white;
}

.auth-header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1.125rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-text);
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
}

.form-group input:focus {
  outline: none;
  border-color: white;
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.form-group input.error {
  border-color: var(--color-danger);
}

.form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-group input {
  accent-color: white;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.checkbox-group label {
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.forgot-link {
  color: white;
  font-weight: 600;
  font-size: 0.875rem;
  transition: opacity var(--transition-fast);
}

.forgot-link:hover {
  opacity: 0.8;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  color: white;
  font-size: 0.9375rem;
}

.auth-footer a {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}

.auth-footer a:hover {
  opacity: 0.8;
}

/* Signup Benefits */
.signup-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: 0.875rem;
}

.benefit-item svg {
  flex-shrink: 0;
  color: white;
}

.terms-notice {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}

.terms-notice a {
  color: white;
  font-weight: 600;
  text-decoration: underline;
}

/* Logout Page */
.logout-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logout-icon {
  color: white;
  margin-bottom: 1rem;
}

.logout-message {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
}

.logout-actions {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.btn-danger {
  background: var(--color-danger) !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
}

.btn-danger:hover {
  filter: brightness(0.9);
}

/* Password Reset */
.reset-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.reset-icon {
  color: white;
  margin-bottom: 1rem;
}

.reset-message {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9375rem;
}

.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}

.alert.error {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

.field-errors {
  margin-top: 0.375rem;
}

.error-text {
  display: block;
  color: var(--color-danger);
  font-size: 0.8125rem;
  font-weight: 500;
}

.required {
  color: var(--color-danger);
  margin-left: 0.25rem;
}

/* Profile Page (placeholder) */
.profile-header {
  background: var(--gradient-primary);
  padding: 2.5rem;
  border-radius: var(--radius-2xl);
  color: white;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

/* ===============================
   FOOTER
   =============================== */
.footer {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

/* ===============================
   UTILITIES
   =============================== */
.muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 1024px) {
  .exercise-shell {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
    width: 280px;
    box-shadow: var(--shadow-xl);
  }

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

  .mobile-menu-btn {
    display: flex;
  }

  .mobile-overlay {
    display: block;
  }

  .topbar {
    padding: 1rem 1.5rem;
  }

  .content {
    padding: 1.5rem;
  }

  .dashboard-header {
    padding: 2rem;
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filters-grid {
    grid-template-columns: 1fr;
  }

  .exercise-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .exercise-actions {
    justify-content: flex-end;
  }

  .podium-container {
    grid-template-columns: 1fr;
  }

  .leaderboard-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-actions {
    width: 100%;
  }

  .cta-actions .button {
    flex: 1;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  .content {
    padding: 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .dashboard-header {
    padding: 1.5rem;
  }

  .header-text h1 {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .topbar {
    padding: 0.875rem 1rem;
  }

  .auth-card {
    padding: 1.75rem;
  }

  .CodeMirror {
    height: 300px !important;
    font-size: 13px !important;
  }
}

/* ===============================
   DARK MODE REFINEMENTS
   =============================== */
:root[data-theme="dark"] .card:hover {
  box-shadow: var(--shadow-lg);
}

:root[data-theme="dark"] .exercise-row:hover {
  box-shadow: var(--shadow-xl);
}

:root[data-theme="dark"] .stat-card:hover {
  box-shadow: var(--shadow-xl);
}

:root[data-theme="dark"] .CodeMirror {
  background: var(--color-bg-secondary) !important;
  color: var(--color-text) !important;
}

:root[data-theme="dark"] .auth-wrapper {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* ===============================
   SCROLLBAR STYLING
   =============================== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ===============================
   PRINT STYLES
   =============================== */
@media print {

  .sidebar,
  .topbar,
  .footer,
  .mobile-overlay {
    display: none !important;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 0;
  }
}

/* ===============================
   ACCESSIBILITY
   =============================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline-offset: 4px;
}

/* ===============================
   ANIMATIONS & TRANSITIONS
   =============================== */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Loading animation placeholder */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-border);
  border-radius: 50%;
  border-top-color: var(--color-primary);
  animation: spin 1s linear infinite;
}

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

/* Success animation */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }

  100% {
    stroke-dashoffset: 0;
  }
}

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ===============================
   CUSTOM PROPERTIES FOR JS
   =============================== */
body {
  --scroll-y: 0px;
}

/* ===============================
   SETTINGS PAGE
   =============================== */
.settings-page {
  max-width: 900px;
  margin: 0 auto;
}

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.settings-section {
  padding: 0;
  overflow: hidden;
}

.settings-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 2rem;
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
}

.settings-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.settings-icon.primary {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
  color: var(--color-primary);
}

.settings-icon.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
  color: var(--color-success);
}

.settings-icon.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
  color: var(--color-warning);
}

.settings-icon.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(96, 165, 250, 0.1) 100%);
  color: var(--color-info);
}

.settings-icon.danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
  color: var(--color-danger);
}

.settings-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.settings-info p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.settings-form {
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
}

.checkbox-label span {
  flex: 1;
}

.form-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  margin: 2rem 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
}

.form-group-title svg {
  color: var(--color-primary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.avatar-upload-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
}

.current-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-border);
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}

.current-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: white;
  font-size: 2.5rem;
  font-weight: 700;
}

.avatar-upload-info {
  flex: 1;
}

.upload-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  margin-bottom: 0.75rem;
}

.upload-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.divider {
  height: 1px;
  background: var(--color-border);
  margin: 2rem 0;
}

/* Danger Zone */
.danger-zone {
  border: 2px solid var(--color-danger);
}

.danger-zone .settings-header {
  background: var(--color-danger-light);
  border-bottom-color: var(--color-danger);
}

.danger-zone-content {
  padding: 2rem;
}

.danger-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.danger-item-info h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  color: var(--color-text);
}

.danger-item-info p {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.button.danger {
  background: var(--color-danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.button.danger:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.button.warning {
  background: var(--color-warning);
  color: var(--color-dark);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.button.warning:hover {
  filter: brightness(0.9);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* Alerts */
.alert {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideIn 0.3s ease-out;
}

.alert-success {
  background: var(--color-success-light);
  color: var(--color-success);
  border: 1px solid var(--color-success);
}

.alert-error {
  background: var(--color-danger-light);
  color: var(--color-danger);
  border: 1px solid var(--color-danger);
}

/* Responsive */
@media (max-width: 768px) {
  .settings-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar-upload-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .danger-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }
}

/* ===============================
   PROFILE PAGE - UPDATED
   =============================== */

/* Meta Grid - Nova estrutura organizada */
.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.profile-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  transition: all var(--transition-base);
}

.profile-meta-item:hover {
  background: var(--color-surface);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.meta-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.meta-icon svg {
  color: white;
}

.meta-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.meta-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
}

.meta-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Social Links */
.profile-social-links {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.social-link {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: all var(--transition-base);
}

.social-link:hover {
  background: var(--gradient-primary);
  border-color: var(--color-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.social-link svg {
  width: 18px;
  height: 18px;
}

/* Avatar atualizado */
.profile-avatar-container {
  flex-shrink: 0;
}

.profile-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar .avatar-emoji {
  font-size: 3rem;
  color: white;
}

/* Bio com mais espaçamento */
.profile-bio {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg-secondary);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-md);
}

.profile-bio p {
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .profile-meta-grid {
    grid-template-columns: 1fr;
  }

  .profile-social-links {
    justify-content: center;
  }
}

/* ===============================
   FORM VALIDATION ERRORS
   =============================== */
.form-control.error,
.settings-form input.error,
.settings-form select.error,
.settings-form textarea.error {
  border-color: var(--color-danger) !important;
  background-color: rgba(239, 68, 68, 0.05);
}

.form-control.error:focus,
.settings-form input.error:focus,
.settings-form select.error:focus,
.settings-form textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.field-error-message {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.625rem 0.875rem;
  background: var(--color-danger-light);
  border-left: 3px solid var(--color-danger);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--color-danger);
  animation: slideInDown 0.3s ease-out;
}

.field-error-message svg {
  flex-shrink: 0;
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

/* ===============================
   CATEGORY CARDS - PROFILE PAGE
   =============================== */
.category-title-wrapper {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.category-emoji {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.category-card:hover .category-emoji {
  transform: scale(1.1);
  background: var(--gradient-primary);
}

.category-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

/* Melhorar header da categoria */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--color-border);
}


/* ========================================
   SISTEMA DE RIVAIS AMIGÁVEIS - CSS
   ======================================== */

/* ===== Estatísticas Rápidas ===== */
.rivais-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-valor {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Card de Rival ===== */
.rivais-lista {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rival-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.rival-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Cabeçalho do Card */
.rival-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.rival-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.rival-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  font-size: 2rem;
  font-weight: 700;
}

.rival-info {
  flex: 1;
}

.rival-info h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
}

.rival-info h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.rival-info h3 a:hover {
  color: var(--color-primary);
}

.rival-posicao,
.rival-seguindo {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Status do Rival */
.rival-status {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}

.rival-status.na_frente {
  background: #d1fae5;
  color: #065f46;
}

.rival-status.atras {
  background: #fee2e2;
  color: #991b1b;
}

.rival-status.empate {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="dark"] .rival-status.na_frente {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme="dark"] .rival-status.atras {
  background: #7f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .rival-status.empate {
  background: #78350f;
  color: #fcd34d;
}

.status-icone {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

/* Tabela de Comparação */
.rival-comparacao {
  margin: 1.5rem 0;
}

.comparacao-table {
  width: 100%;
  border-collapse: collapse;
}

.comparacao-table th,
.comparacao-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.comparacao-table th {
  background: var(--color-background);
  font-weight: 600;
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.comparacao-table tbody tr:hover {
  background: var(--color-background);
}

.comparacao-table td:nth-child(2),
.comparacao-table td:nth-child(3) {
  font-weight: 600;
  font-size: 1.1rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge.success {
  background: #d1fae5;
  color: #065f46;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge.neutral {
  background: #e5e7eb;
  color: #374151;
}

[data-theme="dark"] .badge.success {
  background: #064e3b;
  color: #6ee7b7;
}

[data-theme="dark"] .badge.danger {
  background: #7f1d1d;
  color: #fca5a5;
}

[data-theme="dark"] .badge.neutral {
  background: #374151;
  color: #d1d5db;
}

/* Ações do Rival */
.rival-acoes {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ===== Feed de Atividades ===== */
.atividades-recentes {
  margin-top: 3rem;
}

.atividades-recentes h2 {
  margin-bottom: 1rem;
}

.atividades-lista {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.atividade-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.atividade-item:hover {
  background: var(--color-background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.atividade-icone {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.atividade-conteudo {
  flex: 1;
}

.atividade-titulo {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.atividade-titulo a {
  color: var(--color-primary);
  text-decoration: none;
}

.atividade-titulo a:hover {
  text-decoration: underline;
}

.atividade-descricao {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.atividade-tempo {
  font-size: 0.85rem;
  color: var(--color-text-tertiary);
}

.atividade-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.atividade-link:hover {
  text-decoration: underline;
}

/* ===== PERFIL PÚBLICO ===== */
.perfil-publico {
  max-width: 1000px;
  margin: 0 auto;
}

.perfil-header {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 2rem;
}

.perfil-avatar-grande {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 4px solid var(--color-primary);
}

.perfil-avatar-grande img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder-grande {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  font-size: 3rem;
  font-weight: 700;
}

.perfil-info-principal {
  flex: 1;
}

.perfil-info-principal h1 {
  margin: 0 0 1rem 0;
  font-size: 2rem;
}

.perfil-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.badge.ranking {
  background: var(--color-primary);
  color: white;
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

.badge.lendario {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #78350f;
}

.badge.epico {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  color: white;
}

.perfil-stats-rapidos {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-item strong {
  font-size: 1.5rem;
  color: var(--color-primary);
}

.stat-item span {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

.perfil-acoes {
  display: flex;
  gap: 1rem;
}

/* Estatísticas do Perfil */
.perfil-estatisticas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.estat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.estat-icone {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.estat-valor {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.estat-label {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

/* Comparação no Perfil */
.perfil-comparacao {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.perfil-comparacao h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.comparacao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.comparacao-item {
  background: var(--color-background);
  border-radius: 8px;
  padding: 1.5rem;
}

.comparacao-label {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text-secondary);
}

.comparacao-valores {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.valor-eu,
.valor-rival {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.valor-eu .numero,
.valor-rival .numero {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.valor-eu .label,
.valor-rival .label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.comparacao-vs {
  font-weight: 700;
  color: var(--color-text-tertiary);
  font-size: 1.2rem;
}

.comparacao-resultado {
  text-align: center;
}

/* Conquistas no Perfil */
.perfil-conquistas {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin: 0;
}

.link-ver-todas {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

.link-ver-todas:hover {
  text-decoration: underline;
}

.conquistas-grid-pequeno {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}

.conquista-mini {
  background: var(--color-background);
  border: 2px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
}

.conquista-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.conquista-mini.lendario {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.conquista-mini.epico {
  border-color: #8b5cf6;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.conquista-mini.raro {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
}

.conquista-icone-mini {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.conquista-nome-mini {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

.conquista-data-mini {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* Atividades no Perfil */
.perfil-atividades {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2rem;
}

/* ===== DESCOBRIR RIVAIS ===== */
.descobrir-secao {
  margin-bottom: 3rem;
}

.descobrir-secao h2 {
  margin-bottom: 0.5rem;
}

.secao-descricao {
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.usuarios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.usuario-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.3s ease;
}

.usuario-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-4px);
}

.usuario-card.top-player {
  border-width: 2px;
}

.usuario-posicao {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--color-primary);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
}

.usuario-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 1rem;
}

.usuario-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.usuario-info {
  margin-bottom: 1rem;
}

.usuario-info h3 {
  margin: 0 0 0.5rem 0;
}

.usuario-info h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.usuario-info h3 a:hover {
  color: var(--color-primary);
}

.usuario-stats-mini {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  justify-content: center;
  flex-wrap: wrap;
}

.usuario-acoes {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.button.small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .perfil-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .rival-header {
    flex-direction: column;
    text-align: center;
  }

  .rival-acoes {
    flex-direction: column;
  }

  .perfil-stats-rapidos {
    justify-content: center;
  }

  .comparacao-table {
    font-size: 0.9rem;
  }

  .comparacao-table th,
  .comparacao-table td {
    padding: 0.5rem;
  }
}

/* ========================================
   SISTEMA DE NOTIFICAÇÕES - CSS COMPLETO
   ======================================== */

/* ===== Badge de Notificações no Menu ===== */
.notificacoes-wrapper {
  position: relative;
}

.notificacoes-toggle {
  position: relative;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  transition: all 0.2s ease;
}

.notificacoes-toggle:hover {
  color: var(--color-primary);
  background: var(--color-background);
}

.notificacoes-toggle.active {
  color: var(--color-primary);
  background: var(--color-background);
}

/* Badge Vermelho */
.notificacoes-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notificacoes-badge.pulse {
  animation: badgePulse 0.6s ease-out;
}

@keyframes badgePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

/* ===== Dropdown de Notificações ===== */
.notificacoes-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: 95vw;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  overflow: hidden;
  animation: dropdownSlide 0.2s ease-out;
}

@keyframes dropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

/* Header do Dropdown */
.notificacoes-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-background);
}

.notificacoes-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.notificacoes-acoes {
  display: flex;
  gap: 0.5rem;
}

.btn-text {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-text:hover {
  background: var(--color-primary-light);
}

/* Lista de Notificações */
.notificacoes-lista {
  max-height: 400px;
  overflow-y: auto;
}

/* Loading */
.notificacoes-loading {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: spin 0.8s linear infinite;
}

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

/* Estado Vazio */
.notificacoes-vazio {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.icone-vazio {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

/* Item de Notificação */
.notificacao-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.notificacao-item:last-child {
  border-bottom: none;
}

.notificacao-item:hover {
  background: var(--color-background);
}

.notificacao-item.nao-lida {
  background: var(--color-primary-light);
}

.notificacao-item.nao-lida:hover {
  background: var(--color-primary-lighter);
}

/* Ícone da Notificação */
.notificacao-icone {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.icone-conquista {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.icone-ranking {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.icone-exercicios {
  background: linear-gradient(135deg, #10b981, #059669);
}

.icone-meta {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.icone-seguidor {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.icone-rival {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.icone-recorde {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.icone-padrao {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* Conteúdo da Notificação */
.notificacao-conteudo {
  flex: 1;
  min-width: 0;
}

.notificacao-titulo {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--color-text);
  line-height: 1.4;
}

.notificacao-mensagem {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.25rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notificacao-tempo {
  font-size: 0.75rem;
  color: var(--color-text-tertiary);
}

/* Ponto de Não Lida */
.notificacao-ponto {
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  transform: translateY(-50%);
}

/* Footer do Dropdown */
.notificacoes-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
  text-align: center;
}

.btn-ver-todas {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-ver-todas:hover {
  background: var(--color-primary-light);
}

/* ===== Página de Notificações Completa ===== */
.notificacoes-pagina {
  max-width: 800px;
  margin: 0 auto;
}

.notificacoes-pagina .notificacao-item {
  border-radius: 8px;
  margin-bottom: 0.5rem;
  border: 1px solid var(--color-border);
}

.filtros-notificacoes {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filtro-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.filtro-btn:hover {
  background: var(--color-background);
}

.filtro-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* ===== Responsivo ===== */
@media (max-width: 768px) {
  .notificacoes-dropdown {
    width: 100vw;
    max-width: 100vw;
    right: -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .nav-label {
    display: none;
  }

  .notificacoes-badge {
    right: 4px;
  }
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .notificacao-item.nao-lida {
  background: rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .notificacao-item.nao-lida:hover {
  background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .notificacoes-badge {
  background: #dc2626;
}

/* ===== Erro ===== */
.notificacoes-erro {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--color-text-secondary);
}

.notificacoes-erro button {
  margin-top: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.notificacoes-erro button:hover {
  opacity: 0.9;
}


/* ===== NOTIFICAÇÕES: SINO E BADGE ===== */

.topbar-notifications-btn {
  position: relative;
}

/* Badge (mesma classe que você já usa no menu lateral) */
.notificacoes-badge-menu {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Animação de balançar o sino quando chegar notificação nova */
@keyframes bell-swing {
  0% {
    transform: rotate(0deg);
  }

  15% {
    transform: rotate(-15deg);
  }

  30% {
    transform: rotate(10deg);
  }

  45% {
    transform: rotate(-10deg);
  }

  60% {
    transform: rotate(6deg);
  }

  75% {
    transform: rotate(-4deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* Classe aplicada temporariamente ao sino quando chegar algo novo */
.bell-has-new svg {
  animation: bell-swing 0.7s ease-out;
}

/* Pulso leve quando existem notificações não lidas */
.bell-has-unread {
  position: relative;
}

.bell-has-unread::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  transform: scale(1);
  opacity: 0;
  pointer-events: none;
  animation: bell-pulse 1.4s ease-out infinite;
}

@keyframes bell-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }

  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

/* ===== DROPDOWN DE NOTIFICAÇÕES NA TOPBAR ===== */

.notif-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  width: min(360px, 90vw);
  background: var(--color-surface, #fff);
  border-radius: 0.75rem;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.16);
  padding: 0.5rem 0;
  z-index: 50;
  display: none;
}

.notif-dropdown[aria-hidden="false"] {
  display: block;
}

.notif-dropdown-header {
  padding: 0.5rem 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.notif-dropdown-list {
  max-height: 300px;
  overflow-y: auto;
}

.notif-dropdown-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.notif-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .notif-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.notif-dropdown-icon {
  font-size: 1.1rem;
}

.notif-dropdown-content {
  flex: 1;
}

.notif-dropdown-title {
  font-weight: 500;
}

.notif-dropdown-text {
  opacity: 0.8;
}

.notif-dropdown-meta {
  font-size: 0.75rem;
  opacity: 0.7;
  margin-top: 2px;
}

.notif-dropdown-empty {
  padding: 0.9rem 1rem;
  font-size: 0.85rem;
  opacity: 0.8;
}

.notif-dropdown-footer {
  padding: 0.5rem 1rem 0.7rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  font-size: 0.85rem;
  text-align: right;
}

.notif-dropdown-footer a {
  text-decoration: none;
  font-weight: 500;
}

/* ========================================
   CORREÇÃO DO BADGE DE NOTIFICAÇÕES
   ======================================== */

.navlink-notificacoes {
  overflow: visible !important;
  position: relative;
  padding-right: 2.5rem;
}

/* Badge no menu lateral - Limpo e centralizado */
.navlink-notificacoes .notificacoes-badge-menu {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 12px;
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 20px;
  background: var(--color-primary); /* Violeta vibrante ao invés de vermelho */
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
  z-index: 3;
}

/* Badge do sino da topbar - Arredondado e não achatado */
.topbar-notifications-btn {
  position: relative;
}

.topbar-notifications-btn .notificacoes-badge-menu {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  min-height: 20px; /* Garante que ficará rendondo */
  padding: 0 5px;
  border-radius: 20px;
  background: var(--color-primary); /* Violeta consistente */
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(124, 58, 237, 0.25);
  border: 2px solid var(--color-surface); /* Cria um efeito de recorte bonito acima do sino */
  z-index: 3;
}

.notificacoes-badge-menu[style*="display: none"] {
  pointer-events: none;
}

@media (max-width: 768px) {
  .navlink-notificacoes {
    padding-right: 2.25rem;
  }

  .navlink-notificacoes .notificacoes-badge-menu {
    right: 8px;
  }
}

/* ===============================
   MARKDOWN & EXERCISE STATEMENT
   =============================== */
.exercise-statement {
  font-size: 1.05rem;
  line-height: 1.7;
}

.exercise-statement p {
  margin-bottom: 1.2rem;
}

.exercise-statement strong,
.exercise-statement b {
  font-weight: 800;
  color: var(--color-primary);
}

.exercise-statement em,
.exercise-statement i {
  font-style: italic;
  color: var(--color-text-secondary);
}

/* Inline Code */
.exercise-statement code {
  background: var(--color-bg-secondary);
  color: var(--color-primary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid var(--color-border);
}

/* Code Blocks */
.exercise-statement pre {
  background: var(--color-bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  margin: 1.5rem 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.exercise-statement pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: inherit;
  font-size: 0.9em;
}

/* Beautiful Tables */
.exercise-statement table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--color-surface);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--color-border);
}

.exercise-statement th,
.exercise-statement td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.exercise-statement th {
  background: var(--color-bg-secondary);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
}

.exercise-statement tr:last-child td {
  border-bottom: none;
}

.exercise-statement tr:nth-child(even) td {
  background: rgba(0,0,0,0.01);
}

/* Lists */
.exercise-statement ul,
.exercise-statement ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.exercise-statement li {
  margin-bottom: 0.5rem;
}