.pattern-visualizer {
  padding: 16px;
  background: white;
  border-radius: 8px;
  
  .empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
  }
  
  .visualizer-container {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 20px;
    
    @media (max-width: 768px) {
      grid-template-columns: 1fr;
    }
    
    .pattern-preview {
      position: relative;
      
      .preview-image {
        position: relative;
        width: 200px;
        height: 200px;
        border-radius: 8px;
        overflow: hidden;
        background: #f0f0f0;
        margin-bottom: 12px;
        
        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
        
        .direction-indicator {
          position: absolute;
          top: 50%;
          left: 50%;
          transform-origin: center center;
          pointer-events: none;
          filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
          
          svg {
            display: block;
            margin-left: -20px;
            margin-top: -20px;
          }
        }
        
        .radial-indicator {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          pointer-events: none;
          filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
        }
      }
      
      .pattern-type-badge {
        display: inline-block;
        padding: 6px 12px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
      }
    }
    
    .detailed-analysis {
      display: flex;
      flex-direction: column;
      gap: 16px;
      
      .analysis-section {
        padding: 12px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
        
        h6 {
          display: flex;
          align-items: center;
          gap: 6px;
          margin: 0 0 10px 0;
          font-size: 13px;
          font-weight: 600;
          color: #333;
          
          svg {
            width: 16px;
            height: 16px;
            stroke: #007AFF;
          }
        }
        
        .section-content {
          .repetition-info {
            display: flex;
            flex-direction: column;
            gap: 10px;
            
            .info-item {
              display: flex;
              align-items: center;
              gap: 10px;
              
              .label {
                min-width: 50px;
                font-size: 11px;
                color: #666;
              }
              
              .progress-bar {
                flex: 1;
                height: 6px;
                background: #e0e0e0;
                border-radius: 3px;
                overflow: hidden;
                
                .progress-fill {
                  height: 100%;
                  background: linear-gradient(90deg, #007AFF 0%, #0051D5 100%);
                  transition: width 0.3s ease;
                }
              }
              
              .value {
                min-width: 40px;
                text-align: right;
                font-size: 11px;
                font-weight: 600;
                color: #333;
              }
            }
            
            .repetition-visual {
              display: flex;
              gap: 8px;
              margin-top: 8px;
              
              .repeat-unit {
                width: 30px;
                height: 30px;
                background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
                border-radius: 4px;
                animation: pulse 2s ease-in-out infinite;
                
                &:nth-child(2) { animation-delay: 0.2s; }
                &:nth-child(3) { animation-delay: 0.4s; }
                &:nth-child(4) { animation-delay: 0.6s; }
                &:nth-child(5) { animation-delay: 0.8s; }
              }
            }
          }
          
          .no-repetition {
            margin: 0;
            font-size: 12px;
            color: #999;
            font-style: italic;
          }
          
          .direction-info {
            display: flex;
            align-items: center;
            gap: 10px;
            
            .direction-badge {
              padding: 4px 12px;
              background: rgba(0, 122, 255, 0.1);
              color: #007AFF;
              border-radius: 4px;
              font-size: 12px;
              font-weight: 600;
            }
            
            .angle-value {
              font-size: 12px;
              color: #666;
              font-family: monospace;
            }
          }
          
          .density-info {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 10px;
            
            .density-badge {
              padding: 4px 12px;
              border-radius: 4px;
              font-size: 12px;
              font-weight: 600;
            }
            
            .density-percentage {
              font-size: 12px;
              color: #666;
            }
          }
          
          .density-grid {
            display: flex;
            flex-direction: column;
            gap: 2px;
            
            .grid-row {
              display: flex;
              gap: 2px;
              
              .grid-cell {
                width: 12px;
                height: 12px;
                background: #e0e0e0;
                border-radius: 2px;
                transition: background 0.3s ease;
                
                &.filled {
                  background: #007AFF;
                }
              }
            }
          }
          
          .complexity-info {
            display: flex;
            align-items: center;
            gap: 10px;
            
            .complexity-badge {
              padding: 4px 12px;
              border-radius: 4px;
              font-size: 12px;
              font-weight: 600;
            }
            
            .element-count {
              font-size: 12px;
              color: #666;
            }
          }
          
          .color-variety-info {
            .variety-count {
              display: inline-block;
              margin-bottom: 10px;
              font-size: 12px;
              font-weight: 600;
              color: #333;
            }
            
            .dominant-colors {
              display: flex;
              flex-wrap: wrap;
              gap: 8px;
              
              .color-item {
                display: flex;
                align-items: center;
                gap: 6px;
                padding: 4px 8px;
                background: white;
                border-radius: 6px;
                border: 1px solid #e0e0e0;
                
                .color-swatch {
                  width: 20px;
                  height: 20px;
                  border-radius: 4px;
                  border: 1px solid rgba(0, 0, 0, 0.1);
                }
                
                .color-percentage {
                  font-size: 11px;
                  color: #666;
                }
              }
            }
          }
        }
      }
    }
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(0.95);
  }
}

