/* Technical View Layout */
.technical-layout {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.technical-left-panel {
  width: 100%;
  height: 100%;
  background: var(--dark-bg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: hidden;
  min-height: 0;
}

.technical-right-panel {
  width: 50%;
  height: 100%;
  overflow-y: auto;
  background: var(--light-bg);
  padding: 20px;
}

/* API Sections - distribuir espacio equitativamente */
.api-section {
  background: var(--dark-surface);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
}

/* Asegurar que todas las secciones tengan el mismo tamaño */
.api-section:first-child { flex: 1 1 0; }
.api-section:nth-child(2) { flex: 1 1 0; }
.api-section:nth-child(3) { flex: 1 1 0; }

.section-header {
  padding: 12px 16px;
  background: #334155;
  font-weight: 600;
  font-size: 13px;
  color: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.section-content {
  padding: 0;
  flex: 1;
  overflow: auto;
  min-height: 0;
}

.section-content pre {
  margin: 0;
  padding: 12px;
  font-size: 11px;
  line-height: 1.4;
  font-family: 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  overflow-y: auto;
  background: #0f172a;
  border-radius: 0;
  cursor: text;
  user-select: text;
  max-height: none;
  height: 100%;
}

.section-content code {
  display: block;
  font-family: inherit;
  font-size: inherit;
  white-space: pre;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  cursor: text;
}

.section-content pre,
.section-content code,
.json-view,
.json-field,
.api-section,
.section-content {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

.section-content pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.section-content pre::-webkit-scrollbar-track {
  background: #1e293b;
  border-radius: 4px;
}

.section-content pre::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.section-content pre::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.technical-left-panel::-webkit-scrollbar {
  width: 8px;
}

.technical-left-panel::-webkit-scrollbar-track {
  background: var(--dark-bg);
  border-radius: 4px;
}

.technical-left-panel::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.technical-left-panel::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.technical-right-panel::-webkit-scrollbar {
  width: 8px;
}

.technical-right-panel::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 4px;
}

.technical-right-panel::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}

.technical-right-panel::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Traceability Table */
.trace-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.trace-table th {
  text-align: left;
  padding: 8px;
  background: #334155;
  color: #94a3b8;
  font-weight: 600;
  position: sticky;
  top: 0;
}

.trace-table td {
  padding: 8px;
  border-bottom: 1px solid #334155;
  color: #cbd5e1;
}

.trace-row {
  transition: background 0.15s;
  cursor: pointer;
}

.trace-row:hover {
  background: #334155;
}

.trace-row.trace-highlight {
  background-color: #fef3c7;
}

.trace-row code {
  color: #7dd3fc;
}

/* JSON highlightable fields */
.json-field {
  transition: all 0.2s ease;
  border-radius: 4px;
  padding: 0 2px;
  cursor: pointer;
}

.json-field.hover-highlight {
  background-color: #fbbf24 !important;
  color: #0f172a !important;
  font-weight: bold;
  box-shadow: 0 0 0 2px #f59e0b;
}

/* Placeholder text */
.placeholder-text {
  color: #94a3b8;
  text-align: center;
  padding: 40px;
  font-style: italic;
}

/* Initial message */
.initial-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  color: var(--text-light);
  gap: 16px;
  padding: 40px;
}

.initial-message .material-icons {
  font-size: 48px;
  color: #cbd5e1;
}

.initial-message h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
}

.initial-message p {
  font-size: 14px;
}

/* ============================================
   RESPONSIVE DESIGN - TECHNICAL VIEW
   ============================================ */

/* Tablets y pantallas medianas (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .technical-layout {
    flex-direction: column;
    height: 100%;
  }
  
  .technical-left-panel {
    width: 100%;
    height: 50%;
    min-height: 0;
  }
  
  .technical-right-panel {
    width: 100%;
    height: 50%;
    min-height: 0;
  }
  
  .section-header {
    font-size: 12px;
    padding: 10px 14px;
  }
  
  .section-content pre {
    font-size: 10px;
    padding: 10px;
  }
}

/* Móviles (menos de 769px) */
@media (max-width: 768px) {
  .technical-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }
  
  .technical-left-panel {
    width: 100%;
    height: auto;
    min-height: 50vh;
    flex: none;
    padding: 8px;
    gap: 8px;
  }
  
  .technical-right-panel {
    width: 100%;
    height: auto;
    min-height: 50vh;
    flex: none;
    padding: 12px;
  }
  
  .section-header {
    font-size: 11px;
    padding: 8px 12px;
  }
  
  .section-content pre {
    font-size: 10px;
    padding: 8px;
  }
  
  .trace-table {
    font-size: 9px;
  }
  
  .trace-table th,
  .trace-table td {
    padding: 4px 6px;
  }
}

/* Móviles pequeños (menos de 480px) */
@media (max-width: 480px) {
  .technical-left-panel {
    min-height: 45vh;
    padding: 6px;
  }
  
  .technical-right-panel {
    padding: 8px;
    min-height: 45vh;
  }
  
  .section-header {
    font-size: 10px;
    padding: 6px 10px;
  }
  
  .section-content pre {
    font-size: 9px;
    padding: 6px;
  }
  
  .trace-table {
    font-size: 8px;
  }
  
  .trace-table th,
  .trace-table td {
    padding: 3px 4px;
  }
}