/* Base Styles */
:root {
  --primary-color: #3498db;
  --secondary-color: #2c3e50;
  --accent-color: #e74c3c;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --info-color: #3498db;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
  overflow-x: hidden;
}

/* Main Container */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  background-color: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  color: white;
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://i.ibb.co/Mk8xbkmk/steptodown-com788648.jpg') no-repeat center center/cover;
  opacity: 0.1;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-title i {
  margin-right: 15px;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

.hero-buttons .btn {
  padding: 0.75rem 1.5rem;
  font-size: 1.1rem;
  border-radius: 50px;
  margin: 0.5rem;
  transition: all 0.3s ease;
}

.hero-buttons .btn-primary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.hero-buttons .btn-primary:hover {
  background-color: #c0392b;
  border-color: #c0392b;
  transform: translateY(-2px);
}

.hero-buttons .btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Sidebar Navigation */
.sidebar {
  background-color: var(--secondary-color);
  color: white;
  height: 100%;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: sticky;
  top: 0;
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.8);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 5px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar .nav-link:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.sidebar .nav-link.active {
  color: white;
  background-color: var(--primary-color);
  font-weight: 600;
}

.sidebar .nav-link i {
  width: 25px;
  text-align: center;
}

/* Main Content */
.content-section {
  padding: 2.5rem;
  border-bottom: 1px solid #eee;
}

.section-title {
  color: var(--secondary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary-color);
}

.section-title i {
  margin-right: 10px;
  color: var(--primary-color);
}

/* Feature Cards */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature-card {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid #eee;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.feature-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.feature-card h5 {
  color: var(--secondary-color);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.feature-card p {
  color: #666;
  font-size: 0.95rem;
}

/* Code Blocks */
.code-demo {
  background-color: #2d2d2d;
  border-radius: 6px;
  margin: 1.5rem 0;
  overflow: hidden;
}

.code-demo pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
}

.code-demo code {
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Tables */
.table {
  margin: 1.5rem 0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #eee;
}

.table thead th {
  background-color: var(--secondary-color);
  color: white;
  border: none;
  padding: 0.75rem 1rem;
}

.table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.table td, .table th {
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

/* Accordion */
.accordion-button {
  font-weight: 600;
  padding: 1rem 1.25rem;
  background-color: rgba(52, 152, 219, 0.1);
}

.accordion-button:not(.collapsed) {
  background-color: rgba(52, 152, 219, 0.2);
  color: var(--secondary-color);
}

.accordion-body {
  padding: 1.25rem;
}

/* Alert Boxes */
.alert {
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
}

.alert h5 {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.alert h5 i {
  margin-right: 8px;
}

.alert-info {
  background-color: rgba(52, 152, 219, 0.1);
  border-color: var(--info-color);
  color: var(--dark-color);
}

.alert-warning {
  background-color: rgba(243, 156, 18, 0.1);
  border-color: var(--warning-color);
  color: var(--dark-color);
}

.alert-danger {
  background-color: rgba(231, 76, 60, 0.1);
  border-color: var(--danger-color);
  color: var(--dark-color);
}

/* Control Panel */
.control-panel {
  background-color: white;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-group:last-child {
  margin-bottom: 0;
}

.control-group h6 {
  color: var(--secondary-color);
  font-weight: 600;
  margin-bottom: 1rem;
}

.form-range {
  height: 10px;
  cursor: pointer;
}

.form-range::-webkit-slider-thumb {
  background: var(--primary-color);
}

.form-range::-moz-range-thumb {
  background: var(--primary-color);
}

.form-range::-ms-thumb {
  background: var(--primary-color);
}

/* Status Indicators */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-ok {
  background-color: var(--success-color);
}

.status-warning {
  background-color: var(--warning-color);
}

.status-danger {
  background-color: var(--danger-color);
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  padding: 2rem 0;
  margin-top: 3rem;
}

footer p {
  margin-bottom: 1rem;
}

.social-icons a {
  display: inline-block;
  width: 40px;
  height: 40px;
  line-height: 40px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.social-icons a:hover {
  background-color: var(--primary-color);
  transform: translateY(-3px);
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .sidebar {
    min-height: auto;
    position: static;
    padding: 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .content-section {
    padding: 1.5rem;
  }
  
  .feature-cards {
    grid-template-columns: 1fr;
  }
  
  .hero-buttons .btn {
    display: block;
    width: 80%;
    margin: 0.5rem auto;
  }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.content-section {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Tab Navigation */
.nav-tabs {
  border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
  color: var(--secondary-color);
  font-weight: 500;
  border: none;
  padding: 0.75rem 1.25rem;
  margin-right: 0.5rem;
}

.nav-tabs .nav-link.active {
  color: var(--primary-color);
  background-color: transparent;
  border-bottom: 3px solid var(--primary-color);
}

.nav-tabs .nav-link:hover {
  border-color: transparent;
  color: var(--primary-color);
}

/* Wiring Diagram */
.wiring-diagram {
  text-align: center;
  margin: 2rem 0;
}

.wiring-diagram img {
  max-width: 100%;
  border: 1px solid #eee;
  transition: transform 0.3s ease;
}

.wiring-diagram img:hover {
  transform: scale(1.02);
}

.wiring-diagram p {
  font-style: italic;
  color: #666;
}

/* Pin Table */
.pin-table table {
  width: 100%;
}

.pin-table th {
  background-color: var(--secondary-color);
  color: white;
}

.pin-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Telemetry Output */
#telemetryOutput {
  display: block;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}
