@use 'ui-design-system/src/styles' as ui;

.backgrounds-demo {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  
  .demo-header {
    text-align: center;
    margin-bottom: 3rem;
    
    h1 {
      font-size: 3rem;
      font-weight: 700;
      color: var(--primary-900, #1e293b);
      margin-bottom: 1rem;
    }
    
    p {
      font-size: 1.2rem;
      color: var(--neutral-600, #64748b);
    }
  }
  
  .demo-section {
    margin-bottom: 4rem;
    
    h2 {
      font-size: 2rem;
      font-weight: 600;
      color: var(--primary-800, #334155);
      margin-bottom: 2rem;
      border-bottom: 2px solid var(--primary-200, #e2e8f0);
      padding-bottom: 0.5rem;
    }
  }
  
  .example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
  }
  
  .demo-card {
    padding: 2rem;
    border-radius: 1rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    }
    
    h3 {
      font-size: 1.5rem;
      font-weight: 600;
      margin-bottom: 1rem;
    }
    
    p {
      font-size: 1rem;
      opacity: 0.9;
      line-height: 1.5;
    }
  }
  
  .pattern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .pattern-demo {
    aspect-ratio: 1;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    
    &:hover {
      transform: scale(1.05);
    }
    
    .pattern-name {
      background: rgba(0, 0, 0, 0.7);
      color: white;
      padding: 0.5rem 1rem;
      border-radius: 0.25rem;
      font-size: 0.875rem;
      font-weight: 500;
      text-transform: capitalize;
    }
  }
  
  .gradient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
  }
  
  .gradient-demo {
    aspect-ratio: 16/9;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    
    &:hover {
      transform: translateY(-3px);
    }
  }
  
  .interactive-demo {
    padding: 3rem;
    border-radius: 1rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: all 0.5s ease;
    
    .controls {
      display: flex;
      gap: 1rem;
      margin-bottom: 2rem;
      flex-wrap: wrap;
      justify-content: center;
    }
    
    h3 {
      font-size: 2rem;
      margin-bottom: 1rem;
    }
    
    p {
      font-size: 1.1rem;
      opacity: 0.9;
    }
  }
  
  .fullscreen-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  
  .action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    }
    
    &:active {
      transform: translateY(0);
    }
  }
  
  .preset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: var(--primary-700, #475569);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    
    &:hover {
      background: rgba(255, 255, 255, 0.2);
      border-color: rgba(255, 255, 255, 0.4);
      transform: translateY(-1px);
    }
    
    &:active {
      transform: translateY(0);
    }
  }
}

// Responsive adjustments
@media (max-width: 768px) {
  .backgrounds-demo {
    padding: 1rem;
    
    .demo-header h1 {
      font-size: 2rem;
    }
    
    .example-grid {
      grid-template-columns: 1fr;
    }
    
    .pattern-grid {
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .gradient-grid {
      grid-template-columns: 1fr;
    }
    
    .interactive-demo {
      padding: 2rem;
      
      .controls {
        flex-direction: column;
        width: 100%;
      }
    }
    
    .fullscreen-controls {
      flex-direction: column;
    }
  }
}

// Dark mode support
@media (prefers-color-scheme: dark) {
  .backgrounds-demo {
    .demo-header h1 {
      color: var(--neutral-100, #f8fafc);
    }
    
    .demo-section h2 {
      color: var(--neutral-200, #e2e8f0);
      border-bottom-color: var(--primary-700, #475569);
    }
    
    .preset-btn {
      color: var(--neutral-200, #e2e8f0);
    }
  }
}

// High contrast mode
@media (prefers-contrast: high) {
  .backgrounds-demo {
    .demo-card,
    .pattern-demo,
    .gradient-demo,
    .interactive-demo {
      border: 2px solid rgba(0, 0, 0, 0.8);
    }
  }
}

// Reduced motion
@media (prefers-reduced-motion: reduce) {
  .backgrounds-demo {
    * {
      transition: none !important;
      animation: none !important;
    }
  }
}