/**
 * DM Events - Root CSS Custom Properties
 * Centralized design tokens for all blocks and JavaScript
 */

:root {
  /* ====================================
   * GRID LAYOUT CONSTANTS
   * Used by both CSS and JavaScript
   * ==================================== */
  --datamachine-grid-cell-width: 316px;
  --datamachine-grid-cell-height: 222px;
  --datamachine-grid-gap: 1.5rem;

  /* ====================================
   * DAY COLORS
   * ==================================== */
  --datamachine-day-sunday: #ff6b6b;
  --datamachine-day-sunday-rgb: 255, 107, 107;
  --datamachine-day-sunday-rgba: rgba(255, 107, 107, 0.15);
  --datamachine-day-monday: #4ecdc4;
  --datamachine-day-monday-rgb: 78, 205, 196;
  --datamachine-day-monday-rgba: rgba(78, 205, 196, 0.15);
  --datamachine-day-tuesday: #45b7d1;
  --datamachine-day-tuesday-rgb: 69, 183, 209;
  --datamachine-day-tuesday-rgba: rgba(69, 183, 209, 0.15);
  --datamachine-day-wednesday: #96ceb4;
  --datamachine-day-wednesday-rgb: 150, 206, 180;
  --datamachine-day-wednesday-rgba: rgba(150, 206, 180, 0.15);
  --datamachine-day-thursday: #feca57;
  --datamachine-day-thursday-rgb: 254, 202, 87;
  --datamachine-day-thursday-rgba: rgba(254, 202, 87, 0.15);
  --datamachine-day-friday: #d63384;
  --datamachine-day-friday-rgb: 214, 51, 132;
  --datamachine-day-friday-rgba: rgba(214, 51, 132, 0.15);
  --datamachine-day-saturday: #54a0ff;
  --datamachine-day-saturday-rgb: 84, 160, 255;
  --datamachine-day-saturday-rgba: rgba(84, 160, 255, 0.15);

  /* ====================================
   * CARD INTERACTIVITY
   * ==================================== */
  --datamachine-card-hover-border: rgba(59, 130, 246, 0.3); /* Soft blue border on hover */
  --datamachine-card-hover-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --datamachine-card-transition: all 0.2s ease;
  --datamachine-card-focus-outline: 2px solid rgba(59, 130, 246, 0.5);
  
  /* ====================================
   * BORDER & VISUAL STYLING
   * ==================================== */
  --datamachine-border-width: 1px; /* Reduced from 2px */
  --datamachine-border-radius: 8px;
  --datamachine-border-opacity: 0.3; /* Reduced from 0.8 */

  /* ====================================
   * SPACING & TYPOGRAPHY
   * ==================================== */
  --datamachine-card-padding: 0.9rem;
  --datamachine-filter-gap: 1rem;
  
  /* ====================================
   * COLORS & THEME
   * ==================================== */
  --datamachine-background-light: #f8fafc;
  --datamachine-background-primary: #ffffff;
  --datamachine-background-secondary: #f9fafb;
  --datamachine-background-hover: #f3f4f6;
  --datamachine-border-light: #e2e8f0;
  --datamachine-border-hover: #d1d5db;
  
  /* Adaptive text colors for theme compatibility */
  --datamachine-text-primary: #111827;
  --datamachine-text-secondary: #6b7280;
  --datamachine-text-muted: #9ca3af;
  --datamachine-text-accent: #3b82f6;
  --datamachine-border-default: #d1d5db;
  --datamachine-border-focus: #3b82f6;

  /* ====================================
   * DAY BADGE STYLING
   * ==================================== */
  --datamachine-badge-font-size: 0.75rem;
  --datamachine-badge-font-weight: 600;
  --datamachine-badge-padding-x: 0.75rem;
  --datamachine-badge-padding-y: 0.25rem;
  --datamachine-badge-border-radius: 999px;
  --datamachine-badge-offset-x: 12px;
  --datamachine-badge-offset-y: -6px;
  --datamachine-badge-z-index: 15;
  --datamachine-badge-backdrop-blur: 4px;
  --datamachine-badge-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);

  /* ====================================
   * TAXONOMY BADGE STYLING
   * ==================================== */
  --datamachine-taxonomy-badge-font-size: 0.75rem;
  --datamachine-taxonomy-badge-font-weight: 500;
  --datamachine-taxonomy-badge-padding-x: 0.5rem;
  --datamachine-taxonomy-badge-padding-y: 0.25rem;
  --datamachine-taxonomy-badge-border-radius: 12px;
  --datamachine-taxonomy-badge-gap: 0.375rem;
  --datamachine-taxonomy-badge-margin-bottom: 0.5rem;
  --datamachine-taxonomy-badge-background: #e5e7eb;
  --datamachine-taxonomy-badge-color: #374151;
  --datamachine-taxonomy-badge-hover-background: #d1d5db;

  /* ====================================
   * CAROUSEL SCROLL INDICATORS
   * ==================================== */
  --datamachine-scroll-gradient-size: 40px;
  --datamachine-scroll-gradient-opacity: 0.8;
  --datamachine-scroll-gradient-color: rgba(255, 255, 255, 0.95);
  --datamachine-scroll-gradient-transition: opacity 0.3s ease;
}

/* Dark mode adaptations using system preference */
@media (prefers-color-scheme: dark) {
  :root {
    /* Adaptive text colors for dark themes */
    --datamachine-text-primary: #f9fafb;
    --datamachine-text-secondary: #d1d5db;
    --datamachine-text-muted: #9ca3af;
    --datamachine-text-accent: #60a5fa;
    --datamachine-border-default: #4b5563;
    --datamachine-border-focus: #60a5fa;
    
    /* Dark theme backgrounds */
    --datamachine-background-light: #1f2937;
    --datamachine-background-primary: #1f2937;
    --datamachine-background-secondary: #111827;
    --datamachine-background-hover: #374151;
    --datamachine-border-light: #374151;
    --datamachine-border-hover: #4b5563;
    
    /* Dark theme taxonomy badges */
    --datamachine-taxonomy-badge-background: #374151;
    --datamachine-taxonomy-badge-color: #d1d5db;
    --datamachine-taxonomy-badge-hover-background: #4b5563;

    /* Dark theme carousel scroll indicators */
    --datamachine-scroll-gradient-color: rgba(31, 41, 55, 0.95);
  }
}

/* ====================================
 * TAXONOMY BADGE STYLES
 * Moved from calendar/style.css for universal availability
 * ==================================== */

/* Taxonomy Badge Styles */
.datamachine-taxonomy-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--datamachine-taxonomy-badge-gap);
    margin-bottom: var(--datamachine-taxonomy-badge-margin-bottom);
}

.datamachine-taxonomy-badge {
    display: inline-flex;
    align-items: center;
    font-size: var(--datamachine-taxonomy-badge-font-size);
    font-weight: var(--datamachine-taxonomy-badge-font-weight);
    padding: var(--datamachine-taxonomy-badge-padding-y) var(--datamachine-taxonomy-badge-padding-x);
    border-radius: var(--datamachine-taxonomy-badge-border-radius);
    background: var(--datamachine-taxonomy-badge-background);
    color: var(--datamachine-taxonomy-badge-color);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1;
}

.datamachine-taxonomy-badge:hover {
    background: var(--datamachine-taxonomy-badge-hover-background);
    transform: translateY(-1px);
}

/* Custom badge colors for different taxonomies */
.datamachine-badge-blue { background: #dbeafe; color: #1e40af; }
.datamachine-badge-green { background: #dcfce7; color: #166534; }
.datamachine-badge-purple { background: #f3e8ff; color: #7c3aed; }
.datamachine-badge-orange { background: #fed7aa; color: #c2410c; }
.datamachine-badge-red { background: #fee2e2; color: #dc2626; }
.datamachine-badge-teal { background: #ccfbf1; color: #0f766e; }
.datamachine-badge-pink { background: #fce7f3; color: #be185d; }
.datamachine-badge-yellow { background: #fef3c7; color: #a16207; }
.datamachine-badge-indigo { background: #e0e7ff; color: #4338ca; }
.datamachine-badge-gray { background: #f3f4f6; color: #374151; }

/* Custom taxonomy-specific styles - users can override these */
.datamachine-taxonomy-category { background: #dbeafe; color: #1e40af; }
.datamachine-taxonomy-post_tag { background: #dcfce7; color: #166534; }
.datamachine-taxonomy-genre { background: #f3e8ff; color: #7c3aed; }
.datamachine-taxonomy-artist_type { background: #fed7aa; color: #c2410c; }