/**
 * Cards & Panels Component - Based on Original ProRank Unified Design
 * 
 * Premium card layouts with hover effects and clean borders
 * From the original prorank-unified.css design
 * 
 * @since 3.0.0
 */

/* ============================================
   BASE CARD
   ============================================ */

.prorank-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: visible;
  transition: box-shadow 0.2s ease;
}

.prorank-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.prorank-card-modern {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.prorank-card-modern:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

/* ============================================
   CARD HEADER
   ============================================ */

.prorank-card-header {
  padding: 12px 16px !important;
  background-color: #f9fafb !important;
  border-bottom: 1px solid #e5e7eb !important;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prorank-card-header-clean {
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.prorank-card-header h3 {
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
  color: #1f2937;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prorank-card-title-modern {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prorank-card-header .dashicons,
.prorank-card-title-modern .dashicons {
  color: #6b7280;
  font-size: 18px;
  width: 18px;
  height: 18px;
}

/* ============================================
   CARD BODY
   ============================================ */

.prorank-card-body {
  padding: 16px;
  background: #ffffff;
}

.prorank-card-body-large {
  padding: 20px;
}

.prorank-card-body-small {
  padding: 12px;
}

/* ============================================
   CARD FOOTER
   ============================================ */

.prorank-card-footer {
  padding: 16px 24px;
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ============================================
   CARD VARIANTS
   ============================================ */

/* Premium Card with Gradient Border */
.prorank-card-premium {
  position: relative;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.prorank-card-premium .prorank-card-header {
  background: #f5f5f5;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 24px;
}

/* Stat Cards - Premium appearance */
.prorank-stat-card.prorank-card-premium {
  background: white;
  border: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  transition: all 0.2s ease;
}

.prorank-stat-card.prorank-card-premium:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.prorank-stat-card .stat-icon {
  font-size: 32px;
  color: #f97316;
  margin-bottom: 12px;
  display: block;
}

.prorank-stat-card .stat-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prorank-stat-card .stat-number {
  font-size: 28px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1;
}

.prorank-stat-card .stat-label {
  font-size: 13px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* Schema Item Cards */
.prorank-schema-item.prorank-card-premium {
  padding: 0;
  overflow: visible;
}

.prorank-schema-item .prorank-schema-item-header {
  background: #f5f5f5;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  gap: 16px;
}

.prorank-schema-item .prorank-schema-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.prorank-schema-item .prorank-schema-icon .dashicons {
  color: white;
  font-size: 20px;
}

.prorank-schema-item .prorank-schema-item-body {
  padding: 16px 20px;
  background: white;
}

.prorank-schema-item .prorank-schema-item-footer {
  padding: 12px 20px;
  background: #fafafa;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Library Header Actions */
.prorank-library-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.prorank-library-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
}

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

.prorank-library-title .description {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

/* Schema Library Views */
.prorank-schemas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.prorank-schemas-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.prorank-schemas-list .prorank-schema-item {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.prorank-schemas-list .prorank-schema-item-header {
  flex: 1;
  border-bottom: none;
  border-right: 1px solid #e5e7eb;
}

.prorank-schemas-list .prorank-schema-item-body {
  flex: 2;
}

.prorank-schemas-list .prorank-schema-item-footer {
  flex: 0 0 auto;
  border-top: none;
  border-left: 1px solid #e5e7eb;
}

/* Library Controls */
.prorank-library-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.prorank-control-left {
  display: flex;
  gap: 12px;
  flex: 1;
  align-items: center;
}

.prorank-view-toggle {
  display: flex;
  gap: 4px;
}

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

/* Success Card */
.prorank-card-success {
  border-color: var(--prorank-success);
  background: rgba(16, 185, 129, 0.05);
}

.prorank-card-success .prorank-card-header {
  background: rgba(16, 185, 129, 0.1);
  border-bottom-color: var(--prorank-success);
}

/* Warning Card */
.prorank-card-warning {
  border-color: #fbbf24;
  background: #fffbeb;
}

.prorank-card-warning .prorank-card-header {
  background: #fef3c7;
  border-bottom-color: #fbbf24;
}

/* Error Card */
.prorank-card-error {
  border-color: var(--prorank-error);
  background: #fef2f2;
}

.prorank-card-error .prorank-card-header {
  background: #fee2e2;
  border-bottom-color: var(--prorank-error);
}

/* Info Card */
.prorank-card-info {
  border-color: #3b82f6;
  background: #eff6ff;
}

.prorank-card-info .prorank-card-header {
  background: #dbeafe;
  border-bottom-color: #3b82f6;
}

/* Feature Card - For feature showcases */
.prorank-card--feature {
  position: relative;
  overflow: visible;
}

.prorank-card--feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--prorank-gradient-accent);
}

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

/* Task Card - For task management */
.prorank-card--task {
  cursor: move;
  user-select: none;
}

.prorank-card--task.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
}

.prorank-card--task .prorank-task-meta {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.prorank-card--task .prorank-task-priority {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.prorank-card--task .prorank-task-priority--high {
  background: var(--prorank-error);
  color: white;
}

.prorank-card--task .prorank-task-priority--medium {
  background: var(--prorank-warning);
  color: var(--prorank-text);
}

.prorank-card--task .prorank-task-priority--low {
  background: var(--prorank-bg-tertiary);
  color: var(--prorank-text-secondary);
}

/* Campaign Card - For marketing campaigns */
.prorank-card--campaign {
  position: relative;
  cursor: pointer;
  overflow: visible;
}

.prorank-card--campaign::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--prorank-border);
  transition: var(--prorank-transition);
}

.prorank-card--campaign:hover::after,
.prorank-card--campaign.active::after {
  background: var(--prorank-primary);
  height: 4px;
}

/* Beta Card - For beta features */
.prorank-card--beta {
  border: 2px dashed var(--prorank-warning);
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}

.prorank-card--beta .prorank-beta-badge {
  display: inline-block;
  padding: 4px 8px;
  background: var(--prorank-warning);
  color: var(--prorank-text);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Compact Card - For limited space */
.prorank-card--compact {
  min-height: auto;
}

.prorank-card--compact .prorank-card__header {
  padding: 12px 16px;
}

.prorank-card--compact .prorank-card__body {
  padding: 12px 16px;
}

/* Premium Card - For pro features */
.prorank-card--premium {
  background: linear-gradient(135deg, #fef3ff 0%, #f3e8ff 100%);
  border: 2px solid var(--prorank-pink);
  position: relative;
  overflow: visible;
}

.prorank-card--premium::before {
  content: 'PRO';
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--prorank-pink);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
}

/* ============================================
   CARD LAYOUTS
   Different card arrangements
   ============================================ */

/* Card Grid */
.prorank-cards-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.prorank-cards-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.prorank-cards-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.prorank-cards-grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

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

/* Card Deck (horizontal scroll) */
.prorank-cards-deck {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.prorank-cards-deck .prorank-card {
  flex: 0 0 280px;
}

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

@media (max-width: 768px) {
  .prorank-cards-grid--2,
  .prorank-cards-grid--3,
  .prorank-cards-grid--4 {
    grid-template-columns: 1fr;
  }
  
  .prorank-card__header {
    padding: 16px;
  }
  
  .prorank-card__body {
    padding: 16px;
  }
}