/* Additional CSS for visualizations and interactive elements */

/* RS232 Visualization */
.rs232-voltage-levels {
  position: relative;
  height: 300px;
  border: 1px solid #ddd;
  margin: 20px 0;
  background-color: #f9f9f9;
}

/* Watchdog Timer Animation */
.watchdog-container {
  padding: 20px;
  text-align: center;
}

.watchdog-timer {
  width: 100%;
  height: 30px;
  background-color: #f1f1f1;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 20px;
}

.timer-bar {
  height: 100%;
  width: 100%;
  background-color: #3498db;
  transition: width 0.1s linear;
}

.watchdog-controls {
  margin-bottom: 20px;
}

.watchdog-controls button {
  margin: 0 10px;
}

.watchdog-status {
  font-weight: bold;
  padding: 10px;
  border-radius: 5px;
  background-color: #e8f7e8;
  color: #2ecc71;
}

/* Scheduling Visualizations */
.scheduling-tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 10px 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  opacity: 0.7;
}

.tab-btn.active {
  border-bottom: 3px solid var(--scheduling-color);
  opacity: 1;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.scheduling-animation {
  height: 200px;
  background-color: #f8f9fa;
  border-radius: 5px;
  margin-bottom: 15px;
  position: relative;
  overflow: hidden;
}

/* ADC Simulator */
.simulator-inputs {
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.input-group label {
  width: 180px;
  font-weight: 500;
}

.simulator-results {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 5px;
  margin-top: 20px;
}

.simulator-results p {
  margin-bottom: 8px;
}

/* Port Configuration Visualizer */
.port-visualizer {
  padding: 20px;
}

.register-container {
  margin-bottom: 20px;
}

.register {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.register-label {
  width: 80px;
  font-weight: bold;
}

.register-bits {
  display: flex;
}

.bit {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bit.active {
  background-color: var(--port-color);
  color: white;
}

.port-controls {
  margin-bottom: 20px;
}

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

.pin-status {
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

/* Study Timer */
.study-timer {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--primary-color);
  color: white;
  padding: 10px 15px;
  border-radius: 30px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  z-index: 100;
  font-weight: 500;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .input-group {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .input-group label {
    margin-bottom: 5px;
  }
  
  .register-bits {
    flex-wrap: wrap;
  }
  
  .bit {
    width: 25px;
    height: 25px;
    margin-bottom: 5px;
  }
  
  .scheduling-tabs {
    flex-wrap: wrap;
  }
  
  .tab-btn {
    padding: 8px 10px;
  }
}

/* Animations */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease-out;
}

/* Quiz Results Styling */
.quiz-results {
  text-align: center;
  padding: 20px;
}

.result-feedback {
  margin: 20px 0;
  padding: 15px;
  border-radius: 5px;
}

.good-result {
  color: #2ecc71;
  font-weight: bold;
}

.average-result {
  color: #f1c40f;
  font-weight: bold;
}

.poor-result {
  color: #e74c3c;
  font-weight: bold;
}

/* Flashcard Improvements */
.flashcard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

#card-counter {
  margin: 0 15px;
  font-weight: 500;
}

.flashcard-front, .flashcard-back {
  font-size: 1.2rem;
  padding: 30px;
}

/* Timeline for Study Plan */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 40px auto;
}

.timeline::after {
  content: '';
  position: absolute;
  width: 6px;
  background-color: var(--primary-color);
  top: 0;
  bottom: 0;
  left: 50%;
  margin-left: -3px;
}

.timeline-item {
  padding: 10px 40px;
  position: relative;
  width: 50%;
  box-sizing: border-box;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-content {
  padding: 20px;
  background-color: white;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.timeline-item::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  right: -10px;
  background-color: white;
  border: 4px solid var(--primary-color);
  top: 15px;
  border-radius: 50%;
  z-index: 1;
}

.timeline-item:nth-child(even)::after {
  left: -10px;
}

@media screen and (max-width: 768px) {
  .timeline::after {
    left: 31px;
  }
  
  .timeline-item {
    width: 100%;
    padding-left: 70px;
    padding-right: 25px;
  }
  
  .timeline-item:nth-child(even) {
    left: 0;
  }
  
  .timeline-item::after {
    left: 21px;
    right: auto;
  }
}

/* CTA Buttons */
.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* Quick Check Section */
.quick-check {
  margin-top: 40px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 10px;
}

.quick-check h3 {
  margin-bottom: 20px;
  text-align: center;
}
