/* ============================================
   FTTH Simulator — Modal / Properties Panel
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 10, 20, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-container {
  width: 400px;
  max-width: 90vw;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transform: scale(0.95) translateY(10px);
  transition: transform var(--duration-normal) var(--ease-spring);
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border-default);
}

.modal-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close {
  color: var(--text-muted);
  padding: var(--sp-1);
  border-radius: var(--radius-sm);
}

.btn-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-body {
  padding: var(--sp-4);
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: var(--sp-4);
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  background: var(--bg-elevated);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Form Groups */
.form-group {
  margin-bottom: var(--sp-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.form-control {
  width: 100%;
}

/* Range input styling */
input[type="range"] {
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  outline: none;
  padding: 0;
  border: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-teal);
  cursor: pointer;
  transition: transform 100ms;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-with-value {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.range-value-display {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  width: 60px;
  text-align: right;
  color: var(--accent-teal);
}

/* ============================================
   FTTH Simulator — Guide & Glossary Modal Specifics
   ============================================ */
.guide-layout {
  display: flex;
  height: 500px;
  gap: var(--sp-4);
}

.guide-sidebar {
  width: 195px;
  border-right: 1px solid var(--border-default);
  padding-right: var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.guide-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast);
}

.guide-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.guide-tab-btn.active {
  background: var(--accent-teal-glow);
  color: var(--accent-teal);
  font-weight: 600;
}

.guide-content-panel {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--sp-2);
}

.guide-content-panel h4 {
  font-size: var(--text-md);
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: var(--sp-3);
  font-weight: 600;
}

.guide-content-panel p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--sp-3);
}

.guide-content-section {
  display: none;
}

.guide-content-section.active {
  display: block;
}

/* Glossary list styles */
.glossary-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.glossary-item {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: var(--sp-3);
}

.glossary-item:last-child {
  border-bottom: none;
}

.glossary-term {
  font-weight: 600;
  color: var(--accent-teal);
  margin-bottom: var(--sp-1);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-sm);
}

.glossary-definition {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Reference table style */
.guide-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-2);
  margin-bottom: var(--sp-4);
  font-size: var(--text-xs);
}

.guide-table th, .guide-table td {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.guide-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--text-primary);
}

.guide-table tr:hover {
  background: var(--bg-hover);
}
