/* DashboardStyle.css — Clean Pro Dashboard (v2)
   Scope: Dashboard panel + Credits/Subscription/Packs only.
   (Keeps your Stripe wiring intact: IDs + existing billing.js remain unchanged.)
*/

.dashboard-panel{
  display:flex;
  flex-direction:column;
  gap: 16px;
  font-family: var(--sans);
}

/* Slightly more “product” look inside the dashboard panel */
#userDashboard.dashboard-panel.panel{
  background: rgba(10,14,24,.76);
  border: 1px solid rgba(255,255,255,.10);
}

/* Dashboard header */
.dashboard-panel .panel-header{
  align-items:center;
  padding-bottom: 14px;
  margin-bottom: 10px;
}
.dashboard-panel .panel-header h1{
  font-size: 18px;
  letter-spacing: .01em;
}
.dashboard-panel .muted{color: var(--sub);}

/* Auth status pill (was missing in base CSS) */
.dashboard-panel .status-chip{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(226,232,240,.85);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}
.dashboard-panel .status-chip.ok{
  border-color: rgba(34,197,94,.28);
  background: rgba(34,197,94,.10);
  color: rgba(187,247,208,.95);
}

/* Account + Plan cards */
.dashboard-panel .auth-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.dashboard-panel .auth-block{
  border-radius: 18px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.30);
}
.dashboard-panel .auth-block h2{
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing:.01em;
}
.dashboard-panel .auth-block p{
  margin: 6px 0;
  font-size: 13px;
  color: rgba(226,232,240,.86);
}
.dashboard-panel .auth-block .actions{
  margin-top: 10px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ============ Credits section (v2) ============ */
.dashboard-panel .credits-section{
  margin-top: 2px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.10);
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.06), transparent 55%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

/* Header */
.dashboard-panel .credits-header{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 14px;
  cursor:pointer;
  user-select:none;
}
.dashboard-panel .credits-header .titleblock{max-width: 560px;}
.dashboard-panel .credits-header .kicker{
  font-size: 11px;
  letter-spacing:.16em;
  text-transform: uppercase;
  color: rgba(226,232,240,.58);
}
.dashboard-panel .credits-header .headline{
  margin: 6px 0 4px;
  font-size: 18px;
  font-weight: 900;
  color: rgba(226,232,240,.96);
}
.dashboard-panel .credits-header .desc{
  margin: 0;
  font-size: 12px;
}

/* Right side actions */
.dashboard-panel .credits-header .actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}
.dashboard-panel .credits-header .balance{
  min-width: 170px;
  border-radius: 16px;
  padding: 10px 12px;
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(255,255,255,.10);
  text-align:right;
}
.dashboard-panel .credits-header .balance .lbl{
  font-size: 11px;
  color: rgba(226,232,240,.60);
}
.dashboard-panel .credits-header .balance .val{
  margin-top: 2px;
  font-size: 20px;
  font-weight: 900;
  color: rgba(226,232,240,.95);
}

/* Toggle */
.dashboard-panel .credits-toggle,
.dashboard-panel #creditsToggleBtn{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  color: rgba(226,232,240,.85);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  transition: transform .18s ease, filter .12s ease;
}
.dashboard-panel #creditsToggleBtn:hover{filter: brightness(1.06);}
.dashboard-panel #creditsToggleBtn:active{transform: translateY(1px);}

/* Collapsible body (billing.js also sets inline max-height) */
.dashboard-panel .credits-body{
  margin-top: 14px;
  overflow:hidden;
  transition: max-height .28s ease, opacity .18s ease;
}
.dashboard-panel .credits-section.collapsed .credits-body{opacity: 0;}
.dashboard-panel .credits-section.collapsed #creditsToggleBtn{transform: rotate(-90deg);}

/* Main grid inside */
.dashboard-panel .credits-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items:start;
}

/* Plan (subscription) card */
.dashboard-panel .plan-card,
.dashboard-panel #subscriptionCard{
  border-radius: 18px;
  padding: 14px;
  background: rgba(2,6,23,.58);
  border: 1px solid rgba(255,255,255,.10);
}
.dashboard-panel #subscriptionCard.subscribed{
  border-color: rgba(56,189,248,.35);
  background: rgba(2,6,23,.65);
  box-shadow: 0 0 0 1px rgba(56,189,248,.12);
}

.dashboard-panel .plan-top{
  display:flex;
  justify-content: space-between;
  align-items:flex-start;
  gap: 12px;
}
.dashboard-panel .plan-top .name strong{
  display:block;
  font-size: 15px;
  letter-spacing:.01em;
}
.dashboard-panel .plan-top .name span{
  display:block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(226,232,240,.65);
}
.dashboard-panel .plan-top .price{
  text-align:right;
  font-size: 18px;
  font-weight: 950;
  letter-spacing:.01em;
}
.dashboard-panel .plan-top .price small{
  font-size: 12px;
  font-weight: 750;
  color: rgba(226,232,240,.58);
}

/* Feature list */
.dashboard-panel .features{
  margin: 12px 0 0;
  padding: 0;
  list-style:none;
  display:grid;
  gap: 8px;
}
.dashboard-panel .features li{
  position:relative;
  padding-left: 18px;
  font-size: 13px;
  color: rgba(226,232,240,.88);
}
.dashboard-panel .features li::before{
  content: "✓";
  position:absolute;
  left: 0;
  top: 0;
  color: rgba(56,189,248,.92);
}

/* CTA buttons (keep IDs for billing.js) */
.dashboard-panel #subscribeBtn,
.dashboard-panel #unsubscribeBtn{
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(226,232,240,.92);
  padding: 10px 14px;
  font-weight: 900;
  font-size: 13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  cursor:pointer;
  transition: transform .08s ease, filter .12s ease, opacity .12s ease;
}
.dashboard-panel #subscribeBtn:hover,
.dashboard-panel #unsubscribeBtn:hover{filter: brightness(1.06);}
.dashboard-panel #subscribeBtn:active,
.dashboard-panel #unsubscribeBtn:active{transform: translateY(1px);}
.dashboard-panel #subscribeBtn.disabled{opacity:.60; pointer-events:none;}
.dashboard-panel #unsubscribeBtn{
  background: rgba(251,55,160,.09);
  border-color: rgba(251,55,160,.24);
}
.dashboard-panel .cta{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}
.dashboard-panel .chevron{opacity:.92;}

/* Small note */
.dashboard-panel .note{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(226,232,240,.58);
}

/* Packs column */
.dashboard-panel .packs-col{
  border-radius: 18px;
  padding: 14px;
  background: rgba(2,6,23,.48);
  border: 1px solid rgba(255,255,255,.10);
}
.dashboard-panel .packs-head strong{
  display:block;
  font-size: 14px;
  font-weight: 950;
}
.dashboard-panel .packs-head p{
  margin: 4px 0 0;
  font-size: 12px;
}

/* Packs grid (creditPackGrid is filled by billing.js) */
.dashboard-panel .credit-pack-grid{
  margin-top: 12px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Pack card */
.dashboard-panel .credit-pack-card{
  border-radius: 16px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  display:flex;
  flex-direction:column;
  min-height: 170px;
  gap: 10px;
}
.dashboard-panel .credit-pack-card.highlight{
  border-color: rgba(56,189,248,.35);
  background:
    radial-gradient(circle at 30% 0%, rgba(56,189,248,.14), transparent 55%),
    rgba(255,255,255,.03);
  box-shadow: 0 0 0 1px rgba(56,189,248,.10);
}

/* Pack header */
.dashboard-panel .credit-pack-header{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
}
.dashboard-panel .credit-pack-title{
  font-weight: 950;
  font-size: 13px;
  letter-spacing:.01em;
}
.dashboard-panel .credit-pack-badge{
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,.25);
  background: rgba(56,189,248,.12);
  color: rgba(226,232,240,.90);
  white-space: nowrap;
}

/* Pack body */
.dashboard-panel .credit-pack-body{
  font-size: 12px;
  line-height: 1.35;
  color: rgba(226,232,240,.72);
}
.dashboard-panel .credit-pack-price{
  margin-top: 10px;
  font-size: 18px;
  font-weight: 950;
  color: rgba(226,232,240,.96);
}
.dashboard-panel .credit-pack-meta{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(226,232,240,.58);
}

/* Pack footer button */
.dashboard-panel .credit-pack-footer{margin-top:auto;}
.dashboard-panel .credit-pack-btn{
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.04);
  color: rgba(226,232,240,.92);
  padding: 10px 12px;
  font-weight: 900;
  font-size: 13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  cursor:pointer;
  transition: transform .08s ease, filter .12s ease, opacity .12s ease;
}
.dashboard-panel .credit-pack-btn:hover{filter: brightness(1.06);}
.dashboard-panel .credit-pack-btn:active{transform: translateY(1px);}

.dashboard-panel .credit-pack-btn.locked{
  opacity:.55;
  pointer-events:none;
  filter:none;
}

/* Responsive: mobile stacks */
@media (max-width: 900px){
  .dashboard-panel .auth-row{grid-template-columns: 1fr;}
  .dashboard-panel .credits-header{
    flex-direction: column;
    align-items: stretch;
  }
  .dashboard-panel .credits-header .actions{
    justify-content: space-between;
    width: 100%;
  }
  .dashboard-panel .credits-header .balance{
    text-align:left;
    min-width: 0;
    flex: 1 1 auto;
  }
  .dashboard-panel .credits-grid{grid-template-columns: 1fr;}
  .dashboard-panel .credit-pack-grid{grid-template-columns: 1fr;}
}

@media (max-width: 520px){
  .dashboard-panel{gap: 14px;}
  .dashboard-panel .credits-section{padding: 14px;}
  .dashboard-panel .credits-header .headline{font-size: 16px;}
  .dashboard-panel .credits-header .balance .val{font-size: 18px;}
}

/* ---- FIX: credits collapse should shrink the whole module ---- */
.dashboard-panel .credits-section{
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

.dashboard-panel .credits-section.collapsed #creditsBody,
.dashboard-panel .credits-section.collapsed .credits-body{
  display: none !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
