/**
 * ProRank Design System - Dashboard Feature Styles
 * 
 * Styles specific to the main dashboard and overview pages.
 * Extends core components for dashboard-specific layouts.
 * 
 * @module features/dashboard
 * @since 3.0.0
 */

/* ============================================
   DASHBOARD LAYOUT
   Main dashboard page structure
   ============================================ */

.prorank-dashboard {
  padding: 20px;
  background: var(--prorank-bg-secondary);
  min-height: 100vh;
}

.prorank-dashboard-header {
  margin-bottom: 24px;
}

.prorank-dashboard-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--prorank-text);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.prorank-dashboard-subtitle {
  font-size: 16px;
  color: var(--prorank-text-secondary);
  margin: 0;
}

/* ============================================
   DASHBOARD GRID
   Grid layout for dashboard widgets
   ============================================ */

.prorank-dashboard-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(12, 1fr);
}

/* Widget Spans */
.prorank-dashboard-widget {
  grid-column: span 12;
}

.prorank-dashboard-widget--half {
  grid-column: span 6;
}

.prorank-dashboard-widget--third {
  grid-column: span 4;
}

.prorank-dashboard-widget--quarter {
  grid-column: span 3;
}

.prorank-dashboard-widget--two-thirds {
  grid-column: span 8;
}

/* ============================================
   QUICK STATS SECTION
   Top-level metrics display
   ============================================ */

.prorank-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.prorank-quick-stat {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.prorank-quick-stat::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--prorank-gradient);
}

.prorank-quick-stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  opacity: 0.1;
}

.prorank-quick-stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--prorank-primary);
  margin-bottom: 4px;
}

.prorank-quick-stat-label {
  font-size: 14px;
  color: var(--prorank-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prorank-quick-stat-change {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--prorank-border-light);
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.prorank-quick-stat-change--positive {
  color: var(--prorank-success);
}

.prorank-quick-stat-change--negative {
  color: var(--prorank-error);
}

/* ============================================
   QUICK ACTIONS
   Fast access to common tasks
   ============================================ */

.prorank-quick-actions {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  padding: 20px;
  margin-bottom: 24px;
}

.prorank-quick-actions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.prorank-quick-actions-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--prorank-text);
  margin: 0;
}

.prorank-quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.prorank-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--prorank-bg-secondary);
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--prorank-transition);
  text-decoration: none;
  color: var(--prorank-text);
}

.prorank-quick-action:hover {
  background: white;
  border-color: var(--prorank-primary);
  transform: translateY(-2px);
  box-shadow: var(--prorank-shadow);
}

.prorank-quick-action-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--prorank-gradient);
  color: white;
  border-radius: 12px;
  font-size: 24px;
  margin-bottom: 8px;
}

.prorank-quick-action-label {
  font-size: 13px;
  font-weight: 500;
}

/* ============================================
   ACTIVITY FEED
   Recent activity and updates
   ============================================ */

.prorank-activity-feed {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  overflow: hidden;
}

.prorank-activity-header {
  padding: 16px 20px;
  background: var(--prorank-bg-secondary);
  border-bottom: 1px solid var(--prorank-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prorank-activity-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--prorank-text);
  margin: 0;
}

.prorank-activity-list {
  max-height: 400px;
  overflow-y: auto;
}

.prorank-activity-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--prorank-border-light);
  display: flex;
  gap: 12px;
  transition: var(--prorank-transition);
}

.prorank-activity-item:hover {
  background: var(--prorank-bg-secondary);
}

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

.prorank-activity-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--prorank-bg-tertiary);
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 16px;
}

.prorank-activity-icon--success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--prorank-success);
}

.prorank-activity-icon--warning {
  background: rgba(251, 191, 36, 0.1);
  color: var(--prorank-warning);
}

.prorank-activity-icon--error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--prorank-error);
}

.prorank-activity-content {
  flex: 1;
}

.prorank-activity-text {
  font-size: 14px;
  color: var(--prorank-text);
  margin: 0 0 4px;
}

.prorank-activity-meta {
  font-size: 12px;
  color: var(--prorank-text-tertiary);
}

/* ============================================
   QUICK SETUP WIZARD
   Branded shell for the dashboard setup flow
   ============================================ */

.prorank-wizard-shell {
  display: grid;
  gap: 20px;
}

.prorank-wizard-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 20px;
  padding: 28px;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255, 105, 0, 0.28), transparent 28%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #1f2a44 100%);
  color: #f8fafc;
  box-shadow:
    0 28px 60px -34px rgba(15, 23, 42, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.prorank-wizard-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.4;
  pointer-events: none;
}

.prorank-wizard-hero__content,
.prorank-wizard-hero__stats {
  position: relative;
  z-index: 1;
}

.prorank-wizard-hero__content {
  display: grid;
  gap: 14px;
  align-content: start;
}

.prorank-wizard-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fde68a;
}

.prorank-wizard-hero__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.92);
}

.prorank-wizard-hero__brand-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.prorank-wizard-hero__title {
  margin: 0;
  font-size: clamp(2rem, 2.2vw, 2.85rem);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff7ed;
}

.prorank-wizard-hero__copy {
  max-width: 60ch;
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(226, 232, 240, 0.86);
}

.prorank-wizard-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-self: stretch;
}

.prorank-wizard-hero__stat {
  display: grid;
  align-content: end;
  gap: 8px;
  min-height: 132px;
  padding: 18px 18px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.prorank-wizard-hero__stat-value {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  color: #ffffff;
}

.prorank-wizard-hero__stat-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.76);
}

.prorank-wizard-frame {
  display: grid;
  gap: 18px;
}

.prorank-wizard-frame__intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.prorank-wizard-frame__eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff6900;
}

.prorank-wizard-frame__title {
  margin: 0 0 6px;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
}

.prorank-wizard-frame__copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
}

.prorank-wizard-frame__pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.prorank-wizard-frame__panel {
  padding: 26px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.98)),
    #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow:
    0 24px 60px -38px rgba(15, 23, 42, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.prorank-wizard-stage {
  min-height: 380px;
}

.prorank-wizard-footnote {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
}

.prorank-wizard-footnote__link {
  color: #c2410c;
  text-decoration: none;
  font-weight: 700;
}

.prorank-wizard-footnote__link:hover,
.prorank-wizard-footnote__link:focus {
  color: #9a3412;
  text-decoration: underline;
}

.prorank-wizard-complete {
  max-width: 760px;
  margin: 0 auto;
  padding: 34px 30px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(circle at top right, rgba(16, 185, 129, 0.18), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px -38px rgba(15, 23, 42, 0.3);
}

.prorank-wizard-complete__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin-bottom: 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
}

.prorank-wizard-complete__title {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 800;
  color: #0f172a;
}

.prorank-wizard-complete__copy {
  margin: 0 auto 22px;
  max-width: 56ch;
  font-size: 15px;
  line-height: 1.65;
  color: #64748b;
}

.prorank-wizard-complete__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.prorank-wizard-primary-btn,
.prorank-wizard-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.prorank-wizard-primary-btn {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 52%, #ff6900 100%);
  color: #fff !important;
  border: 0;
  box-shadow: 0 18px 36px -20px rgba(255, 105, 0, 0.52);
}

.prorank-wizard-primary-btn:hover,
.prorank-wizard-primary-btn:focus {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 22px 42px -22px rgba(255, 105, 0, 0.56);
}

.prorank-wizard-secondary-btn {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 14px 28px -24px rgba(15, 23, 42, 0.34);
}

.prorank-wizard-secondary-btn:hover,
.prorank-wizard-secondary-btn:focus {
  color: #c2410c;
  border-color: #fdba74;
  background: #fff7ed;
}

.prorank-wizard-secondary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 960px) {
  .prorank-wizard-hero {
    grid-template-columns: 1fr;
  }

  .prorank-wizard-hero__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .prorank-wizard-frame__intro {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 782px) {
  .prorank-wizard-hero,
  .prorank-wizard-frame__panel,
  .prorank-wizard-complete {
    padding: 20px;
    border-radius: 22px;
  }

  .prorank-wizard-hero__stats {
    grid-template-columns: 1fr;
  }

  .prorank-wizard-hero__stat {
    min-height: auto;
  }

  .prorank-wizard-frame__title {
    font-size: 24px;
  }
}

/* ============================================
   CHARTS SECTION
   Dashboard chart containers
   ============================================ */

.prorank-dashboard-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.prorank-chart-container {
  background: white;
  border: 1px solid var(--prorank-border);
  border-radius: var(--prorank-radius-sm);
  padding: 20px;
  min-height: 300px;
}

.prorank-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--prorank-border-light);
}

.prorank-chart-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--prorank-text);
  margin: 0;
}

.prorank-chart-controls {
  display: flex;
  gap: 8px;
}

.prorank-chart-period-selector {
  display: flex;
  background: var(--prorank-bg-secondary);
  border-radius: 4px;
  padding: 2px;
}

.prorank-chart-period-option {
  padding: 4px 12px;
  font-size: 12px;
  background: transparent;
  border: none;
  color: var(--prorank-text-secondary);
  cursor: pointer;
  border-radius: 3px;
  transition: var(--prorank-transition);
}

.prorank-chart-period-option:hover {
  background: rgba(37, 99, 235, 0.1);
}

.prorank-chart-period-option.active {
  background: white;
  color: var(--prorank-primary);
  box-shadow: var(--prorank-shadow-sm);
}

/* ============================================
   NOTIFICATIONS BANNER
   Important notices and alerts
   ============================================ */

.prorank-dashboard-notifications {
  margin-bottom: 24px;
}

.prorank-notification-banner {
  padding: 16px 20px;
  border-radius: var(--prorank-radius-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.prorank-notification-banner--info {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--prorank-primary);
}

.prorank-notification-banner--success {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--prorank-success);
}

.prorank-notification-banner--warning {
  background: rgba(251, 191, 36, 0.05);
  border: 1px solid rgba(251, 191, 36, 0.2);
  color: var(--prorank-warning);
}

.prorank-notification-banner--error {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--prorank-error);
}

.prorank-notification-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.prorank-notification-content {
  flex: 1;
}

.prorank-notification-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.prorank-notification-text {
  font-size: 14px;
  opacity: 0.9;
}

.prorank-notification-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0.5;
  transition: var(--prorank-transition);
}

.prorank-notification-close:hover {
  opacity: 1;
}

/* ============================================
   RESPONSIVE DESIGN
   Mobile-first responsive adjustments
   ============================================ */

@media (max-width: 1200px) {
  .prorank-dashboard-widget--quarter {
    grid-column: span 6;
  }
  
  .prorank-dashboard-widget--third {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .prorank-dashboard {
    padding: 12px;
  }
  
  .prorank-dashboard-widget,
  .prorank-dashboard-widget--half,
  .prorank-dashboard-widget--third,
  .prorank-dashboard-widget--quarter,
  .prorank-dashboard-widget--two-thirds {
    grid-column: span 12;
  }
  
  .prorank-quick-stats {
    grid-template-columns: 1fr;
  }
  
  .prorank-dashboard-charts {
    grid-template-columns: 1fr;
  }
  
  .prorank-quick-actions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
