/* Dashboard-specific styles matching website theme */

.dashboard-section {
  min-height: calc(100vh - 120px);
  padding: 2rem 0;
  background: var(--bg-colour);
}

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

.dashboard-header {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-colour);
}

.dashboard-header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--accent-colour-light);
}

.dashboard-header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.dashboard-card {
  background: var(--surface-colour);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  border: 1px solid rgba(61, 169, 252, 0.1);
}

.dashboard-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  border-color: rgba(61, 169, 252, 0.3);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(61, 169, 252, 0.2);
}

.card-header h3 {
  color: var(--accent-colour);
  font-size: 1.25rem;
  margin: 0;
}

.subscription-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.plan-name {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-colour);
}

.plan-badge {
  background: var(--accent-colour);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.plan-badge.free {
  background: #718096;
}

.plan-badge.pro {
  background: var(--accent-colour);
}

.plan-badge.elit {
  background: var(--accent-colour-light);
}

.subscription-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.meta-label {
  color: #8b949e;
  font-weight: 500;
}

.meta-value {
  color: var(--text-colour);
  font-weight: 600;
}

.status-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.active {
  background: #c6f6d5;
  color: #22543d;
}

.status-badge.inactive {
  background: #fed7d7;
  color: #742a2a;
}

.status-badge.loading {
  background: #e2e8f0;
  color: #4a5568;
}

.upgrade-section {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(61, 169, 252, 0.05);
  border-radius: var(--border-radius);
  border: 1px solid rgba(61, 169, 252, 0.2);
}

.upgrade-section p {
  margin: 0 0 1rem 0;
  color: var(--text-colour);
  text-align: center;
}

.upgrade-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.upgrade-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--border-radius);
  background: var(--accent-colour);
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-speed);
  min-width: 120px;
}

.upgrade-btn:hover {
  background: var(--accent-colour-light);
  transform: translateY(-1px);
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.action-btn.primary {
  background: var(--accent-colour);
  color: white;
}

.action-btn.secondary {
  background: rgba(61, 169, 252, 0.1);
  color: var(--text-colour);
  border: 1px solid rgba(61, 169, 252, 0.2);
}

.action-btn:hover {
  transform: translateY(-2px);
}

.account-info {
  margin-bottom: 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(61, 169, 252, 0.1);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: #8b949e;
  font-weight: 500;
}

.info-value {
  color: var(--text-colour);
  font-weight: 600;
}

.secondary-btn {
  padding: 0.5rem 1rem;
  background: rgba(61, 169, 252, 0.1);
  color: var(--text-colour);
  border: 1px solid rgba(61, 169, 252, 0.2);
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-speed);
}

.secondary-btn:hover {
  background: rgba(61, 169, 252, 0.2);
  transform: translateY(-1px);
}

.loading-state {
  text-align: center;
  color: #8b949e;
  font-style: italic;
  padding: 1rem;
}

.billing-history, .usage-stats {
  min-height: 100px;
}

/* Loading state styling */
.billing-history:has(.loading-state) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Billing items container */
.billing-history:not(:has(.loading-state)) {
  display: block;
  overflow-y: auto;
  max-height: 300px;
}

/* Individual billing item styling */
.billing-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-bottom: 1px solid rgba(61, 169, 252, 0.1);
  transition: background var(--transition-speed);
}

.billing-item:hover {
  background: rgba(61, 169, 252, 0.05);
}

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

.billing-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.billing-date {
  font-size: 0.9rem;
  color: var(--text-colour);
  font-weight: 500;
}

.billing-description {
  font-size: 0.8rem;
  color: var(--text-colour);
  opacity: 0.7;
}

.billing-amount {
  font-weight: 600;
  color: var(--accent-colour-light);
  font-size: 1rem;
}

.no-billing {
  text-align: center;
  color: var(--text-colour);
  opacity: 0.7;
  padding: 2rem;
}

.support-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.support-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  color: var(--text-colour);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: background var(--transition-speed);
}

.support-link:hover {
  background: rgba(61, 169, 252, 0.1);
}

.view-all-link {
  color: var(--accent-colour);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
}

.view-all-link:hover {
  color: var(--accent-colour-light);
  text-decoration: underline;
}

.loading-overlay {
  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: 9999;
}

.loading-spinner {
  background: var(--surface-colour);
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  color: var(--text-colour);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(201, 209, 217, 0.3);
  border-top: 4px solid var(--accent-colour);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .dashboard-header h1 {
    font-size: 2rem;
  }
  
  .action-buttons {
    grid-template-columns: 1fr;
  }
  
  .upgrade-buttons {
    flex-direction: column;
  }
  
  .plan-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}