.demo-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.demo-description {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.demo-section {
  margin: 3rem 0;
  padding: 2rem;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: #fafafa;
  
  h2, h3 {
    margin-top: 0;
    color: #333;
  }
  
  h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

// Loading State Display
.state-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.state-item {
  padding: 1rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #2196F3;
  
  strong {
    color: #333;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .loading {
    color: #FF9800;
    font-weight: 500;
  }
  
  .idle {
    color: #4CAF50;
    font-weight: 500;
  }
}

// Manual Font Controls
.font-controls {
  margin-top: 1rem;
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.font-button {
  position: relative;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  
  &:hover {
    border-color: #2196F3;
    background: #f5f5f5;
  }
  
  &.loaded {
    border-color: #4CAF50;
    background: #e8f5e8;
    color: #2e7d32;
    font-weight: 500;
  }
}

.load-status {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  color: #4CAF50;
  font-weight: bold;
}

// Transition Controls
.transition-controls {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.transition-btn {
  padding: 1rem;
  border: 2px solid #2196F3;
  border-radius: 8px;
  background: white;
  color: #2196F3;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  
  &:hover {
    background: #2196F3;
    color: white;
  }
  
  &.scale {
    border-color: #FF9800;
    color: #FF9800;
    
    &:hover {
      background: #FF9800;
      color: white;
    }
  }
  
  &.typewriter {
    border-color: #9C27B0;
    color: #9C27B0;
    
    &:hover {
      background: #9C27B0;
      color: white;
    }
  }
}

// Typography Showcase
.typography-showcase {
  display: grid;
  gap: 2rem;
  margin-top: 1.5rem;
}

.type-sample {
  padding: 2rem;
  background: white;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s ease;
  
  h1, h2, h3, h4 {
    margin: 0 0 1rem 0;
    line-height: 1.3;
  }
  
  h1 {
    font-size: 2.5rem;
    font-weight: 700;
  }
  
  h2 {
    font-size: 2rem;
    font-weight: 600;
  }
  
  h3 {
    font-size: 1.75rem;
    font-weight: 500;
  }
  
  h4 {
    font-size: 1.5rem;
    font-weight: 500;
  }
  
  p {
    line-height: 1.6;
    margin-bottom: 1rem;
  }
  
  pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    
    code {
      font-size: 0.9rem;
      line-height: 1.5;
    }
  }
}

.font-info {
  font-size: 0.8rem;
  color: #666;
  font-style: italic;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

// Available Themes
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.theme-card {
  padding: 1.5rem;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  transition: all 0.3s ease;
  
  &:hover {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.1);
  }
  
  h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    font-size: 1.1rem;
  }
}

.theme-description {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.theme-fonts {
  margin-bottom: 1.5rem;
}

.theme-font {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  
  strong {
    color: #333;
    min-width: 60px;
  }
  
  & + .theme-font {
    border-top: 1px solid #f0f0f0;
  }
}

.apply-theme-btn {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #2196F3;
  border-radius: 6px;
  background: #2196F3;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  
  &:hover {
    background: #1976D2;
    border-color: #1976D2;
  }
}

// Event Log
.event-log {
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
}

.event-item {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #f0f0f0;
  
  &:last-child {
    border-bottom: none;
  }
  
  &.success {
    color: #4CAF50;
  }
  
  &.error {
    color: #f44336;
  }
  
  &.info {
    color: #2196F3;
  }
}

.event-time {
  color: #666;
  font-size: 0.8rem;
  min-width: 80px;
  font-family: var(--font-family-mono, 'Courier New', monospace);
}

.event-message {
  flex: 1;
}

// Font Preset Controls
.preset-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.preset-selector {
  label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
  }

  select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s ease;

    &:focus {
      outline: none;
      border-color: #2196F3;
    }

    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }
  }
}

.transition-selector {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;

  label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    display: block;
  }

  select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 120px;
  }
}

.apply-btn {
  padding: 0.75rem 1.5rem;
  background: #2196F3;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;

  &:hover:not(:disabled) {
    background: #1976D2;
    transform: translateY(-2px);
  }

  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
  }
}

// Current Preset Display
.current-preset {
  margin-top: 2rem;
  padding: 1.5rem;
  background: #e8f5e8;
  border: 1px solid #4CAF50;
  border-radius: 12px;

  h4 {
    margin: 0 0 1rem 0;
    color: #2e7d32;
    font-size: 1.1rem;
  }
}

.preset-fonts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
}

.font-assignment {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  font-size: 0.9rem;

  .font-type {
    font-weight: 600;
    color: #333;
  }

  .font-name {
    color: #666;
    font-style: italic;
  }
}

// Theme card active state
.theme-card.active {
  border-color: #4CAF50;
  background: #f1f8e9;
  
  h4 {
    color: #2e7d32;
  }
}

// Section descriptions
.preset-description,
.preview-description,
.section-description {
  color: #666;
  font-size: 1rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

// Font transition animations
:global(html.font-transition-fade) {
  * {
    transition: font-family 0.8s ease-in-out;
  }
}

:global(html.font-transition-scale) {
  * {
    transition: font-family 0.6s ease-in-out, transform 0.6s ease-in-out;
  }
  
  body {
    transform: scale(1.02);
    transition: transform 0.3s ease-in-out;
  }
  
  &.font-transition-scale body {
    transform: scale(1);
  }
}

:global(html.font-transition-typewriter) {
  * {
    transition: font-family 0.5s steps(10, end);
  }
}

// Enhanced blockquote styling
blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 4px solid #2196F3;
  background: #f8f9fa;
  font-style: italic;
  position: relative;

  &::before {
    content: '"';
    font-size: 3rem;
    color: #2196F3;
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    opacity: 0.3;
  }
}

// Responsive Design
@media (max-width: 768px) {
  .demo-container {
    padding: 1rem;
  }
  
  .demo-section {
    padding: 1.5rem;
  }
  
  .font-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  
  .transition-controls {
    grid-template-columns: 1fr;
  }
  
  .themes-grid {
    grid-template-columns: 1fr;
  }
  
  .state-info {
    grid-template-columns: 1fr;
  }
  
  .type-sample {
    padding: 1.5rem;
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
  }

  .preset-controls {
    gap: 1rem;
  }

  .transition-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;

    select,
    .apply-btn {
      width: 100%;
    }
  }

  .preset-fonts {
    grid-template-columns: 1fr;
  }
}