* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.screen {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Onboarding */
#onboarding {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.onboarding-content {
  max-width: 600px;
  padding: 2rem;
  text-align: center;
}

.onboarding-content h1 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.onboarding-steps {
  margin: 2rem 0;
}

.step {
  display: none;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.step.active {
  display: block;
  animation: fadeIn 0.3s;
}

.step h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.onboarding-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

/* Main App */
header {
  background: #2196F3;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.5rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

#versions {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  opacity: 0.9;
}

.status-indicator {
  font-size: 1.2rem;
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6rem 1rem 2rem;
}

.card {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.card h2 {
  margin-bottom: 1rem;
  color: #2196F3;
}

.card h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.1rem;
  color: #555;
}

.feature-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.feature-group:last-child {
  border-bottom: none;
}

/* Buttons */
button {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0.25rem;
  background: #f0f0f0;
  color: #333;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

button:active {
  transform: translateY(0);
}

button.primary {
  background: #2196F3;
  color: white;
}

button.primary:hover {
  background: #1976D2;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Logs */
#logs {
  max-height: 300px;
  overflow-y: auto;
  background: #f9f9f9;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.log-entry {
  padding: 0.25rem 0;
  border-bottom: 1px solid #eee;
}

.log-entry:last-child {
  border-bottom: none;
}

/* File Input */
input[type="file"] {
  display: block;
  margin: 0.5rem 0;
  padding: 0.5rem;
  border: 2px dashed #ddd;
  border-radius: 6px;
  width: 100%;
}

/* Status indicators */
#pendingCount, #wsStatus {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: #f0f0f0;
  border-radius: 6px;
  font-weight: 500;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .onboarding-content h1 {
    font-size: 2rem;
  }
  
  .step h2 {
    font-size: 1.5rem;
  }
  
  main {
    padding: 0 0.5rem;
  }
  
  .card {
    padding: 1rem;
  }
  
  button {
    width: 100%;
    margin: 0.25rem 0;
  }
  
  .button-group {
    flex-direction: column;
  }
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  animation: slideUp 0.3s;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: #999;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.modal h2 {
  margin-bottom: 1rem;
  color: #333;
}

.modal p {
  margin-bottom: 1.5rem;
  color: #666;
  line-height: 1.6;
  text-align: left;
}

/* Log Panel */
.log-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0,0,0,0.1);
  z-index: 1001;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.log-panel.pinned {
  right: 0;
  position: fixed;
  border-left: 2px solid #2196F3;
}

.log-panel-header {
  padding: 1rem;
  background: #2196F3;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-panel-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.log-panel-controls {
  display: flex;
  gap: 0.5rem;
}

.pin-btn, .close-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  padding: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  margin: 0;
}

.pin-btn:hover, .close-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: none;
  box-shadow: none;
}

.pin-btn.pinned {
  background: rgba(255,255,255,0.4);
}

.log-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.log-panel-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
}

.log-panel-btn {
  background: #2196F3;
  color: white;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  margin-left: 1rem;
}

@media (max-width: 768px) {
  .log-panel {
    width: 100vw;
    right: -100vw;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
