/* ========================================
  Centipede-RTK Web Serial - Styles for index.html (beginner mode)
  ======================================== */

body {
  max-width: 800px;
  background-color: #f5f5f5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1 {
  font-size: 1.8rem;
}

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

.main-container {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.control-group {
  margin-bottom: 20px;
}

.control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
}

.control-row {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.btn {
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.progress-container {
  margin-top: 24px;
  position: relative;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-info-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: all 0.2s;
}

.progress-info-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.uart-terminal {
  background: #1a1a1a;
  color: #00ff00;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 12px;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  margin-top: 12px;
  border: 1px solid #333;
  white-space: pre-wrap;
  word-break: break-all;
}

.uart-terminal::-webkit-scrollbar {
  width: 8px;
}

.uart-terminal::-webkit-scrollbar-track {
  background: #2a2a2a;
}

.uart-terminal::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.uart-terminal .sent {
  color: #ffff00;
}

.uart-terminal .received {
  color: #00ff00;
}

.uart-terminal .timestamp {
  color: #888;
  font-size: 10px;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: #e9ecef;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #4285f4);
  transition: width 0.3s ease;
  border-radius: 10px;
}

.progress-text {
  text-align: center;
  font-size: 14px;
  color: var(--dark);
}

.settings-menu {
  position: relative;
  display: inline-block;
}

.settings-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
}

.settings-btn:hover {
  background: #f0f0f0;
}

.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(2px);
}

.settings-modal.active {
  display: flex;
}

.settings-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  padding: 32px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
  color: #666;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #f0f0f0;
  color: var(--danger);
}

.settings-content select,
.settings-content input[type="number"],
.settings-content input[type="file"] {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  font-size: 16px;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid #ddd;
  background: #fff;
  margin: 0;
}

.file-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.refresh-btn {
  padding: 8px;
  background: none;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}

.refresh-btn:hover {
  background: #f0f0f0;
}

.status {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 0;
  margin-top: 16px;
  font-weight: 500;
}

.status.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status.info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.config-description {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #495057;
}

.config-description h4 {
  margin: 0 0 10px 0;
  color: #007bff;
  font-size: 16px;
}

.config-description p {
  margin: 0 0 8px 0;
}

.config-description p:last-child {
  margin-bottom: 0;
}
