/* Resizable panels CSS for JSON:API Explorer */

.explorer-panels-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 500px;
  margin-bottom: 20px;
  border: 1px solid var(--explorer-border);
  border-radius: 8px;
  background-color: var(--explorer-background);
}

/* Panel Container */
.explorer-panel {
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 200px;
  background-color: var(--explorer-background);
}

/* Panel Header */
.explorer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--explorer-border);
  background-color: var(--explorer-background-secondary);
  font-size: 14px;
  font-weight: 600;
}

/* Panel Content */
.explorer-panel-content {
  display: flex;
  overflow: visible;
  flex: 1;
  flex-direction: column;
  min-height: 0; /* Important for nested flex containers */
  max-height: none;
  padding: 16px;
}

/* Tab content section needs to flex-grow */
.tab-content-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* Field selector container needs to flex-grow */
.field-selector.form-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

/* Ensure the available fields container can grow */
.available-fields {
  display: flex !important;
  flex: 1 !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 0 !important;
}

/* Panel Resizer */
.panel-resizer {
  position: relative;
  z-index: 1;
  width: 10px;
  margin: 0 -5px;
  cursor: col-resize;
  transition: background-color 0.2s;
  background-color: transparent;
}

.panel-resizer:hover,
.panel-resizer[data-resize-handle-active="true"] {
  background-color: var(--explorer-primary-light);
}

.panel-resizer::after {
  position: absolute;
  top: 0;
  right: 4px;
  bottom: 0;
  left: 4px;
  content: "";
  border-radius: 1px;
  background-color: var(--explorer-border);
}

/* Specific Panel Styling */
.explorer-panel-sidebar {
  border-right: 1px solid var(--explorer-border);
  background-color: var(--explorer-background-secondary);
}

.explorer-panel-builder {
  border-right: 1px solid var(--explorer-border);
}

.explorer-panel-response {
  background-color: var(--explorer-background-tertiary);
}

/* Scrollbar styling */
.explorer-panel-content::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.explorer-panel-content::-webkit-scrollbar-track {
  background: transparent;
}

.explorer-panel-content::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: rgba(0, 0, 0, 0.2);
}

.explorer-panel-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

/* Dark mode scrollbar */
body.gin--dark-mode .explorer-panel-content::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
}

body.gin--dark-mode .explorer-panel-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* Toolbar */
.explorer-toolbar {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--explorer-border);
  background-color: var(--explorer-background-secondary);
}

.explorer-toolbar-button {
  display: flex;
  align-items: center;
  margin-right: 8px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
  border: 2px solid var(--explorer-primary);
  border-radius: 4px;
  background-color: var(--explorer-primary);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  font-size: 13px;
  font-weight: 600;
}

.explorer-toolbar-button:hover,
.explorer-toolbar-button:focus {
  color: white;
  border-color: var(--explorer-primary-hover);
  background-color: var(--explorer-primary-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.explorer-toolbar-button svg {
  margin-right: 4px;
}

/* URL display container - always visible above tabs */
.url-display-container {
  padding: 10px 16px;
  border-bottom: 1px solid var(--explorer-border);
  background-color: var(--explorer-background-secondary);
}

/* URL display in the toolbar */
.explorer-url-display {
  overflow: hidden;
  flex: 1;
  margin-left: 8px;
  padding: 6px 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--explorer-text);
  border: 1px solid var(--explorer-border);
  border-radius: 4px;
  background-color: var(--explorer-background);
  font-family: var(--explorer-code-font-family);
  font-size: 13px;
}

/* Fold everything button */
.fold-button {
  margin-left: auto;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--explorer-text-secondary);
  border: none;
  background: none;
  font-size: 12px;
}

.fold-button:hover {
  color: var(--explorer-primary);
}

/* Tab layout for query panel */
.query-panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--explorer-border);
  background-color: var(--explorer-background-secondary);
}

.query-panel-tab {
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--explorer-text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-size: 13px;
  font-weight: 600;
}

.query-panel-tab.active {
  color: var(--explorer-primary);
  border-bottom-color: var(--explorer-primary);
  background-color: transparent;
}

.query-panel-tab:hover:not(.active) {
  color: var(--explorer-text);
  background-color: rgba(0, 0, 0, 0.03);
}

body.gin--dark-mode .query-panel-tab:hover:not(.active) {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Path breadcrumbs */
.path-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
  padding: 4px 8px;
  border-radius: 4px;
  background-color: var(--explorer-background-tertiary);
  font-family: var(--explorer-code-font-family);
  font-size: 12px;
}

.path-breadcrumb-item {
  color: var(--explorer-text-secondary);
}

.path-breadcrumb-separator {
  margin: 0 4px;
  color: var(--explorer-text-secondary);
}

.path-breadcrumb-item.active {
  color: var(--explorer-primary);
  font-weight: 600;
}

/* JSON object in response panel */
.response-json-container {
  overflow: auto;
  height: 100%;
}

/* Save view toggles */
.save-view-container {
  display: flex;
  margin-top: 12px;
  padding: 8px;
  border-radius: 4px;
  background-color: var(--explorer-background-secondary);
  font-size: 12px;
}

.save-view-button {
  padding: 2px 8px;
  cursor: pointer;
  color: var(--explorer-primary);
  border: none;
  border-radius: 4px;
  background: none;
  font-weight: 500;
}

.save-view-button:hover {
  background-color: var(--explorer-primary-light);
}

/* Settings panel */
.settings-panel {
  padding: 12px;
  border-top: 1px solid var(--explorer-border);
  font-size: 12px;
}

.settings-title {
  margin-bottom: 8px;
  color: var(--explorer-text);
  font-weight: 600;
}

.settings-option {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.settings-option label {
  margin-left: 6px;
  color: var(--explorer-text-secondary);
}

/* Small helper displays */
.params-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  color: var(--explorer-primary);
  border-radius: 12px;
  background-color: var(--explorer-primary-light);
  font-size: 11px;
  font-weight: 600;
}

.params-badge-count {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  text-align: center;
  color: white;
  border-radius: 50%;
  background-color: var(--explorer-primary);
  font-size: 10px;
  line-height: 16px;
}

/* Entity type selector in left panel */
.entity-panel {
  margin-bottom: 16px;
}

.entity-select {
  width: 100%;
  margin-bottom: 8px;
}

/* GraphiQL-style response stats */
.response-stats {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--explorer-text-secondary);
  border-top: 1px solid var(--explorer-border);
  font-size: 11px;
  gap: 12px;
}

.response-stat-item {
  display: flex;
  align-items: center;
}

.response-stat-icon {
  width: 14px;
  height: 14px;
  margin-right: 4px;
  opacity: 0.7;
}

/* Adjusting the panels for smaller screens */
@media (max-width: 992px) {
  .explorer-panels-layout {
    flex-direction: column;
    height: auto;
  }

  .panel-resizer {
    width: 100%;
    height: 10px;
    margin: -5px 0;
    cursor: row-resize;
  }

  .panel-resizer::after {
    top: 4px;
    right: 0;
    bottom: 4px;
    left: 0;
  }
}
