/* public/config.css */
.config-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  justify-content: space-between;
  align-items:  center;
  padding: 1rem 1.5rem;
}

.header-left {
  display: flex;
  align-items:  center;
  gap: 2rem;
}

.config-header h1 {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-text-fill-color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-tabs {
  display: flex;
  gap: .5rem;
}

.nav-tab {
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  padding: .5rem 1rem;
  transition: all .2s;
  font-size: .875rem;
}

.header-actions {
  display: flex;
  align-items:  center;
  gap: .75rem;
}

.file-toggle {
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  display: none;
  border-radius: 6px;
  padding: .45rem .85rem;
  font-size: .8125rem;
}

.file-toggle:hover {
  background: var(--bg-secondary);
}

.nav-tab:hover, .nav-tab.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.config-container {
  display: flex;
  overflow: hidden;
  flex: 1;
}

.file-sidebar {
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  display: flex;
  overflow: hidden;
  flex-direction: column;
  width: 280px;
}

.file-sidebar h2 {
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
}

.file-list {
  overflow-y: auto;
  flex: 1;
  padding: .5rem;
}

.file-list .loading {
  color: var(--text-secondary);
  padding: 1rem;
  font-size: .875rem;
}

.file-item {
  cursor: pointer;
  border-radius: 6px;
  margin-bottom: .25rem;
  padding: .75rem 1rem;
  transition: all .2s;
}

.file-item:hover {
  background: var(--bg-tertiary);
}

.file-item.active {
  background: var(--accent);
  color: #fff;
}

.file-item-name {
  margin-bottom: .25rem;
  font-size: .875rem;
  font-weight: 500;
}

.file-item-path {
  color: var(--text-secondary);
  opacity: .8;
  font-size: .75rem;
}

.file-item.active .file-item-path {
  color: #ffffffb3;
}

.file-content {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  flex: 1;
}

.no-file {
  display: flex;
  color: var(--text-secondary);
  flex: 1;
  justify-content: center;
  align-items:  center;
}

.file-editor {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  flex: 1;
}

.editor-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  justify-content: space-between;
  align-items:  center;
  padding: 1rem 1.5rem;
}

.file-info h2 {
  margin-bottom: .25rem;
  font-size: 1rem;
  font-weight: 600;
}

.file-path {
  color: var(--text-secondary);
  font-family: Fira Code, SF Mono, Monaco, monospace;
  font-size: .75rem;
}

.editor-actions {
  display: flex;
  gap: .75rem;
}

.save-btn {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: .5rem 1rem;
  transition: all .2s;
  font-size: .875rem;
  font-weight: 500;
}

.save-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.save-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.file-textarea {
  background: var(--bg-primary);
  color: var(--text-primary);
  resize: none;
  outline: none;
  border: none;
  flex: 1;
  padding: 1.5rem;
  font-family: Fira Code, SF Mono, Monaco, Cascadia Code, monospace;
  font-size: .875rem;
  line-height: 1.6;
}

.save-status {
  color: var(--text-secondary);
  min-height: 1.5rem;
  padding: .5rem 1.5rem;
  font-size: .75rem;
}

.save-status.success {
  color: var(--green);
}

.save-status.error {
  color: var(--error);
}

@media (width <= 768px) {
  .config-container {
    position: relative;
    flex-direction: column;
  }

  .file-toggle {
    display: inline-flex;
  }

  .file-sidebar {
    position: fixed;
    border-right: 1px solid var(--border);
    z-index: 20;
    border-bottom: none;
    width: 85vw;
    max-width: 360px;
    max-height: none;
    transition: transform .2s;
    top: 64px;
    bottom: 0;
    left: 0;
    transform: translateX(-110%);
    box-shadow: 8px 0 24px #0000004d;
  }

  #config-view.sidebar-open .file-sidebar {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    z-index: 10;
    background: #00000059;
    inset: 0;
  }

  .sidebar-overlay.hidden {
    display: none;
  }

  .file-list {
    padding: .75rem;
  }

  .file-item {
    padding: .85rem 1rem;
  }

  .file-item-path {
    word-break: break-all;
  }

  .header-left {
    flex-direction: column;
    align-items:  flex-start;
    gap: .5rem;
  }
}
