/* ══════════════════════════════════════════════════════════════════════════════
   GB Capital — Premium Dashboard Components
   Glass morphism, gradients, micro-animations, data-dense layouts
   v1.0 — Used across all portals
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Glass Morphism Base ──────────────────────────────────────────────────── */
.gb-glass {
  background: var(--surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.03);
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.gb-glass:hover {
  border-color: var(--border-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.05);
  transform: translateY(-2px);
}
html[data-theme="light"] .gb-glass {
  background: var(--surface-card);
  box-shadow: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.03);
}
html[data-theme="light"] .gb-glass:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.04);
}

/* ── Premium Stat Card ────────────────────────────────────────────────────── */
.gb-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  transition: all .2s cubic-bezier(.4,0,.2,1);
}
.gb-stat::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--portal-accent, #308384), #4ecbcc);
  border-radius: 4px 0 0 4px;
}
.gb-stat:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.gb-stat-icon {
  position: absolute;
  top: 16px;
  right: 16px;
  opacity: .08;
  width: 40px;
  height: 40px;
}
.gb-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.gb-stat-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gb-stat-value.gradient {
  background: linear-gradient(135deg, var(--portal-accent, #308384), #4ecbcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gb-stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.gb-stat-trend {
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.gb-stat-trend.up { color: #1a7a5e; }
.gb-stat-trend.down { color: #c0392b; }
.gb-stat-sparkline {
  margin-top: 12px;
  height: 24px;
  opacity: .4;
}
html[data-theme="light"] .gb-stat {
  background: var(--surface-card);
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
html[data-theme="light"] .gb-stat::before {
  background: linear-gradient(180deg, var(--portal-accent, #308384), #4ecbcc);
}

/* ── Stat Cards Grid ──────────────────────────────────────────────────────── */
.gb-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* ── Hover Lift ───────────────────────────────────────────────────────────── */
.gb-lift {
  transition: transform .2s cubic-bezier(.4,0,.2,1), box-shadow .2s cubic-bezier(.4,0,.2,1);
}
.gb-lift:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

/* ── Stagger Fade-In Animation ────────────────────────────────────────────── */
@keyframes gb-fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.gb-stagger > * {
  opacity: 0;
  animation: gb-fadeUp .4s cubic-bezier(.4,0,.2,1) forwards;
}
.gb-stagger > *:nth-child(1) { animation-delay: 0ms; }
.gb-stagger > *:nth-child(2) { animation-delay: 50ms; }
.gb-stagger > *:nth-child(3) { animation-delay: 100ms; }
.gb-stagger > *:nth-child(4) { animation-delay: 150ms; }
.gb-stagger > *:nth-child(5) { animation-delay: 200ms; }
.gb-stagger > *:nth-child(6) { animation-delay: 250ms; }
.gb-stagger > *:nth-child(7) { animation-delay: 300ms; }
.gb-stagger > *:nth-child(8) { animation-delay: 350ms; }
.gb-stagger > *:nth-child(9) { animation-delay: 400ms; }
.gb-stagger > *:nth-child(10) { animation-delay: 450ms; }

/* ── Page Content Fade-In ─────────────────────────────────────────────────── */
@keyframes gb-pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.content, .content-area, .main-content {
  animation: gb-pageIn .35s cubic-bezier(.4,0,.2,1);
}

/* ── Gradient Text ────────────────────────────────────────────────────────── */
.gb-gradient-text {
  background: linear-gradient(135deg, var(--portal-accent, #308384), #4ecbcc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Premium Progress Bar ─────────────────────────────────────────────────── */
.gb-progress {
  height: 6px;
  background: var(--surface-hover);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.gb-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--portal-accent, #308384), #4ecbcc);
  transition: width .6s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.gb-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent);
  animation: gb-shimmer 2s infinite;
}
@keyframes gb-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Skeleton Loader ──────────────────────────────────────────────────────── */
.gb-skeleton {
  background: var(--surface-hover);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.gb-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.04), transparent);
  animation: gb-shimmer 1.5s infinite;
}
html[data-theme="light"] .gb-skeleton {
  background: #e8ebf0;
}
html[data-theme="light"] .gb-skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
}

/* ── Status Dot (pulsing) ─────────────────────────────────────────────────── */
.gb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.gb-dot.live {
  background: #1a7a5e;
  animation: gb-pulse 2s ease-in-out infinite;
}
.gb-dot.warning {
  background: #e67e22;
  animation: gb-pulse 1.5s ease-in-out infinite;
}
.gb-dot.danger {
  background: #c0392b;
  animation: gb-pulse 1s ease-in-out infinite;
}
@keyframes gb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 currentColor; opacity: 1; }
  50% { box-shadow: 0 0 0 6px transparent; opacity: .8; }
}

/* ── Premium Badge ────────────────────────────────────────────────────────── */
.gb-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2px;
}
.gb-pill.teal { background: rgba(48,131,132,.12); color: #308384; }
.gb-pill.green { background: rgba(26,122,94,.12); color: #1a7a5e; }
.gb-pill.red { background: rgba(192,57,43,.12); color: #c0392b; }
.gb-pill.orange { background: rgba(230,126,34,.12); color: #e67e22; }
.gb-pill.blue { background: rgba(93,173,226,.12); color: #5dade2; }
.gb-pill.purple { background: rgba(176,127,232,.12); color: #b07fe8; }
.gb-pill.gold { background: rgba(201,168,92,.12); color: #c9a85c; }
.gb-pill.gray { background: var(--surface-hover); color: var(--text-muted); }

/* ── Premium Table Row Hover ──────────────────────────────────────────────── */
.gb-table-premium tr {
  position: relative;
}
.gb-table-premium tr::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--portal-accent, #308384);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity .15s;
}
.gb-table-premium tr:hover::before {
  opacity: 1;
}
.gb-table-premium tr:hover td {
  background: var(--surface-hover);
}

/* ── Timeline ─────────────────────────────────────────────────────────────── */
.gb-timeline {
  position: relative;
  padding-left: 28px;
}
.gb-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.gb-timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.gb-timeline-dot {
  position: absolute;
  left: -22px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--portal-accent, #308384);
  border: 2px solid var(--bg);
  z-index: 1;
}
.gb-timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.gb-timeline-content {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Kanban Premium Cards ─────────────────────────────────────────────────── */
.kb2-card.gb-premium {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-left: 4px solid var(--card-accent, var(--portal-accent));
}
.kb2-card.gb-premium:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

/* ── Number Formatting ────────────────────────────────────────────────────── */
.gb-mono {
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}

/* ── Gradient Borders ─────────────────────────────────────────────────────── */
.gb-gradient-border {
  position: relative;
}
.gb-gradient-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--portal-accent, #308384), #4ecbcc, var(--portal-accent, #308384));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .5;
  transition: opacity .2s;
}
.gb-gradient-border:hover::before {
  opacity: 1;
}

/* ── Countdown Badge ──────────────────────────────────────────────────────── */
.gb-countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.gb-countdown.urgent { background: rgba(192,57,43,.12); color: #c0392b; }
.gb-countdown.soon { background: rgba(230,126,34,.12); color: #e67e22; }
.gb-countdown.ok { background: var(--surface-hover); color: var(--text-muted); }

/* ── Hero Section ─────────────────────────────────────────────────────────── */
.gb-hero {
  background: linear-gradient(135deg, var(--portal-accent, #043839) 0%, rgba(6,9,15,.8) 100%);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.gb-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(78,203,204,.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(48,131,132,.06) 0%, transparent 50%);
  pointer-events: none;
}
.gb-hero-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.3px;
  position: relative;
}
.gb-hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  margin-top: 6px;
  position: relative;
}

/* ── Tab Navigation ───────────────────────────────────────────────────────── */
.gb-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.gb-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
  text-decoration: none;
}
.gb-tab:hover {
  color: var(--text);
  background: var(--surface-hover);
}
.gb-tab.active {
  color: #fff;
  background: var(--portal-accent, #308384);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
html[data-theme="light"] .gb-tabs {
  background: #f0f2f7;
}
html[data-theme="light"] .gb-tab:hover {
  background: #e2e5ef;
}
html[data-theme="light"] .gb-tab.active {
  background: var(--portal-accent, #308384);
  color: #fff;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */
.gb-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.gb-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .3;
}
.gb-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.gb-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Tooltip ──────────────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--text);
  color: var(--bg);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s, transform .15s;
}
[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Smooth Scrollbar ─────────────────────────────────────────────────────── */
.gb-scroll::-webkit-scrollbar { width: 5px; }
.gb-scroll::-webkit-scrollbar-thumb { background: rgba(var(--portal-accent-rgb, 48,131,132),.3); border-radius: 3px; }
.gb-scroll::-webkit-scrollbar-track { background: transparent; }
