/* PIC Simulator Styles */

/* Reset and Base Styles */
* { 
  margin:0; 
  padding:0; 
  box-sizing:border-box; 
}

body {
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #e8f4f8;
  min-height:100vh; 
  padding:10px;
  margin: 0;
}

.container {
  max-width:100%; 
  margin:0 auto; 
  background:white;
  box-shadow:0 20px 40px rgba(0,0,0,0.1);
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

/* Header Styles */
.header {
  background:linear-gradient(135deg,#2c3e50 0%,#34495e 100%); 
  color:white;
  padding:20px; 
  text-align:left; 
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

.header-logo {
  height: 60px;
  width: auto;
  max-width: 200px;
}

.header-menu {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
}

.menu-item {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.menu-item:active {
  transform: translateY(0);
}

.menu-item.bug-report {
  color: #ff8c00; /* Orange color */
}

.menu-item.bug-report:hover {
  background: rgba(255, 140, 0, 0.1);
}

.menu-item.current {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.menu-item.current:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Main Content - Main App Only */
body:not(.documentation-page):not(.about-page):not(.contact-page) .main-content {
  display:grid; 
  grid-template-columns:1fr 1fr; 
  gap:15px; 
  padding:15px;
  align-items: start; 
  flex: 1; 
  min-height: 0;
  padding-bottom: 80px; /* Space for fixed status bar */
  width: 100%;
  min-width: 0;
}

.panel {
  background:#f8f9fa; 
  border-radius:10px; 
  padding:15px; 
  border:1px solid #e9ecef;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
}

.panel:first-child {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.panel h3 {
  color:#2c3e50; 
  margin-bottom:15px; 
  font-size:1.3em;
  border-bottom:2px solid #3498db; 
  padding-bottom:8px;
}

/* Editor + overlay */
.code-editor-container { 
  position:relative; 
  flex: 1;
  min-height: 400px;
}

.editor-hints {
  display:none;
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  background: rgba(52, 152, 219, 0.1);
  border: 1px solid rgba(52, 152, 219, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: #3498db;
  pointer-events: none;
}

.hint {
  font-family: 'Segoe UI', sans-serif;
}

.code-editor {
  height: 100%;
  border-radius: 8px;
  border: 1px solid #bdc3c7;
  box-sizing: border-box;
}

.code-editor .CodeMirror {
  height: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 20px;
  border-radius: 8px;
}

/* Light theme customizations */
.code-editor .CodeMirror.cm-s-default {
  background: #ffffff;
  color: #333333;
}

.code-editor .CodeMirror.cm-s-default .CodeMirror-gutters {
  background: #f7f7f7;
  border-right: 1px solid #ddd;
}

.code-editor .CodeMirror.cm-s-default .CodeMirror-linenumber {
  color: #999;
}

.code-editor .CodeMirror-scroll {
  min-height: 100%;
}

/* Current line highlighting */
.code-editor .CodeMirror .current-line {
  background: rgba(255, 235, 59, 0.28) !important;
  outline: 2px solid rgba(255, 235, 59, 0.85);
  outline-offset: -1px;
}

/* Error line highlighting */
.code-editor .CodeMirror .error-line {
  background: rgba(244, 67, 54, 0.15) !important;
}

.code-editor .CodeMirror .CodeMirror-line.error-line {
  background: rgba(244, 67, 54, 0.15) !important;
  outline: 2px solid rgba(244, 67, 54, 0.6);
  outline-offset: -1px;
}

.code-editor .CodeMirror .CodeMirror-line.error-line .CodeMirror-linebackground {
  background: rgba(244, 67, 54, 0.15) !important;
}

/* Breakpoint gutter styles */
.code-editor .CodeMirror .CodeMirror-gutters {
  width: 50px;
}

.code-editor .CodeMirror .CodeMirror-gutter.breakpoints {
  width: 20px;
  background: #f7f7f7;
  border-right: 1px solid #ddd;
}

.code-editor .CodeMirror .CodeMirror-gutter.breakpoints .CodeMirror-gutter-elt {
  cursor: pointer;
  text-align: center;
  line-height: 20px;
}

.code-editor .CodeMirror .CodeMirror-gutter.breakpoints .CodeMirror-gutter-elt:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* Breakpoint marker styles */
.code-editor .CodeMirror .breakpoint-marker {
  color: #e74c3c !important;
  font-size: 12px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  text-align: center !important;
  line-height: 20px !important;
  width: 100% !important;
  height: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.code-editor .CodeMirror .CodeMirror-gutter-elt .breakpoint-marker {
  color: #e74c3c !important;
}

.code-editor:focus { 
  border:2px solid #3498db; 
}

/* Controls and Buttons */
.controls { 
  display:flex; 
  flex-direction:column; 
  gap:0; 
  margin-bottom:15px; 
}

.control-row { 
  display:flex; 
  gap:10px; 
  align-items:center; 
  flex-wrap:wrap; 
}

.file-controls { 
  display:flex; 
  gap:8px; 
  margin-right:15px; 
  padding-right:15px; 
  border-right:1px solid #e9ecef; 
}

.file-controls .btn { 
  font-size:13px; 
  padding:6px 12px; 
}

.control-group { 
  display:flex; 
  align-items:center; 
  gap:8px; 
}

.control-group label { 
  font-size:14px; 
  color:#2c3e50; 
  font-weight:500; 
}

.control-select {
  padding:8px 12px; 
  border:1px solid #bdc3c7; 
  border-radius:4px; 
  background:white;
  font-size:14px; 
  color:#2c3e50; 
  cursor:pointer;
}

.control-select:focus { 
  outline:none; 
  border-color:#3498db; 
  box-shadow:0 0 0 2px rgba(52,152,219,0.2); 
}

.btn {
  background:#3498db; 
  color:white; 
  border:none; 
  padding:10px 20px; 
  border-radius:6px; 
  cursor:pointer;
  font-size:14px; 
  transition:all 0.3s ease;
}

.btn:hover { 
  background:#2980b9; 
  transform:translateY(-2px); 
}

.btn:active { 
  transform:translateY(0); 
}

.btn.success { 
  background:#27ae60; 
}

.btn.success:hover { 
  background:#229954; 
}

.btn.warning { 
  background:#f39c12; 
}

.btn.warning:hover { 
  background:#e67e22; 
}

.btn.danger { 
  background:#e74c3c; 
}

.btn.danger:hover { 
  background:#c0392b; 
}

.btn:disabled { 
  background:#bdc3c7; 
  color:#7f8c8d; 
  cursor:not-allowed; 
  transform:none; 
  opacity:0.6;
}

.btn:disabled:hover { 
  background:#bdc3c7; 
  transform:none; 
}

/* Main Menu Bar */
.main-menu-bar {
  display: flex;
  background: #2c3e50;
  border-bottom: 1px solid #34495e;
  padding: 0;
  margin: 0;
  position: relative;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 40px;
  cursor: pointer;
  color: #ecf0f1;
  font-size: 14px;
  font-weight: 500;
  border-right: 1px solid #34495e;
  transition: all 0.2s ease;
  position: relative;
}

.menu-item:hover {
  background: #34495e;
  color: white;
}

.menu-item.active {
  background: #3498db;
  color: white;
}

.menu-arrow {
  margin-left: 8px;
  font-size: 10px;
  transition: transform 0.2s ease;
}

.menu-item.active .menu-arrow {
  transform: rotate(180deg);
}

.menu-icon {
  margin-left: 8px;
  font-size: 14px;
}

/* Dark Mode Checkbox */
.dark-mode-item {
  cursor: default;
}

.dark-mode-item:hover {
  background: transparent;
}

/* Hide share button */
.menu-item[data-menu="share"] {
  display: none !important;
}

.dark-mode-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  gap: 8px;
}

.dark-mode-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.submenu-checkbox-label {
  color: #ecf0f1 !important;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dark-mode-text {
  font-size: 14px;
  color: #ecf0f1;
  font-weight: 500;
}

/* Comprehensive Dark Mode Styles */

/* Body and Container */
.dark-mode {
  color: #e0e0e0;
}

.dark-mode .container {
  background-color: #1a1a1a;
}

/* Header */
.dark-mode .header {
  background-color: #2d2d2d;
  border-bottom: 1px solid #404040;
}

.dark-mode .header-menu .menu-item {
  color: #e0e0e0;
}

.dark-mode .header-menu .menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dark-mode .header-menu .menu-item.current {
  background: rgba(52, 152, 219, 0.3);
  color: #4a9eff;
}

.dark-mode .header-menu .menu-item.bug-report {
  color: #ff8c00;
}

.dark-mode .header-menu .menu-item.bug-report:hover {
  background: rgba(255, 140, 0, 0.1);
}

/* Main Content - Main App Only */
body:not(.documentation-page):not(.about-page):not(.contact-page).dark-mode .main-content {
  background-color: #1a1a1a;
}

.dark-mode .panel {
  background-color: #2d2d2d;
  border: 1px solid #404040;
}

/* Controls and Buttons */
.dark-mode .controls {
  background-color: #2d2d2d;
  border-bottom: 1px solid #404040;
}

.dark-mode .btn {
  background-color: #404040;
  color: #e0e0e0;
  border: 1px solid #555555;
}

.dark-mode .btn:hover {
  background-color: #4a4a4a;
  border-color: #666666;
}

.dark-mode .btn:active {
  background-color: #353535;
}

.dark-mode .btn.primary {
  background-color: #3498db;
  border-color: #2980b9;
  color: #ffffff;
}

.dark-mode .btn.primary:hover {
  background-color: #2980b9;
}

.dark-mode .btn.danger {
  background-color: #e74c3c;
  border-color: #c0392b;
  color: #ffffff;
}

.dark-mode .btn.danger:hover {
  background-color: #c0392b;
}

.dark-mode .btn.success {
  background-color: #27ae60;
  border-color: #229954;
  color: #ffffff;
}

.dark-mode .btn.success:hover {
  background-color: #229954;
}

/* Dark mode styles for LED and Switch assignments */
.dark-mode .led-assignment {
  background-color: #404040;
  color: #e0e0e0;
  border: 1px solid #555555;
}

.dark-mode .led-assignment:hover {
  background-color: #4a4a4a;
}

.dark-mode .led-assignment.disconnected {
  background: #4a2a2a;
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.dark-mode .switch-assignment {
  background-color: #404040;
  color: #e0e0e0;
  border: 1px solid #555555;
}

.dark-mode .switch-assignment:hover {
  background-color: #4a4a4a;
}

.dark-mode .switch-assignment.disconnected {
  background: #4a2a2a;
  color: #ff6b6b;
  border-color: #ff6b6b;
}

/* Submenus */
.submenu {
  background: #2c3e50;
  border: 1px solid #34495e;
  border-top: none;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  position: absolute;
  top: 100%;
  z-index: 1000;
  left: 0;
  width: 100%;
}

.submenu-level-2 {
  position: fixed;
  z-index: 1001;
  min-width: 200px;
  width: auto;
}

.submenu-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.submenu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #2c3e50;
  border: 1px solid #34495e;
  border-radius: 4px;
  color: #ecf0f1;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  justify-content: flex-start;
}

.submenu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.submenu-btn:disabled {
  background: #2c3e50;
  color: #7f8c8d;
  cursor: not-allowed;
}

/* Submenu button states and check marks */
.btn-check {
  margin-left: auto;
  color: #27ae60;
  font-weight: bold;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.submenu-btn.active .btn-check {
  opacity: 1;
}

.submenu-btn.active {
  background: #e8f5e8;
  border-color: #27ae60;
  color: #155724;
}

.submenu-btn.active:hover {
  background: #d4edda;
}

/* Colored submenu buttons */
.submenu-btn-primary {
  background: #007bff !important;
  color: white !important;
}

.submenu-btn-primary:hover:not(:disabled) {
  background: #0056b3 !important;
}

.submenu-btn-warning {
  background: #ffc107 !important;
  color: #212529 !important;
}

.submenu-btn-warning:hover:not(:disabled) {
  background: #e0a800 !important;
}

.submenu-btn-danger {
  background: #dc3545 !important;
  color: white !important;
}

.submenu-btn-danger:hover:not(:disabled) {
  background: #c82333 !important;
}

.submenu-btn-success {
  background: #28a745 !important;
  color: white !important;
}

.submenu-btn-success:hover:not(:disabled) {
  background: #1e7e34 !important;
}

.submenu-btn-info {
  background: #17a2b8 !important;
  color: white !important;
}

.submenu-btn-info:hover:not(:disabled) {
  background: #138496 !important;
}

/* Disabled states for colored buttons */
.submenu-btn-primary:disabled {
  background: #6c757d !important;
  color: #adb5bd !important;
  cursor: not-allowed !important;
}

.submenu-btn-warning:disabled {
  background: #6c757d !important;
  color: #adb5bd !important;
  cursor: not-allowed !important;
}

.submenu-btn-danger:disabled {
  background: #6c757d !important;
  color: #adb5bd !important;
  cursor: not-allowed !important;
}

.submenu-btn-success:disabled {
  background: #6c757d !important;
  color: #adb5bd !important;
  cursor: not-allowed !important;
}

.submenu-btn-info:disabled {
  background: #6c757d !important;
  color: #adb5bd !important;
  cursor: not-allowed !important;
}

/* Sticky Debug Menu */
.submenu.sticky {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: auto !important;
  z-index: 1002 !important;
  background: #2c3e50 !important;
  border: 1px solid #34495e !important;
  border-top: none !important;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

.submenu.sticky .submenu-content {
  flex-direction: row !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 8px 15px !important;
}

.submenu.sticky .submenu-btn {
  width: auto !important;
  min-width: 80px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #34495e;
  border-top: 1px solid #2c3e50;
  padding: 8px 15px;
  font-size: 12px;
  color: #ecf0f1;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.status-section {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-label {
  color: #bdc3c7;
  font-weight: 500;
}

.status-value {
  color: #ecf0f1;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  background: rgba(52, 152, 219, 0.2);
  padding: 2px 6px;
  border-radius: 3px;
  min-width: 40px;
  text-align: center;
}

/* Dark Mode CodeMirror */
.dark-mode .code-editor {
  border-color: #404040;
}

.dark-mode .code-editor:focus {
  border-color: #4a9eff;
}

.dark-mode .code-editor .CodeMirror .current-line {
  background: rgba(255, 235, 59, 0.15) !important;
  outline: 2px solid rgba(255, 235, 59, 0.6);
  outline-offset: -1px;
}

/* Dark mode error line highlighting */
.dark-mode .code-editor .CodeMirror .error-line {
  background: rgba(244, 67, 54, 0.2) !important;
}

.dark-mode .code-editor .CodeMirror .CodeMirror-line.error-line {
  background: rgba(244, 67, 54, 0.2) !important;
  outline: 2px solid rgba(244, 67, 54, 0.7);
  outline-offset: -1px;
}

.dark-mode .code-editor .CodeMirror .CodeMirror-line.error-line .CodeMirror-linebackground {
  background: rgba(244, 67, 54, 0.2) !important;
}

/* Dark mode breakpoint gutter styles */
.dark-mode .code-editor .CodeMirror .CodeMirror-gutter.breakpoints {
  background: #2d3748;
  border-right: 1px solid #4a5568;
}

.dark-mode .code-editor .CodeMirror .CodeMirror-gutter.breakpoints .CodeMirror-gutter-elt:hover {
  background: rgba(231, 76, 60, 0.2);
}

/* Dark mode breakpoint marker styles */
.dark-mode .code-editor .CodeMirror .breakpoint-marker {
  color: #ff6b6b !important;
}

.dark-mode .code-editor .CodeMirror .CodeMirror-gutter-elt .breakpoint-marker {
  color: #ff6b6b !important;
}

.dark-mode .editor-hints {
  background: rgba(74, 158, 255, 0.1);
  border-color: rgba(74, 158, 255, 0.3);
  color: #4a9eff;
}

/* Responsive Styles */
@media (max-width: 768px) {
  body { 
    padding: 5px; 
    overflow-x: hidden;
  }
  .container { 
    min-height: calc(100vh - 10px); 
    max-width: 100vw;
    overflow-x: hidden;
  }
  body:not(.documentation-page):not(.about-page):not(.contact-page) .main-content { 
    grid-template-columns: 1fr; 
    gap: 10px; 
    padding: 10px; 
    padding-bottom: 80px;
    max-width: 100%;
    overflow-x: hidden;
  }
  .panel { 
    padding: 12px; 
    max-width: 100%;
    overflow-x: auto;
  }
  .header { 
    padding: 15px; 
    flex-wrap: wrap;
    gap: 10px;
  }
  .header-logo { height: 50px; }
  .header-menu { 
    gap: 15px; 
    flex-wrap: wrap;
    justify-content: center;
  }
  .menu-item { 
    font-size: 14px; 
    padding: 6px 12px; 
    white-space: nowrap;
  }
}

/* iPhone XR and similar devices (414px width) */
@media (max-width: 414px) {
  body { 
    padding: 0; 
    overflow-x: hidden;
    font-size: 14px;
  }
  .container { 
    min-height: 100vh; 
    border-radius: 0; 
    max-width: 100vw;
    overflow-x: hidden;
    margin: 0;
  }
  body:not(.documentation-page):not(.about-page):not(.contact-page) .main-content { 
    gap: 6px; 
    padding: 6px; 
    padding-bottom: 60px;
    max-width: 100%;
    overflow-x: hidden;
  }
  .panel { 
    padding: 8px; 
    max-width: 100%;
    overflow-x: auto;
    border-radius: 8px;
  }
  .header { 
    padding: 8px; 
    flex-direction: column;
    gap: 8px;
    text-align: center;
    border-radius: 0;
  }
  .header-logo { height: 35px; }
  .header-menu { 
    gap: 6px; 
    flex-wrap: wrap;
    justify-content: center;
  }
  .menu-item { 
    font-size: 11px; 
    padding: 3px 6px; 
    white-space: nowrap;
    border-radius: 4px;
  }
  .code-editor-container {
    min-height: 250px;
  }
  .editor-hints {
    display: none;
  }
}

/* Additional essential styles */
.hint { 
  color:#666; 
  font-size:12px; 
  margin-top:8px; 
}

/* Error highlighting */
.error-line {
  background-color: #fef2f2 !important;
  border-left: 3px solid #dc3545 !important;
  padding-left: 10px !important;
  color: #991b1b !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 10 !important;
}

.assembly-error-line {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  padding: 8px;
  margin-top: 8px;
  border-radius: 4px;
  font-weight: bold;
}

/* Widget Columns Container */
.widget-columns-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  align-items: start;
  overflow: visible;
  width: 100%;
  min-width: 0;
}

.widget-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 500px;
  width: 100%;
  min-width: 0;
}

.column-title {
  color: #2c3e50;
  font-size: 1.1em;
  font-weight: 600;
  margin: 0 0 10px 0;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 6px;
  border: 1px solid #dee2e6;
  text-align: center;
}

.widget-column-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
  width: 100%;
  min-width: 0;
  transition: all 0.3s ease;
}

.widget-column-content.column-drag-over {
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 2px dashed #2196f3;
  border-radius: 8px;
  min-height: 100px;
}

/* Moveable Panels */
.moveable-panel {
  position: relative;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
  transition: all 0.3s ease;
}

.moveable-panel.dragging {
  opacity: 0.7;
  transform: rotate(2deg);
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.moveable-panel.drag-over {
  border: 2px dashed #3498db;
  background: rgba(52, 152, 219, 0.1);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px 20px;
  cursor: move;
  user-select: none;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 10px 10px 0 0;
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.collapse-btn {
  background: #6c757d;
  color: white;
  border: none;
  border-radius: 3px;
  width: 20px;
  height: 20px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.collapse-btn:hover {
  background: #5a6268;
}

.moveable-panel.collapsed .panel-content {
  display: none;
}

.moveable-panel.collapsed .collapse-btn {
  transform: rotate(180deg);
}

.panel-header:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

.panel-title {
  color: #2c3e50;
  font-size: 1.3em;
  font-weight: 600;
  margin: 0;
}

.drag-handle {
  color: #6c757d;
  font-size: 1.2em;
  cursor: grab;
  padding: 5px;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.drag-handle:hover {
  color: #3498db;
  background: rgba(52, 152, 219, 0.1);
}

.drag-handle:active {
  cursor: grabbing;
}

.panel-content {
  padding: 0 20px 20px 20px;
}

.drop-indicator {
  height: 4px;
  background: #3498db;
  border-radius: 2px;
  margin: 10px 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.drop-indicator.active {
  opacity: 1;
}

/* LED Array Styles */
.led-array-display {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

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

.led-config h4 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

.led-assignments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 15px;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
}

.led-assignment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #e9ecef;
  border-radius: 4px;
  font-size: 12px;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.led-assignment.disconnected {
  background: #f8d7da;
  color: #721c24;
}

.led-label {
  font-weight: 600;
  min-width: 30px;
}

.led-pin-select {
  padding: 2px 6px;
  border: 1px solid #bdc3c7;
  border-radius: 3px;
  background: white;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
}

.led-pin-select:focus {
  outline: none;
  border-color: #3498db;
}

.led-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.led-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 15px;
  background: #000;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 100%;
}

.led {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #333;
  border: 2px solid #555;
  transition: all 0.2s ease;
  position: relative;
}

.led.on {
  background: #ff6b35;
  border-color: #ff8c5a;
  box-shadow: 0 0 8px #ff6b35, inset 0 0 4px rgba(255,255,255,0.3);
}

.led.disconnected {
  background: #666;
  border-color: #888;
  opacity: 0.5;
}

.led-label-overlay {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #ccc;
  font-weight: 600;
  white-space: nowrap;
}

.led-status {
  text-align: center;
  font-size: 12px;
  color: #6c757d;
  background: #e9ecef;
  padding: 6px 12px;
  border-radius: 4px;
}

/* Switch Array Styles */
.switch-array-display {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

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

.switch-config h4 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

.switch-assignments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 15px;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
}

.switch-assignment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #e9ecef;
  border-radius: 4px;
  font-size: 12px;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}

.switch-assignment.disconnected {
  background: #f8d7da;
  color: #721c24;
}

.switch-label {
  font-weight: 600;
  min-width: 30px;
  flex-shrink: 0;
}

.switch-pin-select {
  padding: 2px 6px;
  border: 1px solid #bdc3c7;
  border-radius: 3px;
  background: white;
  font-size: 11px;
  font-family: 'Courier New', monospace;
  cursor: pointer;
}

.switch-pin-select:focus {
  outline: none;
  border-color: #3498db;
}

.switch-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 15px;
  background: #000;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 100%;
}

.switch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #333;
  border: 2px solid #555;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.switch.on {
  background: #27ae60;
  border-color: #2ecc71;
  box-shadow: 0 0 8px #27ae60, inset 0 0 4px rgba(255,255,255,0.3);
}

.switch.disconnected {
  background: #666;
  border-color: #888;
  opacity: 0.5;
  cursor: not-allowed;
}

.switch-label-overlay {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #ccc;
  font-weight: 600;
  white-space: nowrap;
}

.switch-status {
  text-align: center;
  font-size: 12px;
  color: #6c757d;
  background: #e9ecef;
  padding: 6px 12px;
  border-radius: 4px;
}

/* Seven Segment Display Styles */
.seven-segment-display {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
}

.segment-mapping {
  margin-bottom: 20px;
}

.mapping-info h4 {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

.mapping-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  font-size: 11px;
  color: #6c757d;
}

.mapping-item {
  padding: 2px 6px;
  background: #e9ecef;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}

.display-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.seven-segment-svg {
  background: #000;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 100%;
  height: auto;
}

.segment {
  fill: #333;
  transition: fill 0.2s ease;
}

.segment.active {
  fill: #ff6b35;
  filter: drop-shadow(0 0 4px #ff6b35);
}

.display-value {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
  background: #e9ecef;
  padding: 8px 16px;
  border-radius: 6px;
  min-width: 40px;
}

/* Memory Viewer Styles */
.memory-viewer {
  margin-top: 10px;
  border: 1px solid #ddd;
  background: white;
  height: 400px;
  display: flex;
  flex-direction: column;
}

.memory-tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.memory-tab {
  flex: 1;
  padding: 10px 15px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  transition: all 0.2s;
}

.memory-tab:hover {
  background: #e9ecef;
  color: #333;
}

.memory-tab.active {
  background: white;
  color: #007bff;
  border-bottom: 2px solid #007bff;
}

.memory-content {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.memory-panel {
  display: none;
  padding: 15px;
  height: 100%;
  overflow-y: auto;
}

.memory-panel.active {
  display: block;
}

.memory-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  font-weight: 600;
  color: #333;
}

.refresh-btn {
  padding: 5px 10px;
  font-size: 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.refresh-btn:hover {
  background: #0056b3;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.memory-cell {
  padding: 4px 6px;
  text-align: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 3px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.memory-cell.zero {
  color: #999;
}

.memory-cell.non-zero {
  background: #e3f2fd;
  color: #1976d2;
  font-weight: 600;
}

.memory-address {
  grid-column: 1 / -1;
  background: #e9ecef;
  font-weight: 600;
  color: #495057;
  margin-top: 10px;
  margin-bottom: 5px;
}

/* SFR Grid Styles */
.sfr-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.sfr-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  min-height: 24px;
}

.sfr-item .sfr-name {
  font-weight: 600;
  color: #495057;
  flex: 1;
}

.sfr-item .sfr-value {
  color: #1976d2;
  font-weight: 600;
  background: #e3f2fd;
  padding: 2px 6px;
  border-radius: 3px;
  min-width: 40px;
  text-align: center;
}

.sfr-item .sfr-bits {
  font-size: 10px;
  color: #6c757d;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Dark mode support for SFR */
.dark-mode .sfr-item {
  background: #2d2d2d;
  border: 1px solid #404040;
}

.dark-mode .sfr-item .sfr-name {
  color: #e0e0e0;
}

.dark-mode .sfr-item .sfr-value {
  background: #1a237e;
  color: #90caf9;
}

.dark-mode .sfr-item .sfr-bits {
  color: #b0b0b0;
}

/* Breakpoint Panel Styles */
.breakpoint-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.breakpoint-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
}

.breakpoint-count {
  font-size: 12px;
  color: #6c757d;
  font-weight: 500;
}

.breakpoint-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.breakpoint-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.breakpoint-item:hover {
  background: #f8f9fa;
  border-color: #007bff;
}

.breakpoint-address {
  color: #495057;
  font-weight: 600;
}

.breakpoint-remove {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 10px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.breakpoint-remove:hover {
  background: #c82333;
}

.no-breakpoints {
  text-align: center;
  color: #6c757d;
  font-style: italic;
  padding: 20px;
}

/* Dark mode support for breakpoints */
.dark-mode .breakpoint-controls {
  background: #2d2d2d;
  border-bottom: 1px solid #404040;
}

.dark-mode .breakpoint-count {
  color: #b0b0b0;
}

.dark-mode .breakpoint-item {
  background: #2d2d2d;
  border: 1px solid #404040;
  color: #e0e0e0;
}

.dark-mode .breakpoint-item:hover {
  background: #353535;
  border-color: #007bff;
}

.dark-mode .breakpoint-address {
  color: #e0e0e0;
}

.dark-mode .no-breakpoints {
  color: #b0b0b0;
}

/* Stack Viewer Styles */
.stack-viewer {
  border: 1px solid #ddd;
  background: white;
  display: flex;
  flex-direction: column;
}

.stack-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.stack-levels {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stack-level {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  transition: all 0.2s ease;
}

.stack-level.active {
  background: #e3f2fd;
  border-color: #2196f3;
  color: #1976d2;
  font-weight: 600;
}

.stack-level.overflow {
  background: #ffebee;
  border-color: #f44336;
  color: #c62828;
}

.stack-level.underflow {
  background: #fff3e0;
  border-color: #ff9800;
  color: #ef6c00;
}

.stack-level-index {
  width: 20px;
  text-align: center;
  font-weight: 600;
  color: #666;
}

.stack-level-address {
  flex: 1;
  margin-left: 10px;
  color: #333;
}

.stack-level-empty {
  color: #999;
  font-style: italic;
}

/* User Registers Styles */
.user-registers {
  border: 1px solid #ddd;
  background: white;
  height: 350px;
  display: flex;
  flex-direction: column;
}

.registers-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.register-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 4px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
}

.register-item.auto-detected {
  background: #e3f2fd;
  border-color: #2196f3;
}

.register-item.auto-detected .register-label {
  color: #1976d2;
}

.register-label {
  font-weight: 600;
  color: #2c3e50;
  min-width: 80px;
}

.register-address {
  color: #666;
  margin-left: 10px;
}

.register-value {
  color: #27ae60;
  font-weight: 600;
  margin-left: auto;
}

.no-registers {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px;
}

/* Interrupt Table Styles */
.interrupt-table {
  border: 1px solid #ddd;
  background: white;
  display: flex;
  flex-direction: column;
}

.interrupt-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.interrupt-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}

.interrupt-name {
  font-weight: 600;
  color: #2c3e50;
  min-width: 120px;
}

.interrupt-status {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

.interrupt-enabled {
  background: #d4edda;
  color: #155724;
}

.interrupt-disabled {
  background: #f8d7da;
  color: #721c24;
}

.global-interrupt {
  background: #e8f5e8;
  border-left: 3px solid #4caf50;
  font-weight: bold;
}

/* Flag Table Styles */
.flag-table {
  border: 1px solid #ddd;
  background: white;
  display: flex;
  flex-direction: column;
}

.flag-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.flag-item {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  margin-bottom: 4px;
  font-size: 12px;
}

.flag-name {
  font-weight: 600;
  color: #2c3e50;
  min-width: 100px;
}

.flag-value {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
}

.flag-set {
  background: #d4edda;
  color: #155724;
}

.flag-clear {
  background: #f8d7da;
  color: #721c24;
}

/* PIC Chip Display */
.chip-container {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
}

.chip-svg {
  max-width: 100%;
  height: 500px;
}

.pic-chip {
  width: 100%;
  max-width: 420px;
  height: 100%;
}

.pin {
  cursor: pointer;
  transition: all 0.2s ease;
}

.pin:hover {
  filter: brightness(1.3);
  stroke-width: 2px;
}

.pin[data-gpio="-1"] {
  cursor: default;
}

.pin[data-gpio="-1"]:hover {
  transform: none;
  filter: none;
}

/* Pin state indicators */
.pin.input rect {
  fill: #3498db !important;
  stroke: #2980b9 !important;
}

.pin.output rect {
  fill: #f39c12 !important;
  stroke: #e67e22 !important;
}

.pin.high rect {
  fill: #27ae60 !important;
  stroke: #229954 !important;
}

.pin.low rect {
  fill: #e74c3c !important;
  stroke: #c0392b !important;
}

/* Legacy GPIO grid styles (hidden) */
.gpio-grid { 
  display: none; 
}

/* Assembly Modal Styles */
.assembly-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #2c3e50;
}

.btn-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close:hover {
  background: #e9ecef;
  color: #495057;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.4;
  background: #f8f9fa;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #e9ecef;
  background: white;
  border-radius: 0 0 12px 12px;
}

/* Assembly Toast Styles */
.assembly-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  max-width: 400px;
  animation: slideInRight 0.3s ease-out;
}

.toast-content {
  background: white;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid #27ae60;
}

.toast-content.error {
  border-left-color: #e74c3c;
}

.toast-content.warning {
  border-left-color: #f39c12;
}

.toast-icon {
  font-size: 18px;
  color: #27ae60;
  font-weight: bold;
}

.toast-content.error .toast-icon {
  color: #e74c3c;
}

.toast-content.warning .toast-icon {
  color: #f39c12;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: #2c3e50;
  font-weight: 500;
}

.btn-small {
  background: #3498db;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.btn-small:hover {
  background: #2980b9;
}

.btn-close-small {
  background: none;
  border: none;
  font-size: 16px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.btn-close-small:hover {
  background: #e9ecef;
  color: #495057;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.assembly-success {
  color: #155724;
  background: #d4edda;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #c3e6cb;
}

.assembly-warning {
  color: #856404;
  background: #fff3cd;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #ffeaa7;
}

.assembly-error {
  color: #721c24;
  background: #f8d7da;
  padding: 10px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
}

/* Responsive Widget Styles */
@media (max-width: 768px) {
  .widget-columns-container {
    grid-template-columns: 1fr;
    gap: 15px;
    overflow: visible;
  }
  
  .widget-column {
    min-height: 400px;
  }
  
  .led-assignments {
    grid-template-columns: 1fr;
  }
  
  .switch-assignments {
    grid-template-columns: 1fr;
  }
  
  .moveable-panel {
    overflow-y: auto;
    max-height: 400px;
  }
  
  .panel-content {
    overflow-y: auto;
  }
  
  .seven-segment-svg {
    width: 100px;
    height: 150px;
    padding: 8px;
  }
  
  .led-grid {
    gap: 8px;
    padding: 10px;
  }
  
  .led {
    width: 16px;
    height: 16px;
  }
  
  /* Hide status bar on mobile */
  .status-bar {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .widget-columns-container {
    gap: 6px;
  }
  
  .widget-column {
    min-height: 200px;
  }
  
  .led-assignments {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  
  .led-assignment {
    padding: 4px 6px;
    font-size: 11px;
  }
  
  .led-label {
    min-width: 25px;
  }
  
  .led-pin-select {
    font-size: 10px;
    padding: 1px 4px;
  }
  
  .switch-assignments {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  
  .switch-assignment {
    padding: 4px 6px;
    font-size: 11px;
  }
  
  .switch-label {
    min-width: 25px;
  }
  
  .switch-pin-select {
    font-size: 10px;
    padding: 1px 4px;
  }
  
  .seven-segment-svg {
    width: 80px;
    height: 120px;
    padding: 6px;
  }
  
  .led-grid {
    gap: 6px;
    padding: 8px;
  }
  
  .led {
    width: 14px;
    height: 14px;
  }
  
  .led-label-overlay {
    font-size: 9px;
    top: -20px;
  }
  
  .switch-grid {
    gap: 6px;
    padding: 8px;
  }
  
  .switch {
    width: 14px;
    height: 14px;
  }
  
  .switch-label-overlay {
    font-size: 9px;
    top: -20px;
  }
  
  .moveable-panel {
    max-height: 350px;
  }
  
  .sfr-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* Documentation, About, and Contact Pages Styles */
.documentation-page, .about-page, .contact-page {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #e8f4f8;
  min-height: 100vh;
  padding: 10px;
  margin: 0;
}

.documentation-image {
  max-width: 100%;
  height: auto;
}

/* About page specific background */
.about-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.documentation-page .container, .about-page .container, .contact-page .container {
  max-width: 100%;
  margin: 0 auto;
  background: white;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  min-height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
}

.documentation-page .header, .about-page .header, .contact-page .header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 20px;
  text-align: left;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.documentation-page .logo-link, .about-page .logo-link, .contact-page .logo-link {
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.documentation-page .logo-link:hover, .about-page .logo-link:hover, .contact-page .logo-link:hover {
  opacity: 0.8;
}

.documentation-page .header-logo, .about-page .header-logo, .contact-page .header-logo {
  height: 60px;
  width: auto;
  max-width: 200px;
}

.documentation-page .header-menu, .about-page .header-menu, .contact-page .header-menu {
  display: flex;
  gap: 30px;
  align-items: center;
}

.documentation-page .menu-item, .about-page .menu-item, .contact-page .menu-item {
  color: white;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
}

.documentation-page .menu-item:hover, .about-page .menu-item:hover, .contact-page .menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.documentation-page .menu-item:active, .about-page .menu-item:active, .contact-page .menu-item:active {
  transform: translateY(0);
}

.documentation-page .menu-item.bug-report, .about-page .menu-item.bug-report, .contact-page .menu-item.bug-report {
  color: #ff8c00;
}

.documentation-page .menu-item.bug-report:hover, .about-page .menu-item.bug-report:hover, .contact-page .menu-item.bug-report:hover {
  background: rgba(255, 140, 0, 0.1);
}

.documentation-page .menu-item.current, .about-page .menu-item.current, .contact-page .menu-item.current {
  background: rgba(255, 255, 255, 0.2);
  font-weight: 600;
}

.documentation-page .menu-item.current:hover, .about-page .menu-item.current:hover, .contact-page .menu-item.current:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Documentation-specific styles */
.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: stretch;
  position: sticky;
  top: 2rem;
  align-self: start;
  max-height: calc(100vh - 4rem);
}

.search-container {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.5rem;
  border-left: 4px solid #667eea;
}

.search-container h3 {
  color: #667eea;
  margin-bottom: 1rem;
}

.search-box {
  width: 100%;
  padding: 12px 20px;
  border: 2px solid #ddd;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
}

.search-box:focus {
  border-color: #667eea;
}

/* Documentation page specific content layout */
.documentation-page .content {
  padding: 2rem;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

/* About page specific content layout */
.about-page .content {
  padding: 2rem;
  flex: 1;
}

/* Contact page specific content layout */
.contact-page .content {
  padding: 2rem;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

.main-content {
  min-width: 0;
}

.sidebar {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.5rem;
  height: fit-content;
  border-left: 4px solid #667eea;
  overflow-y: auto;
  flex: 1;
}

.sidebar h3 {
  color: #2c3e50;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.toc {
  list-style: none;
}

.toc li {
  margin-bottom: 0.5rem;
}

.toc a {
  display: block;
  color: #666;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.toc a:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-left-color: #667eea;
}

.toc a.active {
  background: rgba(102, 126, 234, 0.25);
  color: #667eea;
  font-weight: 700;
  border-left-color: #667eea;
  border-left-width: 4px;
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.toc .toc-level-2 {
  margin-left: 1rem;
}

.toc .toc-level-3 {
  margin-left: 2rem;
}

.toc .toc-level-4 {
  margin-left: 3rem;
}

/* List styling with proper indentation */
.section ul, .section ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.section ul ul, .section ol ol, .section ul ol, .section ol ul {
  margin-left: 1.5rem;
  margin-top: 0.5rem;
}

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

.section ul ul {
  list-style-type: circle;
}

.section ul ul ul {
  list-style-type: square;
}

.section ol {
  list-style-type: decimal;
}

.section ol ol {
  list-style-type: lower-alpha;
}

.section ol ol ol {
  list-style-type: lower-roman;
}

.section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #eee;
}

.section:last-child {
  border-bottom: none;
}

.section h2 {
  color: #667eea;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.section h3 {
  color: #555;
  font-size: 1.3rem;
  margin: 1.5rem 0 1rem 0;
}

.section h4 {
  color: #666;
  font-size: 1.1rem;
  margin: 1rem 0 0.5rem 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.feature-card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.feature-card h4 {
  color: #667eea;
  margin-bottom: 0.5rem;
}

.code-block {
  background: #f4f4f4;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-x: auto;
  color: #333;
}

/* Dark mode support for code blocks */
.documentation-page .code-block,
.about-page .code-block,
.contact-page .code-block {
  background: #2d2d2d;
  border: 1px solid #404040;
  color: #e0e0e0;
}

.image-placeholder {
  background: #e9ecef;
  border: 2px dashed #adb5bd;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #6c757d;
  margin: 1rem 0;
  font-style: italic;
}

.highlight {
  background: #fff3cd;
  padding: 1rem;
  border-left: 4px solid #ffc107;
  border-radius: 0 5px 5px 0;
  margin: 1rem 0;
}

.tip {
  background: #d1ecf1;
  padding: 1rem;
  border-left: 4px solid #17a2b8;
  border-radius: 0 5px 5px 0;
  margin: 1rem 0;
}

.warning {
  background: #f8d7da;
  padding: 1rem;
  border-left: 4px solid #dc3545;
  border-radius: 0 5px 5px 0;
  margin: 1rem 0;
}

.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: all 0.3s;
}

.back-to-top:hover {
  background: #5a6fd8;
  transform: translateY(-2px);
}

.hidden {
  display: none;
}

/* Responsive styles for documentation pages */
@media (max-width: 768px) {
  .documentation-page .container, .about-page .container, .contact-page .container {
    padding: 10px;
  }
  
  .documentation-page .header h1, .about-page .header h1, .contact-page .header h1 {
    font-size: 2rem;
  }
  
  .documentation-page .content, .contact-page .content {
    grid-template-columns: 1fr;
  }
  
  .sidebar-area {
    order: -1;
    position: static;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
}

/* About and Contact page specific styles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: #f8f9fa;
  padding: 2rem 1.5rem;
  border-radius: 10px;
  text-align: center;
  border-left: 4px solid #667eea;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tech-item {
  background: #667eea;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* About page responsive styles */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Contact page specific styles */
.contact-form {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  border-left: 4px solid #667eea;
}

.contact-form h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  color: #2c3e50;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.submit-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
  transform: translateY(0);
}

.contact-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.8rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.contact-item .icon {
  width: 40px;
  height: 40px;
  background: #667eea;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  color: white;
  font-size: 1.2rem;
}

.contact-item .details h4 {
  color: #2c3e50;
  margin-bottom: 0.25rem;
}

.contact-item .details p {
  color: #666;
  font-size: 0.9rem;
}

.success-message {
  background: #d4edda;
  color: #155724;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #c3e6cb;
  margin-bottom: 1rem;
  display: none;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #f5c6cb;
  margin-bottom: 1rem;
  display: none;
}

.bug-report-fields {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 10px;
  border-left: 4px solid #e74c3c;
  margin-top: 1rem;
  animation: slideDown 0.3s ease-out;
}

.bug-report-fields h4 {
  color: #e74c3c;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.bug-report-fields .form-group {
  margin-bottom: 1rem;
}

.bug-report-fields label {
  color: #2c3e50;
  font-weight: 500;
}

.bug-report-fields input[readonly] {
  background-color: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.faq-section {
  background: #f8f9fa;
  padding: 2rem;
  border-radius: 10px;
  border-left: 4px solid #667eea;
  margin: 2rem;
  margin-top: 3rem;
}

.faq-section h3 {
  color: #2c3e50;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.faq-item {
  background: white;
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.faq-question {
  background: #667eea;
  color: white;
  padding: 1rem 1.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background: #5a6fd8;
}

.faq-answer {
  padding: 1.5rem;
  color: #666;
  line-height: 1.6;
}

/* Contact page responsive styles */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}
