/**
 * Dashboard Styles for QwickPress Admin
 *
 * Uses QwickApps theme CSS variables for professional, cohesive styling
 *
 * Copyright (c) 2025 QwickApps.com. All rights reserved.
 */

.dashboard-container {
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-header {
  margin-bottom: 3rem;
}

.dashboard-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.dashboard-title {
  flex: 1;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--theme-text-primary);
}

.dashboard-title .theme-note {
  font-size: 0.9rem;
  color: var(--theme-elevation-600);
  margin-top: 0.5rem;
  font-style: italic;
}

.dashboard-header p {
  font-size: 1.1rem;
  color: var(--theme-text-secondary);
  margin: 0;
}

.dashboard-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--theme-border);
  border-top-color: var(--theme-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

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

  .dashboard-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-controls {
    width: 100%;
    justify-content: flex-start;
  }
}

.dashboard-card {
  position: relative;
  padding: 2rem;
  border-radius: 16px;
  text-decoration: none;
  color: white;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: slideUp 0.5s ease-out both;
  border: 2px solid transparent;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Card color variants using theme CSS variables */
.dashboard-card.card-primary {
  background: var(--theme-primary);
  border-color: var(--theme-primary-dark);
}

.dashboard-card.card-secondary {
  background: var(--theme-secondary);
  border-color: var(--theme-secondary-dark);
}

.dashboard-card.card-accent {
  background: var(--theme-accent);
  border-color: var(--theme-accent-dark);
}

.dashboard-card.card-success {
  background: var(--theme-success);
  border-color: var(--theme-success-dark);
}

.dashboard-card.card-warning {
  background: var(--theme-warning);
  border-color: var(--theme-warning-dark);
}

.dashboard-card.card-info {
  background: var(--theme-info);
  border-color: var(--theme-info-dark);
}

.dashboard-card.card-primary-variant {
  background: var(--theme-primary-light);
  border-color: var(--theme-primary);
  color: var(--theme-text-primary);
}

.dashboard-card.card-secondary-variant {
  background: var(--theme-secondary-light);
  border-color: var(--theme-secondary);
  color: var(--theme-text-primary);
}

.dashboard-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  border-color: currentColor;
}

.dashboard-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dashboard-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 3rem;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-description {
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 0.95;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-count {
  font-size: 3rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1;
  margin-top: auto;
}

.card-arrow {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 1.5rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

.dashboard-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.dashboard-footer {
  background: var(--theme-surface);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
  border: 1px solid var(--theme-border);
}

.dashboard-footer h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--theme-text-primary);
}

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

.quick-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--theme-surface-variant);
  border: 2px solid var(--theme-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--theme-text-primary);
  font-weight: 600;
  transition: all 0.2s ease;
}

.quick-link:hover {
  border-color: var(--theme-primary);
  background: var(--theme-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
  .dashboard-card.card-primary-variant,
  .dashboard-card.card-secondary-variant {
    color: white;
  }
}
