:root {
  --background: #0B0B0D;
  --foreground: #ffffff;
  --card: #121217;
  --card-foreground: #ffffff;
  --primary: #7C3AED;
  --primary-foreground: #ffffff;
  --secondary: #5B21B6;
  --muted: #1A1A1F;
  --muted-foreground: #a0a0a0;
  --accent: #FFD166;
  --accent-foreground: #000000;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 8px;
}

.profile-page {
  color: var(--foreground);
  background-color: var(--background) !important;
  background-image:
    radial-gradient(circle at 10% 10%, rgba(124, 58, 237, 0.08), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(91, 33, 182, 0.06), transparent 40%),
    url('/static/images/bg-img/bg-img-h.png') !important;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: 'Manrope', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.scrollbar-none::-webkit-scrollbar {
  display: none;
}

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

.hidden {
  display: none !important;
}

.profile-shell {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

footer {
  background-color: #050505 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Typography Overrides */
.text-muted-foreground {
  font-size: 0.7rem;
  color: var(--muted-foreground);
}

.text-xs {
  font-size: 0.65rem;
  color: var(--muted-foreground);
}

.font-bold.text-white {
  font-size: 0.95rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.6);
  padding: 1.25rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.profile-card {
  padding: 2rem !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #121217 !important;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.avatar-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.avatar-box {
  width: 6rem;
  height: 6rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.4);
  position: relative;
}

.online-status {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
  background: #22c55e;
  border: 4px solid #121217;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.handle-text {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.sticky-top {
  position: sticky;
  top: 5rem;
}

/* Sidebar Profile */
.profile-avatar-large {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-foreground);
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.05);
}

.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.625rem;
  width: 100%;
  margin-bottom: 1.25rem;
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.stat-item.rank {
  background: rgba(124, 58, 237, 0.08);
  color: #a78bfa;
  border-color: rgba(124, 58, 237, 0.15);
}

.stat-item.points {
  background: rgba(255, 209, 102, 0.06);
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.12);
}

.stat-item.contests {
  background: rgba(91, 33, 182, 0.08);
  color: #c084fc;
  border-color: rgba(91, 33, 182, 0.15);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 800;
  display: block;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.6rem;
  color: var(--muted-foreground);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-top: 0.15rem;
}

/* Badges */
.badge-secondary {
  background: rgba(124, 58, 237, 0.1);
  color: var(--primary);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  border: 1px solid rgba(124, 58, 237, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

/* Buttons */
.btn-outline,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.btn-outline {
  min-height: 2.75rem;
  /* ~44px */
  padding: 0 1rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 700;
  flex: 1;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  min-height: 2.75rem;
  padding: 0 1rem;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.65rem;
  border: none;
}

/* Tabs */
/* Tabs Redesign */
.tabs-container {
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
  width: fit-content;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
}

.tab-trigger {
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #71717a;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-trigger i {
  width: 1rem;
  height: 1rem;
  margin-right: 0.85rem;
  stroke-width: 2px;
  transition: color 0.25s ease;
}

.tab-trigger:hover {
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.02);
}

.tab-trigger.active {
  background: #18181b;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tab-trigger.active i {
  color: #ffffff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: tabFadeIn 0.3s ease-out;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

/* Activity Map Premium Card - Solid Design */
.activity-grid-card {
  padding: 1.5rem !important;
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow:
    0 15px 35px -5px rgba(0, 0, 0, 0.5) !important;
  border-radius: 12px !important;

}

/* Animation for dots */
@keyframes dotFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.8);
  }

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

.activity-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
  animation: dotFadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
  /* Initial state for animation */
  overflow: hidden;
}

/* Hover Effect: Purple Outline Only */
.activity-dot:hover {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  z-index: 10;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.3);
}

/* Today's Dot Highlight (Ring Design) */
.activity-dot.today-dot {
  border: 2px solid var(--primary);
  background: transparent !important;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
  animation: todayPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes todayPulse {

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

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

/* Activity Levels - Professional Purple Scale */
.level-0 {
  background: #1a1a1e;
}

.level-1 {
  background: #3b226e;
}

.level-2 {
  background: #5b3cc4;
}

.level-3 {
  background: #7c3aed;
}

.level-4 {
  background: #a78bfa;
  box-shadow: 0 0 10px rgba(167, 139, 250, 0.2);
}

/* Static Legend Dots */
.gap-1\.5 .activity-dot {
  animation: none !important;
  opacity: 1 !important;
  width: 7px;
  height: 7px;
}

/* List Row */
.list-row {
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.list-row span.text-sm {
  font-size: 0.75rem;
  font-weight: 700;
}

.list-row span.text-xs {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted-foreground);
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
  display: block;
}

.input-field {
  width: 100%;
  background: #0B0B0D;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--foreground);
  padding: 0.5rem 0.7rem;
  font-size: 0.75rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

@media (max-width: 1024px) {
  .tabs-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    border-radius: 16px;
  }

  .tab-trigger {
    padding: 0.6rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 12px;
  }

  .grid-cols-12 {
    gap: 1rem !important;
  }

  #activity-dots {
    margin-bottom: 0.75rem;
  }

  .activity-grid {
    overflow-x: scroll !important;
  }
}

@media (max-width: 640px) {
  .tabs-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tab Panel Improvements */
.tab-panel-header {
  margin-bottom: 1.5rem;
}

/* Overview: Advanced Stats */
.summary-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.summary-stat-card {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left !important;
}

@media (max-width: 1024px) {
  .summary-stat-card {
    padding: 0.75rem;
  }
}

.summary-stat-info {
  display: flex;
  flex-direction: column;
}

.summary-stat-value {
  font-size: 1.125rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.15rem;
}

.summary-stat-label {
  font-size: 0.65rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-weight: 700;
}

.summary-stat-meta {
  font-size: 0.6rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.summary-stat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.summary-stat-icon i {
  width: 1.25rem;
  height: 1.25rem;
}

/* Status-specific icons and meta */
.stat-purple .summary-stat-icon {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
}

.stat-purple .summary-stat-meta {
  color: #a78bfa;
}

.stat-yellow .summary-stat-icon {
  background: rgba(255, 209, 102, 0.15);
  color: #FFD166;
}

.stat-yellow .summary-stat-meta {
  color: #FFD166;
}

.stat-orange .summary-stat-icon {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
}

.stat-orange .summary-stat-meta {
  color: #fb923c;
}

/* Recent Activity List with Icons */
.activity-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.activity-icon-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(42, 42, 42, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.activity-icon-circle i {
  width: 1.125rem;
  height: 1.125rem;
}

.activity-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.activity-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.activity-time {
  font-size: 0.65rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Activity Icon Colors */
.icon-purple {
  color: #a78bfa;
}

.icon-yellow {
  color: #FFD166;
}

.icon-green {
  color: #4ade80;
}

.icon-blue {
  color: #60a5fa;
}

/* Filters Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem;
  background: rgba(42, 42, 42, 0.2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-wrapper i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.9rem;
  height: 0.9rem;
  color: var(--muted-foreground);
}

.search-input {
  width: 100%;
  background: #0B0B0D;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem 0.45rem 2.2rem;
  font-size: 0.75rem;
  color: #fff;
}

.filter-select {
  background: #0B0B0D;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  color: #fff;
  cursor: pointer;
}

/* Contest Cards */
.history-item {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem;
  align-items: flex-start;
}

.history-item-main {
  flex: 1;
  min-width: 300px;
}

.history-item-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.history-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.7rem;
  color: var(--muted-foreground);
  font-weight: 700;
}

.history-meta-row span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.history-meta-row i {
  width: 0.85rem;
  height: 0.85rem;
}

.history-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-details {
  background: rgba(255, 255, 255, 0.05);
}

/* Problem Cards */
.problem-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.problem-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.problem-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.problem-title-row i {
  color: #4ade80;
  width: 1rem;
  height: 1rem;
}

/* Status Pillars */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: capitalize;
}

.status-accepted {
  background: rgba(20, 184, 166, 0.1);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.status-wrong {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-tle {
  background: rgba(234, 179, 8, 0.1);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.2);
}

.status-pending {
  background: rgba(160, 160, 160, 0.1);
  color: #a0a0a0;
  border: 1px solid rgba(160, 160, 160, 0.2);
}

/* Table Columns Tweaks */
.sub-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 0.5rem;
}

.stat-card p:last-child {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--muted-foreground);
}

.sub-table th {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  font-weight: 800;
  padding: 0.5rem 0.5rem 1rem;
}

.sub-table tr {
  vertical-align: middle;
}

.sub-table td {
  padding: 0.75rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.sub-table .text-muted {
  color: var(--muted-foreground);
  font-weight: 600;
  font-size: 0.7rem;
}

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

.cert-preview {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1e1b4b 0%, #121217 100%);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cert-preview ::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
}

.cert-preview i {
  width: 3.5rem;
  height: 3.5rem;
  color: #FFD166;
  opacity: 0.8;
  z-index: 1;
}

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

.cert-title {
  font-size: 0.875rem;
  font-weight: 800;
  color: #fff;
}

.cert-subtitle {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  font-weight: 700;
}

.cert-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Achievements Timeline */
.timeline-section {
  padding-left: 2rem;
  position: relative;
  margin-top: 2rem;
}

.timeline-section::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0.5rem;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-dot {
  position: absolute;
  left: -2.35rem;
  /* center on the 1px line */
  top: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  z-index: 1;
}

.timeline-dot i {
  width: 0.75rem;
  height: 0.75rem;
}

.timeline-info {
  display: flex;
  flex-direction: column;
}

.timeline-title {
  font-size: 0.8125rem;
  font-weight: 800;
  color: #fff;
}

.timeline-desc {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
  font-weight: 600;
}

.timeline-date {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
  opacity: 0.8;
}