/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f7fa;
  color: #2d3748;
  height: 100vh;
  overflow: hidden;
}

/* App layout */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.header {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: none;
}

.header-title {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: #1a365d;
}

.logo {
  font-size: 2rem;
  margin-right: 0.75rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-container {
  position: relative;
}

.search-input {
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  width: 250px;
  background: #f7fafc;
}

.search-input:focus {
  outline: none;
  border-color: #4299e1;
  background: #fff;
}

.search-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #a0aec0;
}

/* Main content */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #fff;
  border-right: 1px solid #e2e8f0;
  overflow-y: auto;
}

.nav {
  padding: 1.5rem 0;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #718096;
  margin: 0 1.5rem 1rem;
}

.nav-list {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: #f7fafc;
}

.nav-item.active {
  background: #ebf8ff;
  border-left-color: #4299e1;
  color: #2b6cb0;
}

.nav-icon {
  font-size: 1.25rem;
  margin-right: 0.75rem;
  width: 1.5rem;
  text-align: center;
}

.nav-label {
  font-weight: 500;
}

/* Content area */
.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: #f5f7fa;
}

.demo-content {
  background: #fff;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-height: calc(100vh - 8rem);
}

/* Demo sections */
.demo-section {
  margin-bottom: 3rem;
}

.demo-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
}

.demo-icon {
  font-size: 2rem;
  margin-right: 1rem;
}

.demo-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #1a365d;
}

.demo-description {
  color: #718096;
  margin-top: 0.25rem;
  font-size: 1rem;
}

.demo-controls {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-label {
  font-weight: 500;
  min-width: 80px;
}

.control-input {
  padding: 0.5rem;
  border: 1px solid #cbd5e0;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  width: 100px;
}

.control-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-results {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1.5rem;
}

.results-header {
  font-weight: 600;
  margin-bottom: 1rem;
  color: #2d3748;
}

.window-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.window-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
}

.window-preview {
  width: 100%;
  height: 80px;
  background: #edf2f7;
  border-radius: 0.25rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #718096;
  font-size: 0.875rem;
}

.window-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: #4299e1;
  color: #fff;
}

.btn-primary:hover {
  background: #3182ce;
}

.btn-secondary {
  background: #edf2f7;
  color: #4a5568;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #f56565;
  color: #fff;
}

.btn-danger:hover {
  background: #e53e3e;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

/* Event log */
.event-log {
  position: fixed;
  top: 0;
  right: -350px;
  width: 350px;
  height: 100vh;
  background: #fff;
  border-left: 1px solid #e2e8f0;
  transition: right 0.3s ease;
  z-index: 200;
  display: flex;
  flex-direction: column;
}

.event-log.open {
  right: 0;
}

.event-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f7fafc;
}

.event-log-toggle {
  position: absolute;
  left: -40px;
  top: 1rem;
  background: #4299e1;
  color: #fff;
  border: none;
  padding: 0.5rem;
  border-radius: 0.25rem 0 0 0.25rem;
  cursor: pointer;
  font-size: 1rem;
}

.event-log-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-log-filters {
  padding: 1rem;
  background: #f7fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.event-log-filters label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
}

.event-log-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.event-entry {
  background: #f8fafc;
  border-left: 3px solid #cbd5e0;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: 0 0.25rem 0.25rem 0;
  font-size: 0.875rem;
}

.event-entry.info {
  border-left-color: #4299e1;
}

.event-entry.warn {
  border-left-color: #ed8936;
}

.event-entry.error {
  border-left-color: #f56565;
}

.event-time {
  color: #718096;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.event-message {
  color: #2d3748;
}

/* Toast notifications */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #fff;
  border-left: 4px solid #4299e1;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  min-width: 300px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left-color: #48bb78;
}

.toast.error {
  border-left-color: #f56565;
}

.toast.warning {
  border-left-color: #ed8936;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Progress bar */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.progress-fill {
  height: 100%;
  background: #4299e1;
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Code blocks */
.code-block {
  background: #1a202c;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 0.5rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
  }
  
  .content {
    padding: 1rem;
  }
  
  .header-content {
    padding: 1rem;
  }
  
  .search-input {
    width: 150px;
  }
}

/* Hidden class */
.hidden {
  display: none !important;
}