/* Overview View Specific Styles */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 1.5rem;
}

.welcome-card {
  grid-column: 100%;
}

.welcome-card .btn-access {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
  min-width: 150px;
  width: auto;
}

/* Activity Stats */
.stat-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  transition: all 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(41, 151, 255, 0.3);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2997ff;
  margin-bottom: 0.5rem;
}

/* Recent Assets Section */
#recentPurchasesList {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ─── AI Cost Card ─────────────────────────────────────────────────────────── */

.ai-cost-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(16, 185, 129, 0.2) !important;
  background: rgba(16, 185, 129, 0.04) !important;
  transition: all 0.3s ease;
}

.ai-cost-card::before {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.ai-cost-card:hover {
  border-color: rgba(16, 185, 129, 0.4) !important;
  background: rgba(16, 185, 129, 0.07) !important;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.12);
  transform: translateY(-2px);
}

.ai-cost-display {
  margin: 0.5rem 0 1rem;
}

.ai-cost-amount {
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  line-height: 1;
}

.ai-cost-currency {
  font-size: 1.5rem;
  font-weight: 600;
  color: #10b981;
  opacity: 0.8;
}

#aiCostMain {
  font-size: 2.8rem;
  font-weight: 800;
  color: #10b981;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}

.ai-cost-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.25rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Free plan "COVERED" badge */
.ai-cost-free-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 0.4rem;
  line-height: 1;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* Estimated market value sub-line (free plan only) */
.ai-cost-est-value {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ai-cost-est-tip {
  cursor: help;
  opacity: 0.6;
  font-size: 0.75rem;
}

/* Sparkline */
.ai-sparkline-wrap {
  margin: 0.75rem 0;
}

.ai-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  padding: 0 2px;
}

.sparkline-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
  cursor: default;
}

.sparkline-bar {
  width: 100%;
  max-width: 28px;
  background: rgba(16, 185, 129, 0.3);
  border-radius: 3px 3px 0 0;
  transition: background 0.2s;
  min-height: 2px;
}

.sparkline-bar.today {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.sparkline-bar-wrap:hover .sparkline-bar {
  background: rgba(16, 185, 129, 0.6);
}

.sparkline-bar-wrap:hover .sparkline-bar.today {
  background: #34d399;
}

.sparkline-label {
  font-size: 0.6rem;
  color: rgba(255,255,255,0.25);
  text-align: center;
  white-space: nowrap;
}

.ai-sparkline-legend {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.25);
  text-align: right;
  margin-top: 3px;
}

/* Footer stats */
.ai-cost-stats {
  display: flex;
  align-items: center;
  gap: 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 0.25rem;
}

.ai-cost-stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ai-cost-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  font-variant-numeric: tabular-nums;
}

.ai-cost-stat-lbl {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.ai-cost-stat-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.07);
}

/* ─── AI Usage Modal ───────────────────────────────────────────────────────── */

.ai-usage-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-usage-modal-backdrop.open {
  opacity: 1;
}

.ai-usage-modal {
  width: 100%;
  max-width: 820px;
  max-height: 92vh;
  background: #111318;
  border: 1px solid rgba(255,255,255,0.1);
  border-top: 3px solid #10b981;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(16,185,129,0.1);
  transform: translateY(12px);
  transition: transform 0.3s ease;
}

.ai-usage-modal-backdrop.open .ai-usage-modal {
  transform: translateY(0);
}

.ai-usage-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  flex-shrink: 0;
}

.ai-usage-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ai-usage-modal-title i {
  color: #10b981;
}

.ai-usage-modal-sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

.ai-usage-modal-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.ai-usage-modal-close:hover {
  background: rgba(239,68,68,0.15);
  border-color: rgba(239,68,68,0.3);
  color: #ef4444;
}

/* Period tabs */
.usage-period-tabs {
  display: flex;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.usage-period-tab {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.38rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.usage-period-tab.active {
  background: #10b981;
  color: white;
}

.usage-period-tab:not(.active):hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
}

/* Summary Row */
.usage-summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.usage-summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: #111318;
}

.usage-summary-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  flex-shrink: 0;
}

.usage-summary-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.usage-summary-lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.usage-summary-note {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.25);
  margin-top: 0.15rem;
}

/* Scrollable content area */
.usage-chart-section,
.usage-table-section {
  padding: 1.5rem 2rem;
  flex-shrink: 0;
}

.usage-chart-section {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.usage-table-section {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.usage-chart-title {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Modal daily chart */
.usage-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
}

.modal-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  cursor: default;
}

.modal-bar-val {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.25);
  white-space: nowrap;
  transform: rotate(-35deg);
  transform-origin: center bottom;
  height: 24px;
  display: flex;
  align-items: flex-end;
}

.modal-bar {
  width: 100%;
  max-width: 36px;
  background: rgba(16, 185, 129, 0.25);
  border-radius: 4px 4px 0 0;
  min-height: 3px;
  transition: background 0.2s;
}

.modal-bar.today {
  background: #10b981;
  box-shadow: 0 -2px 12px rgba(16, 185, 129, 0.4);
}

.modal-bar-wrap:hover .modal-bar {
  background: rgba(16, 185, 129, 0.5);
}

.modal-bar-wrap:hover .modal-bar.today {
  background: #34d399;
}

.modal-bar-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
  text-align: center;
  white-space: nowrap;
}

/* Session table */
.usage-table-wrap {
  overflow-x: auto;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.usage-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.usage-table td {
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.75);
  vertical-align: middle;
}

.usage-table tr:last-child td {
  border-bottom: none;
}

.usage-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.usage-session-title {
  font-weight: 600;
  color: white;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-session-date {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}

.usage-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}

.usage-cost {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #10b981;
}

/* Estimated cost cell (free plan session table) */
.usage-cost-est {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgba(16, 185, 129, 0.55);
}

.usage-est-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.25rem;
}

.usage-empty {
  text-align: center;
  color: rgba(255,255,255,0.25);
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}

/* ─── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .welcome-card {
    grid-column: span 1;
  }

  .usage-summary-row {
    grid-template-columns: 1fr;
  }

  .ai-usage-modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .usage-chart-section,
  .usage-table-section {
    padding: 1rem 1.25rem;
  }
}

