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

body {
  min-height: 100vh;
  width: 100%;
  margin: 0;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #F4F5F6;
}

.container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  background-color: #F4F5F6;
}

.if-vid {
  flex: 1;
  padding: 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.p-head {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 20px;
  font-size: 18px;
  color: #333;
  align-self: flex-start;
  /* margin-left: 50px; */
}

.interfacing {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
}

#circuitImg {
  width: 100%;
  height: auto;
  display: block;
  transition: all 0.3s ease;
  margin-top: 60px;
}

/* Moisture Slider Controls */
.slider-container {
  position: absolute;
  bottom: -40%;
  left: 10%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 25px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  min-width: 350px;
  display: none;
  z-index: 100;
}

.slider-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.moisture-slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, #2196F3 0%, #FFC107 50%, #f44336 100%);
  outline: none;
  opacity: 0.9;
  transition: opacity 0.2s;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.moisture-slider:hover {
  opacity: 1;
}

.moisture-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #4CAF50;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.moisture-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.moisture-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #4CAF50;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.moisture-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.slider-values {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.value-label {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

.moisture-display {
  margin-top: 15px;
  text-align: center;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.moisture-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.moisture-unit {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  opacity: 0.9;
}

.right-panel {
  width: 650px;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-left: 1px solid #e0e0e0;
  overflow: hidden;
}

.instruction-box {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #e0e0e0;
  overflow: hidden;
}

.box-title {
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.instruction-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.instruction-content::-webkit-scrollbar {
  width: 8px;
}

.instruction-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.instruction-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.instruction-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.instruction-section {
  margin-bottom: 25px;
}

.instruction-section:last-child {
  margin-bottom: 0;
}

.instruction-section h4 {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 2px solid #4CAF50;
  display: inline-block;
}

.instruction-section p {
  margin-bottom: 10px;
  text-align: justify;
}

.instruction-section ol,
.instruction-section ul {
  margin-left: 20px;
  margin-top: 10px;
}

.instruction-section li {
  margin-bottom: 8px;
  padding-left: 5px;
}

.instruction-section li strong {
  color: #333;
  font-weight: 600;
}

.instruction-section ul li {
  list-style-type: disc;
}

.code-box {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e0e0e0;
}

.code-header .box-title {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
}

.code-header .control-btn {
  margin: 0;
  padding: 8px 20px;
  font-size: 13px;
}

.editor-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.CodeMirror {
  height: 100% !important;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.CodeMirror-scroll {
  overflow-y: auto !important;
  overflow-x: auto !important;
}

.CodeMirror-scrollbar-filler,
.CodeMirror-gutter-filler {
  background-color: transparent;
}

.control-btn {
  padding: 12px 30px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin: 20px auto;
}

.start-btn {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
}

.start-btn:hover {
  background: linear-gradient(135deg, #45a049 0%, #3d8b40 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.stop-btn {
  background: linear-gradient(135deg, #f44336 0%, #da190b 100%);
  color: white;
}

.stop-btn:hover {
  background: linear-gradient(135deg, #da190b 0%, #c41408 100%);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.play-icon {
  font-size: 16px;
  line-height: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .right-panel {
    width: 500px;
  }
  
  .slider-container {
    min-width: 300px;
    padding: 18px 20px;
  }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }
  
  .if-vid {
    flex: 0 0 50%;
    padding: 15px;
  }
  
  .right-panel {
    width: 100%;
    flex: 0 0 50%;
  }
  
  .instruction-box,
  .code-box {
    flex: 0 0 50%;
  }
  
  .p-head {
    margin-left: 20px;
    font-size: 16px;
  }
  
  .slider-container {
    min-width: 280px;
    padding: 15px 18px;
  }
  
  .moisture-value {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .if-vid {
    padding: 10px;
  }
  
  .p-head {
    font-size: 14px;
    margin-left: 10px;
  }
  
  .control-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .instruction-content {
    padding: 15px;
    font-size: 13px;
  }
  
  .slider-container {
    min-width: 250px;
    padding: 12px 15px;
  }
  
  .slider-label {
    font-size: 12px;
  }
  
  .moisture-value {
    font-size: 22px;
  }
  
  .moisture-unit {
    font-size: 12px;
  }
  
  .value-label {
    font-size: 10px;
  }
}
