/* Interactive Demo Section Styles */
.demo-container {
  position: relative;
  width: 100%;
  height: 500px;
  margin: 2rem auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

#webdemo-container {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: grab;
}

#webdemo-container:active {
  cursor: grabbing;
}

.demo-controls {
  margin-bottom: 2rem;
}

.demo-controls .field {
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.demo-controls .model-btn {
  min-width: 140px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.5;
  height: 50px;
  border-radius: 8px;
  border: 2px solid #dbdbdb;
  transition: all 0.3s ease;
  box-sizing: border-box;
  position: relative;
  overflow: hidden;
}

.demo-controls .model-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.demo-controls .model-btn.is-primary {
  background-color: #3273dc;
  border-color: #3273dc;
  color: #fff;
}

.demo-controls .model-btn.is-primary:hover {
  background-color: #2366d1;
  border-color: #2366d1;
}

.demo-controls .model-btn.is-light {
  background-color: #f5f5f5;
  border-color: #dbdbdb;
  color: #363636;
}

.demo-controls .model-btn.is-light:hover {
  background-color: #eeeeee;
  border-color: #b5b5b5;
}

.demo-controls .model-btn.current-model::after {
  content: "Current Model";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  opacity: 0.8;
  font-weight: 500;
}



.demo-instructions {
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.demo-instructions .notification {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.demo-instructions ul {
  list-style: none;
  padding-left: 0;
}

.demo-instructions li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.demo-instructions li:last-child {
  border-bottom: none;
}

#demo-status {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  max-width: 90%;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

#demo-status.loading {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* Loading Animation */
.demo-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: 500;
  z-index: 999;
}

.demo-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Interactive Demo Section Header */
#interactive-demo .title {
  color: #363636;
  font-weight: 700;
  margin-bottom: 1rem;
}

#interactive-demo .subtitle {
  color: #fa4a4a;
  font-size: 1.25rem;
  line-height: 1.4;
  margin-bottom: 2rem;
}

#interactive-demo .dnerf {
  color: #3273dc;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Error States */
.demo-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ff3860;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  z-index: 999;
  background: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  max-width: 80%;
}

/* Accessibility Improvements */
.demo-controls .button:focus,
.demo-controls .select select:focus {
  outline: 2px solid #3273dc;
  outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
  .demo-container {
    border: 3px solid #000;
    background: #fff;
  }
  
  #demo-status {
    background: #000;
    color: #fff;
    border: 2px solid #fff;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .demo-controls .button,
  .demo-controls .select select,
  #demo-status {
    transition: none;
  }
  
  .demo-controls .button:hover {
    transform: none;
  }
  
  @keyframes pulse {
    0%, 100% { opacity: 1; }
  }
  
  @keyframes spin {
    to { transform: none; }
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .demo-container {
    height: 400px;
    margin: 1rem auto;
    border-radius: 8px;
  }
  
  .demo-controls {
    margin-bottom: 1.5rem;
  }
  
  .demo-controls .field {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .demo-controls .model-btn {
    width: 100%;
    max-width: 280px;
    min-width: 100%;
    padding: 1rem;
    font-size: 1rem;
    line-height: 1.5;
    height: 56px;
  }
  
  .demo-controls .button {
    height: 56px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  
  .demo-instructions {
    margin-top: 1.5rem;
  }
  
  .demo-instructions .notification {
    margin: 0 1rem;
  }
  
  #demo-status {
    top: 10px;
    padding: 8px 16px;
    font-size: 12px;
    max-width: 95%;
  }
  
  #interactive-demo .title {
    font-size: 1.75rem;
  }
  
  #interactive-demo .subtitle {
    font-size: 1.1rem;
  }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
  .demo-container {
    height: 450px;
  }
  
  .demo-controls .field {
    gap: 1.5rem;
  }
}

/* Large Screen Optimizations */
@media (min-width: 1408px) {
  .demo-container {
    height: 600px;
  }
  
  .demo-controls .button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
  
  .demo-controls .select select {
    padding: 1rem;
    font-size: 1.1rem;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .demo-instructions .notification.is-info.is-light {
    background-color: rgba(54, 54, 54, 0.8);
    color: #fff;
  }
  
  .demo-instructions .notification.is-info.is-light p,
  .demo-instructions .notification.is-info.is-light li {
    color: #fff;
  }
  
  .demo-instructions li {
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }
  
  #interactive-demo .title {
    color: #363636;
  }
  
  #interactive-demo .subtitle {
    color: #363636;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .demo-controls .button:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .demo-controls .button:active {
    transform: scale(0.98);
  }
  
  #webdemo-container {
    cursor: default;
  }
}

/* Print Styles */
@media print {
  #interactive-demo {
    display: none;
  }
}