/* ============================================================================
   Prediction Markets - Shared Styles
   ============================================================================

   Purpose: Common styles shared between prediction shortcodes
   Used by:
     - [prediction_top_markets_by_volume] (DefiRate_Prediction_Top_Markets_Shortcode)
     - [prediction_markets_by_category] (DefiRate_Prediction_By_Category_Shortcode)
     - [prediction_platform_comparison] (DefiRate_Prediction_Platform_Comparison_Shortcode)
     - [prediction_event_detail] (DefiRate_Prediction_Event_Detail_Shortcode)
   Enqueued via:
     - DefiRate_Assets::enqueue_prediction_top_markets()
     - DefiRate_Assets::enqueue_prediction_by_category()
     - DefiRate_Assets::enqueue_prediction_platform_comparison()
     - DefiRate_Assets::enqueue_prediction_event_detail()

   Architecture:
   - Defines CSS custom properties (design tokens)
   - Provides base component styles used across all prediction widgets
   - Widget-specific overrides remain in individual CSS files

   ========================================================================= */

/* ============================================================================
   CSS Variables & Base Styles
   ========================================================================= */

/* Shared prediction platform variables (used by platform-comparison and by-category) */
.defirate-platform-comparison,
.defirate-prediction-top-markets.pred-by-category {
  --ppc-kalshi: #00d4aa;
  --ppc-polymarket: #7c3aed;
  --ppc-polymarket-us: #2563eb;
  --ppc-success: #10b981;
  --ppc-danger: #ef4444;
  --ppc-primary: #3b82f6;
  --ppc-bg-primary: #ffffff;
  --ppc-bg-secondary: #f8fafc;
  --ppc-bg-tertiary: #f1f5f9;
  --ppc-border: #e2e8f0;
  --ppc-border-light: #f1f5f9;
  --ppc-text-primary: #0f172a;
  --ppc-text-secondary: #64748b;
  --ppc-text-tertiary: #94a3b8;
  --ppc-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   PPC Widgets - Shared Wrapper Frame
   ========================================================================= */

.defirate-platform-comparison,
.defirate-prediction-top-markets.pred-by-category {
  background: var(--ppc-bg-primary);
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  border: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
}

/* Wrapper styles - desktop only */
@media (min-width: 768px) {
  .defirate-platform-comparison,
  .defirate-prediction-top-markets.pred-by-category {
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: var(--ppc-shadow-sm);
    border: 1px solid var(--ppc-border);
  }
}

.defirate-platform-comparison *,
.defirate-platform-comparison *::before,
.defirate-platform-comparison *::after,
.defirate-prediction-top-markets.pred-by-category *,
.defirate-prediction-top-markets.pred-by-category *::before,
.defirate-prediction-top-markets.pred-by-category *::after {
  box-sizing: border-box;
}

.defirate-prediction-top-markets * {
  box-sizing: border-box;
}

.defirate-prediction-top-markets {
  /* Color palette */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f8fafc;
  --bg-hover: #f1f5f9;
  --border-color: #e5e7eb;
  --text-primary: #1a1a1a;
  --text-secondary: #374151;
  --text-tertiary: #6b7280;
  --accent-primary: #2563eb;

  /* Platform colors */
  --kalshi: #00d4aa;
  --kalshi-dark: #009f85;
  --polymarket: #7c3aed;
  --polymarket-dark: #5b21b6;
  --polymarket-us: #2563eb;
  --polymarket-us-dark: #1e40af;

  /* Status colors */
  --success-bg: #d1fae5;
  --success-text: #065f46;
  --neutral-bg: #f3f4f6;
  --neutral-text: #6b7280;

  /* Effects */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);

  /* Typography */
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Inter, Helvetica, Arial, sans-serif;
}

/* ============================================================================
   Shared Component Styles
   ========================================================================= */

/* Container */
.defirate-prediction-top-markets .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

.defirate-prediction-top-markets .section {
  padding: 0;
}

/* Section Header */
.defirate-prediction-top-markets .section-header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.defirate-prediction-top-markets .section-title {
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  margin-right: auto;
  text-align: left;
  text-decoration: none;
  border: 0;
  padding-bottom: 0 !important;
}

/* Remove theme-added pseudo-elements */
.defirate-prediction-top-markets .section-title::after {
  content: none !important;
}

/* Period Toggle Buttons */
.defirate-prediction-top-markets .time-toggle {
  display: flex;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--border-color);
}

.defirate-prediction-top-markets .time-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-tertiary);
}

.defirate-prediction-top-markets .time-btn.active {
  background: var(--accent-primary);
  color: #fff;
}

/* Period Sections - Toggle visibility via JS */
.defirate-prediction-top-markets .period-section {
  display: none;
}

.defirate-prediction-top-markets .period-section.active {
  display: block;
}

/* Updated timestamp */
.defirate-prediction-top-markets .updated-meta {
  text-align: right;
  color: var(--text-tertiary);
  font-size: 12px;
  margin: 4px 0 8px;
}
