/* Dashboard Styles */
.dashboard-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.back-btn {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.header-left h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
}

.user-info img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-details {
  color: white;
}

.user-details div:first-child {
  font-weight: 600;
  font-size: 1rem;
}

.user-details div:last-child {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Main Dashboard Content */
.dashboard-main {
  padding: 2rem 0;
  background: #f8fafc;
  min-height: calc(100vh - 80px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Stats Section */
.stats-section {
  margin-bottom: 3rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-icon {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-content {
  flex: 1;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--ink);
  font-weight: 700;
}

/* Plans Section */
.plans-section {
  margin-bottom: 3rem;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.plan-item {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.plan-info h4 {
  margin: 0 0 0.5rem 0;
  color: var(--ink);
  font-size: 1.2rem;
}

.plan-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.plan-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 1rem;
}

.plan-status.paid {
  background: #dcfce7;
  color: #166534;
}

.plan-status.pending {
  background: #fef3c7;
  color: #92400e;
}

/* Referrals Section */
.referrals-section {
  margin-bottom: 3rem;
}

.referral-content {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.referral-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.referral-stat {
  text-align: center;
}

.referral-stat .stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.referral-stat .stat-label {
  color: var(--muted);
  font-size: 0.9rem;
}

.referral-code-section {
  text-align: center;
  padding: 2rem;
  background: #f8fafc;
  border-radius: 12px;
}

.referral-code-section h3 {
  margin: 0 0 1rem 0;
  color: var(--ink);
  font-size: 1.3rem;
}

.referral-code-display {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.referral-code-display input {
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  background: white;
  color: var(--brand);
  min-width: 200px;
}

.referral-info {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Billing Section */
.billing-section {
  margin-bottom: 3rem;
}

.billing-content {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.billing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e2e8f0;
}

.billing-stat {
  text-align: center;
}

.billing-stat .stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.billing-stat .stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.purchase-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.purchase-item:last-child {
  border-bottom: none;
}

.purchase-info h4 {
  margin: 0 0 0.25rem 0;
  color: var(--ink);
  font-size: 1rem;
}

.purchase-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.purchase-amount {
  font-weight: 600;
  color: var(--brand);
  font-size: 1.1rem;
}

.purchase-status {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.purchase-status.completed {
  background: #dcfce7;
  color: #166534;
}

.purchase-status.pending {
  background: #fef3c7;
  color: #92400e;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--brand);
  border: 2px solid var(--brand);
}

.btn-ghost:hover {
  background: var(--brand);
  color: white;
}

/* Referral Modal */
.referral-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.referral-modal.hidden {
  display: none;
}

.referral-modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.referral-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.referral-modal-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.5rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted);
}

.referral-modal-body p {
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.share-btn {
  padding: 1rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.share-btn.social {
  background: #f8fafc;
  color: var(--ink);
  border: 1px solid #e2e8f0;
}

.share-btn.social:hover {
  background: var(--brand);
  color: white;
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .header-left {
    flex-direction: column;
    gap: 1rem;
  }
  
  .header-left h1 {
    font-size: 1.5rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .plans-grid {
    grid-template-columns: 1fr;
  }
  
  .referral-stats {
    grid-template-columns: 1fr;
  }
  
  .billing-summary {
    grid-template-columns: 1fr;
  }
  
  .share-options {
    grid-template-columns: 1fr;
  }
  
  .referral-code-display {
    flex-direction: column;
    align-items: center;
  }
  
  .referral-code-display input {
    min-width: auto;
    width: 100%;
    max-width: 300px;
  }
}