/* ════════════════════════════════════════════════════════════════
   BLUNK FLUSHED FULL-SCREEN USER ANALYTICS DASHBOARD (ZERO TOP GAP)
   ════════════════════════════════════════════════════════════════ */

.activity-sparkline-btn {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  background: var(--t-bg-card, rgba(20,20,25,0.8));
  border: 1px solid var(--t-border-subtle, rgba(255,255,255,0.15));
  padding: 6px 12px;
  border-radius: 12px;
  height: 32px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.activity-sparkline-btn:hover {
  background: var(--t-bg-subtle, rgba(255,255,255,0.05));
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}


.analytics-dashboard-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: var(--t-bg-main, #0b0c10);
  z-index: 10000030 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.analytics-dashboard-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Dashboard Body & Dynamic Content Containers (Zero Margin/Padding at Y=0) */
.analytics-body-container,
#analytics-dynamic-content {
  width: 100%;
  height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Profile Banner Area (Flushed to Y=0 Edge) */
.analytics-profile-card {
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent;
  border: none;
  position: relative;
  flex-shrink: 0;
}

.analytics-banner-bg {
  height: 140px;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.45) 0%, rgba(59, 130, 246, 0.25) 100%);
  border-bottom: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  position: relative;
}

/* Close Button (X) Flushed to Banner Top-Right */
.analytics-close-btn {
  position: absolute;
  top: 16px;
  right: 24px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  z-index: 30;
  backdrop-filter: blur(8px);
  transition: all 0.15s ease;
}

.analytics-close-btn:hover {
  background: var(--t-accent-primary, #a855f7);
  border-color: var(--t-accent-primary, #a855f7);
  transform: scale(1.05);
}

.analytics-profile-content {
  padding: 0 32px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-user-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: -38px;
}

.analytics-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.analytics-avatar-img {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--t-bg-main, #0b0c10);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

.analytics-avatar-img.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.analytics-avatar-img.avatar .avatar-initials {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff !important;
}

.analytics-status-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--t-bg-main, #0b0c10);
}

.analytics-status-dot.online {
  background: #10b981;
}

.analytics-status-dot.offline {
  background: #64748b;
}

.analytics-follow-btn {
  background: var(--t-accent-primary, #a855f7);
  color: var(--text);
  border: none;
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.analytics-follow-btn:hover {
  opacity: 0.9;
}

.analytics-follow-btn.following {
  background: var(--t-bg-input, #0c0d12);
  color: var(--t-text-muted, #94a3b8);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.1));
}

.analytics-username {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--t-text-primary, #ffffff);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.analytics-user-level-badge {
  font-size: 10px;
  font-weight: 800;
  color: var(--t-accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.analytics-medals-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
}

.analytics-medal-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--t-bg-input, #0c0d12);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--t-text-primary, #ffffff);
}

/* 7-Day Candle Chart Section */
.analytics-chart-section {
  flex: 1;
  padding: 0 32px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.analytics-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analytics-chart-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--t-text-primary, #ffffff);
}

.analytics-weekly-total-badge {
  background: var(--t-bg-input, #0c0d12);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  color: var(--t-accent-primary, #a855f7);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

/* Day Candle Bars */
.analytics-candles-grid {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  height: 115px;
  padding: 10px 12px 6px;
  background: var(--t-bg-input, #0c0d12);
  border-radius: 12px;
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}

.analytics-candle-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
  cursor: pointer;
  padding: 4px 2px;
  border-radius: 8px;
  transition: all 0.15s ease;
  user-select: none;
}

.analytics-candle-col:hover {
  background: rgba(255, 255, 255, 0.04);
}

.analytics-candle-col.active-candle {
  background: rgba(251, 191, 36, 0.08);
}

.analytics-candle-top-val {
  font-size: 10px;
  font-weight: 800;
  color: var(--t-text-primary, #ffffff);
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}

.analytics-candle-track {
  width: 100%;
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 3px;
  box-sizing: border-box;
}

.analytics-candle-col.active-candle .analytics-candle-track {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}

.analytics-candle-fill {
  width: 100%;
  background: linear-gradient(180deg, #facc15 0%, #eab308 100%);
  border-radius: 5px;
  transition: height 0.3s ease;
}

.analytics-candle-day-label {
  font-size: 10px;
  color: var(--t-text-muted, #94a3b8);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: color 0.15s ease;
}

.analytics-candle-col.active-candle .analytics-candle-day-label {
  color: #fbbf24 !important;
  font-weight: 900;
}

.analytics-today-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fbbf24;
  display: inline-block;
  flex-shrink: 0;
}

/* Category Activity Horizontal Bar Candles Grid */
.analytics-day-breakdown-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}

.analytics-category-candles-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--t-bg-input, #0c0d12);
  border-radius: 12px;
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  flex: 1;
  overflow-y: auto;
}

.category-candle-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-candle-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.category-candle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.category-candle-title-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.category-badge-chip {
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.activity-name-text {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: -0.01em;
  word-break: break-word;
  line-height: 1.35;
}

.category-candle-value {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.category-candle-track-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.category-candle-fill-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Day Breakdown Card & Header */
.day-breakdown-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  background: var(--t-bg-input, #0c0d12);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 16px;
  box-sizing: border-box;
}

.day-breakdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.day-breakdown-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.day-breakdown-total {
  font-size: 11.5px;
  font-weight: 800;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  padding: 3px 8px;
  border-radius: 6px;
}

.day-empty-box {
  padding: 36px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.day-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-empty-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.day-empty-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  max-width: 280px;
  line-height: 1.45;
}

/* Authentic Wall Calendar Widget Styling */
.real-calendar-container {
  background: var(--t-bg-input, #0c0d12);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.real-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.06));
}

.real-calendar-month-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--t-text-primary, #ffffff);
}

.real-calendar-nav-btn {
  background: var(--t-bg-card, #14151c);
  color: var(--t-text-primary, #ffffff);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.1));
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.15s ease;
}

.real-calendar-nav-btn:hover {
  background: var(--t-accent-primary, #a855f7);
  border-color: var(--t-accent-primary, #a855f7);
}

.real-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--t-text-muted, #94a3b8);
  padding: 4px 0;
}

.real-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 6px;
}

.real-calendar-cell {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  min-height: 54px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.real-calendar-cell.other-month {
  opacity: 0.2;
  pointer-events: none;
}

.real-calendar-cell.pre-registration {
  background: rgba(239, 68, 68, 0.04);
  border-color: rgba(239, 68, 68, 0.15);
  cursor: not-allowed;
  opacity: 0.45;
}

.real-calendar-cell.pre-registration::after {
  content: '✖';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: 900;
  color: #ef4444;
}

.real-calendar-cell.registration-day {
  border-color: #10b981 !important;
  background: rgba(16, 185, 129, 0.15) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.real-calendar-cell:hover:not(.pre-registration),
.real-calendar-cell.selected-day {
  border-color: var(--t-accent-primary, #a855f7);
  background: rgba(168, 85, 247, 0.18);
}

/* Side-By-Side Split View Layout */
.analytics-split-layout {
  display: flex;
  gap: 20px;
  min-height: 380px; /* Ensure enough height for calendar/chart */
}

.analytics-split-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analytics-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.real-calendar-day-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--t-text-primary, #ffffff);
  align-self: flex-end;
}

.real-calendar-focus-badge {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text);
  background: var(--t-accent-primary, #a855f7);
  padding: 1px 5px;
  border-radius: 4px;
  align-self: flex-start;
}

/* BLUNK Native Clean Toast Notification */
.analytics-toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--t-bg-card, #14151c);
  border: 1px solid var(--t-border-subtle, rgba(255, 255, 255, 0.12));
  color: var(--t-text-primary, #ffffff);
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  z-index: 2147483647 !important;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.analytics-toast-notification.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* Responsive Adjustments for Mobile */
@media (max-width: 768px) {
  .analytics-close-btn {
    top: max(12px, env(safe-area-inset-top, 12px));
    right: 14px;
    width: 38px;
    height: 38px;
  }
  .analytics-split-layout {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .analytics-chart-section {
    overflow: visible;
    padding: 0 16px 20px;
  }
  .analytics-split-left, .analytics-split-right {
    overflow: visible;
  }
  .analytics-candles-grid {
    height: 130px;
    padding: 8px 6px;
    gap: 6px;
  }
  .analytics-candle-top-val {
    font-size: 9px;
  }
  .analytics-candle-day-label {
    font-size: 9.5px;
  }
  .analytics-profile-content {
    padding: 0 16px 14px;
  }
  .real-calendar-grid {
    gap: 4px;
  }
  .real-calendar-container {
    padding: 10px;
  }
  .real-calendar-cell {
    padding: 2px 4px;
    aspect-ratio: 1 / 1.1;
    min-height: auto;
  }
  .real-calendar-day-num {
    font-size: 10px;
  }
  .real-calendar-today-text {
    display: none;
  }
  .category-candle-item {
    padding: 10px 12px;
    gap: 6px;
  }
  .activity-name-text {
    font-size: 12.5px;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .category-badge-chip {
    font-size: 10px;
    padding: 1px 6px;
  }
  .category-candle-value {
    font-size: 11px;
    padding: 2px 6px;
  }
}

/* Calendar Daily Streak Badge */
.real-calendar-streak-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.35);
  color: #f97316;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 5px;
  line-height: 1;
  flex-shrink: 0;
}

.real-calendar-broken-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  font-size: 8.5px;
  font-weight: 750;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
  margin-top: 2px;
  align-self: flex-start;
  white-space: nowrap;
}

/* Calendar Day Streak Detail Banners */
.calendar-streak-detail-banner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  box-sizing: border-box;
}

.calendar-streak-detail-banner.active {
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.28);
}

.calendar-streak-detail-banner.broken {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.streak-detail-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.streak-detail-icon.active {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
}

.streak-detail-icon.broken {
  background: rgba(239, 68, 68, 0.18);
  color: #ef4444;
}

.streak-detail-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
}

.streak-detail-title {
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.streak-detail-sub {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.35;
}
