/* ========================================
  Centipede-RTK Web Serial - Common styles
  ======================================== */

/* Common CSS variables */
:root {
  --primary: #0b57d0;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --light: #f8f9fa;
  --dark: #343a40;
}

/* Common base styles */
body {
  font-family: system-ui, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  margin: 0 auto;
  padding: 0 16px;
}

h1 {
  margin: 24px 0;
  text-align: center;
  color: var(--dark);
}

/* Logo and branding */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.brand .logo {
  height: 2.5em;
  width: auto;
}

/* Mode Switch Styles - Common to both versions */
.mode-switch-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  background: white;
  border-radius: 25px;
  padding: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #ddd;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dark);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px !important;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.mode-label {
  font-weight: 600;
  white-space: nowrap;
}

.mode-label.active {
  color: var(--primary);
}

/* Common buttons */
button {
  font-size: 16px;
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: #0943a6;
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #218838;
}

/* Common form elements */
select,
input[type="number"],
input[type="file"] {
  font-size: 16px;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid #ddd;
  background: #fff;
  width: 100%;
  max-width: none;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Common footer */
footer {
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 14px;
  color: #666;
}

footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--primary);
}

footer svg {
  width: 16px;
  height: 16px;
}

/* Common utility classes */
.hidden {
  display: none;
}

.muted {
  opacity: 0.7;
}

/* Common responsive adjustments */
@media (max-width: 768px) {
  .mode-switch-container {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 16px;
    justify-content: center;
    display: flex;
  }
}
