/**
 * HCL Studio Demo Styles
 * Showcases dynamic theming using CSS custom properties
 */

.hcl-studio-demo {
  padding: 2rem;
  background: var(--color-surface);
  color: var(--color-on-surface);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

// ==========================================================================
// HEADER STYLES
// ==========================================================================

.demo-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--color-surface-container);
  border-radius: 1rem;
  
  h1 {
    margin: 0 0 0.5rem 0;
    color: var(--color-primary);
    font-size: 2.5rem;
    font-weight: 600;
  }
  
  p {
    margin: 0;
    color: var(--color-on-surface-variant);
    font-size: 1.2rem;
  }
}

// ==========================================================================
// CURRENT THEME INFO
// ==========================================================================

.current-theme-info {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--color-surface-high);
  border-radius: 0.5rem;
  border: 1px solid var(--color-outline-variant);
  
  h3 {
    margin: 0 0 1rem 0;
    color: var(--color-on-surface);
  }
  
  .color-swatches {
    display: flex;
    gap: 1rem;
    
    .swatch {
      flex: 1;
      padding: 1rem;
      border-radius: 0.5rem;
      text-align: center;
      color: white;
      font-weight: 600;
      text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
      
      span {
        font-size: 0.9rem;
      }
    }
  }
}

// ==========================================================================
// MODE CONTROLS
// ==========================================================================

.mode-controls {
  margin-bottom: 2rem;
  text-align: center;
  
  .mode-toggle-btn {
    padding: 0.75rem 2rem;
    border: 2px solid var(--color-outline);
    border-radius: 2rem;
    background: var(--color-surface);
    color: var(--color-on-surface);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    
    &:hover {
      background: var(--color-surface-high);
      border-color: var(--color-primary);
    }
    
    &.dark {
      background: var(--color-primary);
      color: var(--color-on-primary);
      border-color: var(--color-primary);
    }
  }
}

// ==========================================================================
// THEMES SECTION
// ==========================================================================

.themes-section {
  margin-bottom: 3rem;
  
  h3 {
    margin: 0 0 1.5rem 0;
    color: var(--color-on-surface);
    font-size: 1.5rem;
  }
  
  .theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    
    .theme-card {
      padding: 1rem;
      background: var(--color-surface-container);
      border: 2px solid var(--color-outline-variant);
      border-radius: 0.75rem;
      cursor: pointer;
      transition: all 0.3s ease;
      
      &:hover {
        border-color: var(--color-primary);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      }
      
      &.active {
        border-color: var(--color-primary);
        background: var(--color-primary-container);
        
        .theme-name {
          color: var(--color-on-primary-container);
          font-weight: 600;
        }
      }
      
      .theme-preview {
        display: flex;
        height: 40px;
        border-radius: 0.5rem;
        overflow: hidden;
        margin-bottom: 0.75rem;
        
        .color-strip {
          flex: 1;
        }
      }
      
      .theme-name {
        display: block;
        text-align: center;
        color: var(--color-on-surface);
        font-size: 0.9rem;
        font-weight: 500;
      }
    }
  }
}

// ==========================================================================
// CUSTOM THEME SECTION
// ==========================================================================

.custom-theme-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--color-surface-high);
  border-radius: 1rem;
  border: 1px solid var(--color-outline-variant);
  
  h3 {
    margin: 0 0 1.5rem 0;
    color: var(--color-on-surface);
    font-size: 1.5rem;
  }
  
  .custom-inputs {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
    
    @media (min-width: 768px) {
      grid-template-columns: repeat(3, 1fr);
    }
    
    .color-input-group {
      label {
        display: block;
        margin-bottom: 0.5rem;
        color: var(--color-on-surface);
        font-weight: 600;
        font-size: 0.9rem;
      }
      
      input[type="color"] {
        width: 50px;
        height: 40px;
        border: 2px solid var(--color-outline);
        border-radius: 0.5rem;
        margin-right: 0.5rem;
        cursor: pointer;
      }
      
      input[type="text"] {
        flex: 1;
        padding: 0.75rem;
        border: 2px solid var(--color-outline);
        border-radius: 0.5rem;
        background: var(--color-surface);
        color: var(--color-on-surface);
        font-size: 1rem;
        
        &:focus {
          outline: none;
          border-color: var(--color-primary);
        }
      }
    }
  }
  
  .custom-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    
    button {
      padding: 0.75rem 1.5rem;
      border-radius: 0.5rem;
      font-size: 1rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      
      &.preview-btn {
        background: var(--color-secondary);
        color: var(--color-on-secondary);
        border: none;
        
        &:hover {
          opacity: 0.9;
          transform: translateY(-1px);
        }
      }
      
      &.apply-btn {
        background: var(--color-primary);
        color: var(--color-on-primary);
        border: none;
        
        &:hover {
          opacity: 0.9;
          transform: translateY(-1px);
        }
      }
    }
  }
  
  .color-preview {
    h4 {
      margin: 0 0 1rem 0;
      color: var(--color-on-surface);
    }
    
    .preview-swatches {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
      gap: 0.5rem;
      
      .preview-swatch {
        padding: 0.75rem 0.5rem;
        border-radius: 0.5rem;
        text-align: center;
        font-size: 0.8rem;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
      }
    }
  }
}

// ==========================================================================
// DEMO COMPONENTS
// ==========================================================================

.demo-components {
  h3 {
    margin: 0 0 1.5rem 0;
    color: var(--color-on-surface);
    font-size: 1.5rem;
  }
  
  .component-showcase {
    display: grid;
    gap: 2rem;
    
    @media (min-width: 768px) {
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .showcase-section {
      padding: 1.5rem;
      background: var(--color-surface-container);
      border-radius: 0.75rem;
      border: 1px solid var(--color-outline-variant);
      
      h4 {
        margin: 0 0 1rem 0;
        color: var(--color-on-surface);
        font-size: 1.2rem;
      }
      
      // Button Styles
      .button-group {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        
        button {
          padding: 0.75rem 1.5rem;
          border-radius: 0.5rem;
          font-size: 1rem;
          font-weight: 600;
          cursor: pointer;
          border: none;
          transition: all 0.3s ease;
          
          &.btn-primary {
            background: var(--color-primary);
            color: var(--color-on-primary);
            
            &:hover {
              opacity: 0.9;
              transform: translateY(-1px);
            }
          }
          
          &.btn-secondary {
            background: var(--color-secondary);
            color: var(--color-on-secondary);
            
            &:hover {
              opacity: 0.9;
              transform: translateY(-1px);
            }
          }
          
          &.btn-tertiary {
            background: var(--color-tertiary);
            color: var(--color-on-tertiary);
            
            &:hover {
              opacity: 0.9;
              transform: translateY(-1px);
            }
          }
        }
      }
      
      // Card Styles
      .card-group {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        
        .demo-card {
          padding: 1.5rem;
          border-radius: 0.5rem;
          
          &.primary {
            background: var(--color-primary-container);
            color: var(--color-on-primary-container);
          }
          
          &.secondary {
            background: var(--color-secondary-container);
            color: var(--color-on-secondary-container);
          }
          
          h5 {
            margin: 0 0 0.5rem 0;
            font-size: 1.1rem;
          }
          
          p {
            margin: 0;
            opacity: 0.8;
          }
        }
      }
      
      // Surface Styles
      .surface-group {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        
        .demo-surface {
          padding: 1rem;
          border-radius: 0.5rem;
          text-align: center;
          font-weight: 600;
          
          &.surface-low {
            background: var(--color-surface-low);
            color: var(--color-on-surface);
          }
          
          &.surface-container {
            background: var(--color-surface-container);
            color: var(--color-on-surface);
          }
          
          &.surface-high {
            background: var(--color-surface-high);
            color: var(--color-on-surface);
          }
        }
      }
    }
  }
}

// ==========================================================================
// RESPONSIVE ADJUSTMENTS
// ==========================================================================

@media (max-width: 768px) {
  .hcl-studio-demo {
    padding: 1rem;
  }
  
  .demo-header {
    padding: 1.5rem;
    
    h1 {
      font-size: 2rem;
    }
    
    p {
      font-size: 1rem;
    }
  }
  
  .theme-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .custom-inputs {
    grid-template-columns: 1fr !important;
  }
  
  .custom-actions {
    flex-direction: column;
  }
}

// ==========================================================================
// TRANSITIONS FOR SMOOTH THEME CHANGES
// ==========================================================================

* {
  transition: background-color 0.3s ease, 
              color 0.3s ease, 
              border-color 0.3s ease,
              opacity 0.3s ease;
}