/* frontend/dashboard.css */

/* --- DASHBOARD HERO HEADER --- */
.dashboard-hero {
  background: transparent;
  padding: 10px 0 30px 0;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
}

.dashboard-hero h2 {
  color: var(--text-head);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 8px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.dashboard-hero p {
  color: var(--text-main);
  font-size: 1.05rem;
  opacity: 0.8;
}

/* --- DASHBOARD GRID & STAT CARDS --- */
.dashboard-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  margin-bottom: 30px;
}

.stat-card {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  border: 1px solid #E2E8F0; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  display: block;
  text-decoration: none;
  cursor: default;
}

.stat-card:hover {
  box-shadow: 0 12px 20px -5px rgba(41, 98, 255, 0.15); 
  border-color: var(--brand-primary);
}

.icon-box-small {
  width: 45px;
  height: 45px;
  background: rgba(41, 98, 255, 0.08);
  color: var(--brand-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 15px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-head);
  line-height: 1.1;
  margin-bottom: 5px;
}

.stat-label {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* --- USAGE METRICS CARD STYLES --- */
.stat-card.usage-card {
  display: block;
  padding: 25px;
}

.usage-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 15px;
}

.usage-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-head);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.usage-plan-display {
  font-size: 1.1rem;
  color: var(--brand-primary);
  font-weight: 700;
}

.usage-progress-bg {
  background: #e2e8f0;
  border-radius: 6px;
  height: 12px;
  width: 100%;
  margin: 20px 0 15px 0;
  overflow: hidden;
}

.usage-progress-fill {
  background: #4caf50;
  height: 100%;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.usage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #4a5568;
  margin-bottom: 8px;
}

.usage-meta strong {
  color: #0F172A;
  font-weight: 700;
}

.usage-meta .label-text {
  font-weight: 500;
}

/* --- GOAL SUB-HEADERS --- */
.goal-sub-header {
  font-size: 0.85rem;
  color: var(--text-main);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  padding-top: 8px;
}

.goal-sub-header.has-divider {
  border-top: 1px solid #E2E8F0;
  margin-top: 12px;
  padding-top: 12px;
}

/* --- DASHBOARD ACTION & NOTICE COMPONENTS --- */
.upgrade-pill-btn {
  display: none;
  margin-left: 12px;
  padding: 4px 12px;
  background: var(--brand-primary);
  color: var(--text-white);
  border: none;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px var(--brand-glow);
  transition: background-color 0.2s ease;
}

.upgrade-pill-btn:hover {
  background: var(--brand-primary-hover);
}

.cancel-notice-bar {
  margin-bottom: 25px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* --- RESPONSIVE & NESTED GRID OPTIMIZATIONS --- */
.stat-card > .dashboard-grid {
  margin-bottom: 0;
}

.stat-card > .dashboard-grid > .stat-card {
  max-width: none;
}

@media (max-width: 768px) {
  .stat-card {
    min-width: 100%;
    max-width: 100%;
  }

  .usage-meta {
    flex-wrap: wrap;
    gap: 4px;
  }
}

/* --- MODERN KPI, LIVE BADGE & MINI-GRID STYLES --- */
.status-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.usage-progress-bg.slim {
  height: 6px;
  border-radius: 4px;
  margin: 12px 0;
}

.mini-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-workspace);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
}

.mini-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mini-metric-label {
  color: var(--text-main);
  opacity: 0.75;
  font-weight: 500;
}

.mini-metric-val {
  font-weight: 700;
  color: var(--text-head);
}

.autonomy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.18);
}

/* --- INTERACTIVE TOOLTIP STYLES --- */
.info-tooltip-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-main);
  opacity: 0.6;
  cursor: pointer;
  margin-left: 4px;
  transition: opacity 0.2s;
}

.info-tooltip-trigger:hover,
.info-tooltip-trigger:focus {
  opacity: 1;
  color: var(--brand-primary);
  outline: none;
}

.info-tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  padding: 8px 12px;
  background: #1e293b;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: left;
}

.info-tooltip-trigger:hover .info-tooltip-content,
.info-tooltip-trigger:focus .info-tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}