/**
 * Dashboard Page Modern Styles
 * Consistent with Analytics, Local SEO, E-commerce, and Support pages
 */

/* Page Layout */
.prorank-dashboard-page {
  --dashboard-primary: #4285f4;
  --dashboard-secondary: #34a853;
  --dashboard-warning: #fbbc04;
  --dashboard-danger: #ea4335;
  --dashboard-info: #4285f4;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  max-width: 1600px;
  margin: 0 auto;
  padding: 20px;
}

/* Page Header */
.prorank-dashboard-page .prorank-page-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  border-bottom: 1px solid #e0e0e0;
  margin: -20px -20px 30px;
  padding: 40px;
}

.prorank-dashboard-page h1 {
  font-size: 32px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.prorank-dashboard-page h1::before {
  content: '📊';
  font-size: 36px;
}

.prorank-dashboard-page .prorank-page-subtitle {
  font-size: 16px;
  color: #646970;
  margin: 0;
  max-width: 800px;
}

/* Dashboard Actions */
.prorank-dashboard-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.prorank-upgrade-button {
  background: linear-gradient(135deg, var(--dashboard-primary) 0%, #3367d6 100%) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.3) !important;
  padding: 10px 20px !important;
  font-weight: 500 !important;
  transition: all 0.3s ease !important;
}

.prorank-upgrade-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.4) !important;
}

/* License Banner */
.prorank-license-banner {
  margin-bottom: 30px;
}

.prorank-license-card {
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
}

.prorank-license-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
}

/* License tier-specific styling */
.prorank-license-card--free {
  border-color: #e0e0e0;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.prorank-license-card--core,
.prorank-license-card--pro {
  border-color: rgba(103, 58, 183, 0.3);
  background: linear-gradient(135deg, rgba(103, 58, 183, 0.05) 0%, #ffffff 100%);
}

.prorank-license-card--business {
  border-color: rgba(255, 111, 0, 0.3);
  background: linear-gradient(135deg, rgba(255, 111, 0, 0.05) 0%, #ffffff 100%);
}

.prorank-license-card--agency {
  border-color: rgba(220, 38, 38, 0.3);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.05) 0%, #ffffff 100%);
}

.prorank-license-info h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #1d2327;
}

.prorank-license-info p {
  margin: 0;
  color: #646970;
  font-size: 14px;
}

/* Tab Panel Customization */
.prorank-dashboard-tabs .components-tab-panel__tabs {
  background: white;
  border-radius: 8px;
  padding: 4px;
  box-shadow: inset 0 0 0 1px #e0e0e0;
  margin-bottom: 30px;
}

.prorank-dashboard-tabs .components-tab-panel__tabs button {
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 500;
  color: #646970;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
}

.prorank-dashboard-tabs .components-tab-panel__tabs button.is-active {
  background: var(--dashboard-primary);
  color: white;
  box-shadow: 0 2px 4px rgba(66, 133, 244, 0.3);
}

.prorank-dashboard-tabs .components-tab-panel__tabs button:hover:not(.is-active) {
  background: #f3f4f6;
  color: #1d2327;
}

/* Section Headers */
.prorank-section-header {
  margin-bottom: 30px;
}

.prorank-section-title {
  font-size: 24px;
  font-weight: 600;
  color: #1d2327;
  margin: 0 0 8px;
}

.prorank-section-description {
  font-size: 16px;
  color: #646970;
  margin: 0;
}

/* Stats Grid */
.prorank-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Modern Card Design */
.prorank-card--modern {
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  background: #ffffff;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.prorank-card--modern:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
  border-color: #d0d0d0;
}

/* Card Header */
.prorank-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.prorank-card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #1d2327;
}

/* Stat Cards */
.prorank-stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
}

.prorank-stat-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 24px;
}

.prorank-stat-card--success .prorank-stat-icon {
  background: rgba(52, 168, 83, 0.1);
  color: var(--dashboard-secondary);
}

.prorank-stat-card--warning .prorank-stat-icon {
  background: rgba(251, 188, 4, 0.1);
  color: var(--dashboard-warning);
}

.prorank-stat-card--info .prorank-stat-icon {
  background: rgba(66, 133, 244, 0.1);
  color: var(--dashboard-info);
}

.prorank-stat-card--danger .prorank-stat-icon {
  background: rgba(234, 67, 53, 0.1);
  color: var(--dashboard-danger);
}

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

.prorank-stat-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: #1d2327;
  line-height: 1.1;
  margin-bottom: 4px;
}

.prorank-stat-label {
  display: block;
  font-size: 14px;
  color: #646970;
}

/* Status Badges */
.prorank-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.prorank-status--active {
  background: #e6f4ea;
  color: var(--dashboard-secondary);
}

.prorank-status--inactive {
  background: #fce8e6;
  color: var(--dashboard-danger);
}

.prorank-status--warning {
  background: #fef7e0;
  color: var(--dashboard-warning);
}

/* Module Grid */
.prorank-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

/* Module Cards */
.prorank-module-card {
  border-radius: 12px;
  border: 2px solid #e0e0e0;
  background: #ffffff;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.prorank-module-card:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px);
  border-color: #d0d0d0;
}

.prorank-module-card.is-active {
  border-color: var(--dashboard-primary);
}

.prorank-module-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 20px 0;
}

.prorank-module-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f3f4f6;
  font-size: 24px;
}

.prorank-module-card.is-active .prorank-module-icon {
  background: rgba(66, 133, 244, 0.1);
  color: var(--dashboard-primary);
}

/* Quick Actions */
.prorank-quick-actions {
  margin-bottom: 30px;
}

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

.prorank-action-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px !important;
  font-weight: 500 !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  background: #f8f9fa !important;
  border: 1px solid #e0e0e0 !important;
  color: #1d2327 !important;
}

.prorank-action-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: #ffffff !important;
  border-color: var(--dashboard-primary) !important;
  color: var(--dashboard-primary) !important;
}

/* Activity List */
.prorank-activity-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prorank-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.prorank-activity-item:hover {
  background: #f0f6fc;
  transform: translateX(4px);
}

.prorank-activity-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: white;
  color: #646970;
}

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

.prorank-activity-text {
  font-size: 14px;
  color: #1d2327;
  margin: 0 0 4px;
}

.prorank-activity-time {
  font-size: 12px;
  color: #646970;
}

/* Full Width Cards */
.prorank-card--full-width {
  grid-column: 1 / -1;
}

/* Loading State */
.prorank-dashboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  gap: 16px;
}

/* Settings Actions */
.prorank-settings-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Quick Setup Wizard */
.prorank-setup-steps {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 24px 0;
}

.prorank-step {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.prorank-step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dashboard-primary);
  color: white;
  border-radius: 50%;
  font-weight: 600;
  font-size: 18px;
}

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

.prorank-step-content h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: #1d2327;
}

.prorank-step-content p {
  margin: 0;
  color: #646970;
  font-size: 14px;
}

/* Dark Mode Support */
[data-theme="dark"] .prorank-dashboard-page,
.prorank-dark-theme .prorank-dashboard-page {
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .prorank-dashboard-page .prorank-page-header,
.prorank-dark-theme .prorank-dashboard-page .prorank-page-header {
  background: linear-gradient(135deg, #1d2327 0%, #2c3338 100%);
  border-bottom-color: #40464d;
}

[data-theme="dark"] .prorank-dashboard-page h1,
[data-theme="dark"] .prorank-section-title,
[data-theme="dark"] .prorank-card-title,
.prorank-dark-theme .prorank-dashboard-page h1,
.prorank-dark-theme .prorank-section-title,
.prorank-dark-theme .prorank-card-title {
  color: #f0f0f1;
}

[data-theme="dark"] .prorank-dashboard-page .prorank-page-subtitle,
[data-theme="dark"] .prorank-section-description,
[data-theme="dark"] .prorank-stat-label,
[data-theme="dark"] .prorank-activity-time,
.prorank-dark-theme .prorank-dashboard-page .prorank-page-subtitle,
.prorank-dark-theme .prorank-section-description,
.prorank-dark-theme .prorank-stat-label,
.prorank-dark-theme .prorank-activity-time {
  color: #c3c4c7;
}

[data-theme="dark"] .prorank-card--modern,
[data-theme="dark"] .prorank-license-card,
[data-theme="dark"] .prorank-module-card,
.prorank-dark-theme .prorank-card--modern,
.prorank-dark-theme .prorank-license-card,
.prorank-dark-theme .prorank-module-card {
  background: #2c3338;
  border-color: #40464d;
}

[data-theme="dark"] .prorank-card--modern:hover,
[data-theme="dark"] .prorank-license-card:hover,
[data-theme="dark"] .prorank-module-card:hover,
.prorank-dark-theme .prorank-card--modern:hover,
.prorank-dark-theme .prorank-license-card:hover,
.prorank-dark-theme .prorank-module-card:hover {
  border-color: #50565d;
}

[data-theme="dark"] .prorank-card-header,
.prorank-dark-theme .prorank-card-header {
  background: #40464d;
  border-bottom-color: #50565d;
}

[data-theme="dark"] .prorank-stat-value,
[data-theme="dark"] .prorank-activity-text,
[data-theme="dark"] .prorank-license-info h3,
.prorank-dark-theme .prorank-stat-value,
.prorank-dark-theme .prorank-activity-text,
.prorank-dark-theme .prorank-license-info h3 {
  color: #f0f0f1;
}

[data-theme="dark"] .prorank-dashboard-tabs .components-tab-panel__tabs,
.prorank-dark-theme .prorank-dashboard-tabs .components-tab-panel__tabs {
  background: #2c3338;
  box-shadow: inset 0 0 0 1px #40464d;
}

[data-theme="dark"] .prorank-dashboard-tabs .components-tab-panel__tabs button:hover:not(.is-active),
.prorank-dark-theme .prorank-dashboard-tabs .components-tab-panel__tabs button:hover:not(.is-active) {
  background: #40464d;
  color: #f0f0f1;
}

[data-theme="dark"] .prorank-activity-item,
.prorank-dark-theme .prorank-activity-item {
  background: #40464d;
}

[data-theme="dark"] .prorank-activity-item:hover,
.prorank-dark-theme .prorank-activity-item:hover {
  background: #50565d;
}

[data-theme="dark"] .prorank-activity-icon,
.prorank-dark-theme .prorank-activity-icon {
  background: #2c3338;
}

[data-theme="dark"] .prorank-action-button,
.prorank-dark-theme .prorank-action-button {
  background: #40464d !important;
  border-color: #50565d !important;
  color: #f0f0f1 !important;
}

[data-theme="dark"] .prorank-action-button:hover,
.prorank-dark-theme .prorank-action-button:hover {
  background: #50565d !important;
  border-color: var(--dashboard-primary) !important;
}

[data-theme="dark"] .prorank-module-icon,
.prorank-dark-theme .prorank-module-icon {
  background: #40464d;
}

[data-theme="dark"] .prorank-step-content h4,
.prorank-dark-theme .prorank-step-content h4 {
  color: #f0f0f1;
}

[data-theme="dark"] .prorank-step-content p,
.prorank-dark-theme .prorank-step-content p {
  color: #c3c4c7;
}

/* Animation */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prorank-card--modern,
.prorank-stat-card {
  animation: slideIn 0.5s ease-out;
  animation-fill-mode: both;
}

.prorank-card--modern:nth-child(1) { animation-delay: 0.1s; }
.prorank-card--modern:nth-child(2) { animation-delay: 0.2s; }
.prorank-card--modern:nth-child(3) { animation-delay: 0.3s; }
.prorank-card--modern:nth-child(4) { animation-delay: 0.4s; }

/* Responsive Design */
@media (max-width: 1200px) {
  .prorank-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .prorank-module-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .prorank-dashboard-page .prorank-page-header {
    padding: 24px;
  }
  
  .prorank-dashboard-page h1 {
    font-size: 24px;
  }
  
  .prorank-stats-grid,
  .prorank-module-grid {
    grid-template-columns: 1fr;
  }
  
  .prorank-dashboard-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .prorank-dashboard-actions .components-button {
    width: 100%;
    justify-content: center;
  }
  
  .prorank-actions-grid {
    grid-template-columns: 1fr;
  }
}
