/* === GarethAPI.com Design Language - MCP Designer Web-Deploy === */

/* === Design Tokens === */
:root {
  --gapi-brown:  #46350A; /* Hero/headers, brand background */
  --gapi-purple: #DDBBFF; /* GarethAPI.com brand highlight */
  --gapi-orange: #FF9100; /* Accents, notices */
  --gapi-red:    #C61C00; /* Errors/warnings */
  --gapi-green:  #0B4000; /* Success/confirmation, footers */
  --gapi-violet: #6400FF; /* Tool titles (e.g. API Designer) */
  --gapi-white:  #FFFFFF; /* Background */
  --gapi-black:  #000000; /* Text */

  --gapi-font-heading: 'Madimi One', sans-serif;
  --gapi-font-body: 'Hanken Grotesk', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  --gapi-font-accent: 'Neuton', Georgia, 'Times New Roman', serif;

  /* Layout variables */
  --shadow: 0 5px 18px rgba(0,0,0,.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,.1);
  --radius: 16px;
  --line: #e6e1db;
}

/* === Local Font Faces === */
@font-face {
  font-family: 'Madimi One';
  src: url('fonts/MadimiOne-Regular.ttf?v=2') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Neuton';
  src: url('fonts/Neuton-Regular.ttf?v=2') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* === Core Elements === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  scroll-behavior: smooth !important;
}

body {
  font-family: var(--gapi-font-accent) !important;
  background: #f8f9fa !important;
  color: var(--gapi-black) !important;
  line-height: 1.6;
  font-size: 16px;
}

/* === Typography === */
h1 {
  font-family: var(--gapi-font-heading) !important;
  font-size: clamp(36px, 5vw, 60px);
  color: var(--gapi-violet) !important;
  font-weight: 400 !important;
  margin: 0 0 6px;
  letter-spacing: 0.1em;
}

h2, h3, h4, h5, h6 {
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet) !important;
  margin: 24px 0 16px 0;
  font-weight: 400 !important;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gapi-violet);
}

h2 {
  font-size: 1.8rem;
  margin-top: 0;
}

h3 {
  font-size: 1.4rem;
}

h4 {
  font-size: 1.2rem;
}

p {
  margin: 12px 0;
  line-height: 1.6;
  color: var(--gapi-black);
}

.subtitle {
  margin: 0 0 16px;
  color: var(--gapi-black);
  letter-spacing: 0.02em;
  font-family: var(--gapi-font-body) !important;
}

/* === Layout === */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* === Header - API Designer Style === */
.header {
  background: var(--gapi-white) !important;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin: 20px;
  margin-bottom: 30px;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header .logo {
  flex: 1;
}

.logo h1 {
  color: #0100A5 !important;
  font-size: 2rem;
  margin-bottom: 5px;
  letter-spacing: normal !important;
}

.logo p {
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-black) !important;
  font-size: 1rem;
}

.header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* === Cards === */
.panel {
  background: var(--gapi-white);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.panel.reading {
  background: var(--gapi-white);
}

/* === MCP Designer Specific Layout === */
.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px;
}

/* === Two-Column Grid Layout === */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px;
}

.content-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.content-row:last-child {
  margin-bottom: 0;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gapi-violet);
}

.panel-header h3 {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet) !important;
  font-size: 1.4rem;
}

.panel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-green);
  font-weight: 600;
}

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

.panel-body {
  margin-top: 20px;
}

.input-section {
  margin-bottom: 24px;
}

.input-section label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  color: var(--gapi-black);
  font-size: 1rem;
}

.input-section textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: var(--gapi-font-accent) !important;
  font-size: 1rem;
  background: var(--gapi-white);
  color: var(--gapi-black);
  transition: border-color 0.2s ease;
  resize: vertical;
  min-height: 120px;
}

.input-section textarea:focus {
  outline: none;
  border-color: var(--gapi-violet);
  box-shadow: 0 0 0 3px rgba(100, 0, 255, 0.1);
}

.input-hint {
  margin-top: 8px;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
  font-size: 0.9rem;
  font-style: italic;
}

.file-upload-area {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  background: #f8f9fa;
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 16px;
}

.file-upload-area:hover {
  border-color: var(--gapi-violet);
  background: rgba(100, 0, 255, 0.05);
}

.file-upload-area.dragover {
  border-color: var(--gapi-violet);
  background: rgba(100, 0, 255, 0.1);
}

.file-upload-area i {
  font-size: 2rem;
  color: var(--gapi-violet);
  margin-bottom: 12px;
  display: block;
}

.file-upload-area p {
  margin: 0;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
}

.file-info {
  background: #e8f5e8;
  border: 1px solid var(--gapi-green);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.file-info h4 {
  margin: 0 0 12px 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-green);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.8rem;
}

.btn-large {
  padding: 16px 32px;
  font-size: 1.1rem;
}

.thinking-indicator {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(100, 0, 255, 0.1);
  border-radius: 8px;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-violet);
}

.thinking-indicator.show {
  display: flex;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dot {
  width: 8px;
  height: 8px;
  background: var(--gapi-violet);
  border-radius: 50%;
  animation: thinking-pulse 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes thinking-pulse {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.suggestions-list {
  min-height: 200px;
}

.no-suggestions {
  text-align: center;
  padding: 40px 20px;
  color: var(--gapi-black);
}

.no-suggestions i {
  font-size: 3rem;
  color: var(--gapi-violet);
  margin-bottom: 16px;
  display: block;
}

.no-suggestions h4 {
  margin: 0 0 12px 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet);
}

.no-suggestions p {
  margin: 0;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
}

.catalogue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gapi-violet);
}

.catalogue-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.catalogue-header h3 {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet) !important;
  font-size: 1.4rem;
}

.catalogue-count {
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
  font-weight: 600;
  background: rgba(100, 0, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.catalogue-content {
  min-height: 200px;
}

/* Intent Cards */
.intent-item {
  background: var(--gapi-white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.intent-item:hover {
  border-color: var(--gapi-violet);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.intent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.intent-verb {
  font-family: var(--gapi-font-body);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gapi-violet);
  text-transform: capitalize;
}

.intent-confidence {
  font-family: var(--gapi-font-accent);
  font-size: 0.9rem;
  color: var(--gapi-black);
  background: rgba(100, 0, 255, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.intent-purpose {
  font-family: var(--gapi-font-accent);
  color: var(--gapi-black);
  line-height: 1.5;
  margin-bottom: 16px;
}

.intent-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Intent Chips (in catalogue) */
.intent-chip {
  display: inline-flex;
  align-items: center;
  background: var(--gapi-white);
  border: 2px solid var(--gapi-violet);
  border-radius: 25px;
  padding: 8px 16px;
  margin: 4px 8px 4px 0;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.intent-chip:hover {
  background: var(--gapi-violet);
  color: var(--gapi-white);
}

.intent-chip .intent-verb {
  font-family: var(--gapi-font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gapi-violet);
  margin-right: 8px;
}

.intent-chip:hover .intent-verb {
  color: var(--gapi-white);
}

.intent-chip .btn-brief,
.intent-chip .btn-remove {
  background: none;
  border: none;
  color: var(--gapi-violet);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.intent-chip .btn-brief:hover,
.intent-chip .btn-remove:hover {
  background: rgba(100, 0, 255, 0.1);
}

.intent-chip:hover .btn-brief,
.intent-chip:hover .btn-remove {
  color: var(--gapi-white);
}

/* Suggestion Items */
.suggestion-item {
  background: var(--gapi-white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
}

.suggestion-item:hover {
  border-color: var(--gapi-orange);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.suggestion-item.selected {
  border-color: var(--gapi-violet);
  background: rgba(100, 0, 255, 0.05);
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.suggestion-verb {
  font-family: var(--gapi-font-body);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gapi-violet);
  text-transform: capitalize;
}

.suggestion-confidence {
  font-family: var(--gapi-font-accent);
  font-size: 0.9rem;
  color: var(--gapi-black);
  background: rgba(255, 145, 0, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.suggestion-purpose {
  font-family: var(--gapi-font-accent);
  color: var(--gapi-black);
  line-height: 1.5;
  margin-bottom: 16px;
}

.suggestion-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.no-intents {
  text-align: center;
  padding: 40px 20px;
  color: var(--gapi-black);
}

.no-intents i {
  font-size: 3rem;
  color: var(--gapi-violet);
  margin-bottom: 16px;
  display: block;
}

.no-intents h4 {
  margin: 0 0 12px 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet);
}

.no-intents p {
  margin: 0;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
}

.tool-specs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gapi-violet);
}

.tool-specs-header h3 {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet) !important;
  font-size: 1.4rem;
}

.tool-specs-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.tool-specs-content {
  min-height: 200px;
}

.no-specs {
  text-align: center;
  padding: 40px 20px;
  color: var(--gapi-black);
}

.no-specs i {
  font-size: 3rem;
  color: var(--gapi-violet);
  margin-bottom: 16px;
  display: block;
}

.no-specs h4 {
  margin: 0 0 12px 0;
  border-bottom: none;
  padding-bottom: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet);
}

.no-specs p {
  margin: 0;
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 4px;
  background: var(--gapi-white);
  color: var(--gapi-violet);
  border: 2px solid var(--gapi-violet);
}

.btn-primary {
  background: var(--gapi-violet);
  color: var(--gapi-white);
  border: 2px solid var(--gapi-violet);
}

.btn-primary:hover {
  background: #5a00e6;
  border-color: #5a00e6;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gapi-green);
  color: var(--gapi-white);
  border: 2px solid var(--gapi-green);
}

.btn-secondary:hover {
  background: #0a3500;
  border-color: #0a3500;
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--gapi-white);
  color: var(--gapi-violet);
  border: 2px solid var(--gapi-violet);
}

.btn-outline:hover {
  background: var(--gapi-violet);
  color: var(--gapi-white);
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* === Form Elements === */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: var(--gapi-font-accent) !important;
  font-size: 1rem;
  background: var(--gapi-white);
  color: var(--gapi-black);
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gapi-violet);
  box-shadow: 0 0 0 3px rgba(100, 0, 255, 0.1);
}

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

/* === Status Messages === */
.status-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-family: var(--gapi-font-accent) !important;
}

.status-message.success {
  background: #e8f5e8;
  color: var(--gapi-green);
  border-left: 4px solid var(--gapi-green);
}

.status-message.error {
  background: #ffeaea;
  color: var(--gapi-red);
  border-left: 4px solid var(--gapi-red);
}

.status-message.warning {
  background: #fff3cd;
  color: var(--gapi-orange);
  border-left: 4px solid var(--gapi-orange);
}

.status-message.info {
  background: #d1ecf1;
  color: var(--gapi-violet);
  border-left: 4px solid var(--gapi-violet);
}

/* === File Upload === */
.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  background: #f8f9fa;
  transition: all 0.2s ease;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: var(--gapi-violet);
  background: rgba(100, 0, 255, 0.05);
}

.drop-zone.dragover {
  border-color: var(--gapi-violet);
  background: rgba(100, 0, 255, 0.1);
}

/* === Tree Structure === */
.tree-node {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--gapi-white);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tree-node:hover {
  background: #f8f9fa;
  border-color: var(--gapi-violet);
}

.tree-node.selected {
  background: rgba(100, 0, 255, 0.1);
  border-color: var(--gapi-violet);
}

.tree-children {
  margin-left: 20px;
  border-left: 2px solid var(--line);
  padding-left: 16px;
}

/* === Modal Styles === */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  background: var(--gapi-white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(139, 69, 19, 0.1);
  margin: 5% auto;
  position: relative;
}

.modal-content.modal-large {
  max-width: 900px;
  width: 95%;
}

.modal-header {
  background: linear-gradient(135deg, var(--gapi-violet), var(--gapi-purple));
  color: var(--gapi-white);
  padding: 25px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gapi-white) !important;
  font-family: var(--gapi-font-body) !important;
}

.modal-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gapi-white);
  padding: 8px;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  background: #fafafa;
}

.modal-body p {
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
  margin-bottom: 20px;
  font-size: 1rem;
  line-height: 1.6;
}

.modal-footer {
  padding: 25px 30px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  background: var(--gapi-white);
}

/* Button styling in modal */
.modal-footer .btn {
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-family: var(--gapi-font-body) !important;
}

.modal-footer .btn-primary {
  background: var(--gapi-green);
  color: var(--gapi-white);
  border: none;
}

.modal-footer .btn-primary:hover:not(:disabled) {
  background: var(--gapi-orange);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.modal-footer .btn-primary:disabled {
  background: var(--line);
  color: var(--gapi-black);
  cursor: not-allowed;
  opacity: 0.6;
}

.modal-footer .btn-outline {
  background: var(--gapi-white);
  color: var(--gapi-violet);
  border: 2px solid var(--gapi-violet);
}

.modal-footer .btn-outline:hover {
  background: var(--gapi-violet);
  color: var(--gapi-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.2);
}

/* === Node Selection Modal Specific Styles === */
.node-modal-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  height: 100%;
}

.node-selection-panel {
  display: flex;
  flex-direction: column;
}

.node-search {
  margin-bottom: 20px;
}

.node-search input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  font-family: var(--gapi-font-accent) !important;
  font-size: 1rem;
  background: var(--gapi-white);
  color: var(--gapi-black);
  transition: border-color 0.2s ease;
}

.node-search input:focus {
  outline: none;
  border-color: var(--gapi-violet);
  box-shadow: 0 0 0 3px rgba(100, 0, 255, 0.1);
}

.node-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--line);
}

.tab-button {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--gapi-black);
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.tab-button.active {
  color: var(--gapi-violet);
  border-bottom-color: var(--gapi-violet);
}

.tab-button:hover {
  color: var(--gapi-violet);
  background: rgba(100, 0, 255, 0.05);
}

.tab-panel {
  display: none;
  flex: 1;
  flex-direction: column;
}

.tab-panel.active {
  display: flex;
}

.selected-nodes-panel {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--line);
  padding-left: 20px;
}

.selected-nodes-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gapi-violet);
}

.selected-nodes-header h4 {
  margin: 0;
  font-family: var(--gapi-font-body) !important;
  color: var(--gapi-violet);
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: none;
  padding-bottom: 0;
}

.node-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--gapi-white);
  display: flex;
  flex-direction: column;
}

.node-item {
  display: flex;
  align-items: flex-start;
  padding: 16px;
  border: none;
  border-radius: 0;
  margin-bottom: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  background: var(--gapi-white);
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}

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

.node-item:hover {
  background: rgba(100, 0, 255, 0.05);
  box-shadow: none;
  transform: none;
}

.node-item.selected {
  background: rgba(100, 0, 255, 0.1);
  border-left: 4px solid var(--gapi-violet);
}

/* Node Selection Modal Checkboxes - Force Override Browser Defaults */
.node-list .node-item input[type="checkbox"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 20px !important;
  height: 20px !important;
  border: 2px solid var(--line) !important;
  border-radius: 4px !important;
  background: var(--gapi-white) !important;
  cursor: pointer !important;
  position: relative !important;
  transition: all 0.2s ease !important;
  flex-shrink: 0 !important;
  margin-right: 16px !important;
  margin-top: 2px !important;
  outline: none !important;
  box-shadow: none !important;
}

.node-list .node-item input[type="checkbox"]:hover {
  border-color: var(--gapi-violet) !important;
  box-shadow: 0 0 0 2px rgba(100, 0, 255, 0.1) !important;
}

.node-list .node-item input[type="checkbox"]:checked {
  background: var(--gapi-violet) !important;
  border-color: var(--gapi-violet) !important;
}

.node-list .node-item input[type="checkbox"]:checked::after {
  content: '✓' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: var(--gapi-white) !important;
  font-size: 14px !important;
  font-weight: bold !important;
  font-family: var(--gapi-font-body) !important;
  line-height: 1 !important;
  display: block !important;
}

.node-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.node-title {
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  color: var(--gapi-violet);
  margin-bottom: 8px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.node-type {
  font-family: var(--gapi-font-body) !important;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-block;
}

/* Node type specific colors */
.node-type.product,
.node-type.PRODUCT {
  background: rgba(100, 0, 255, 0.1);
  color: var(--gapi-violet);
}

.node-type.work_item,
.node-type.WORK_ITEM,
.node-type.work-item,
.node-type.WORK-ITEM {
  background: rgba(255, 145, 0, 0.1);
  color: var(--gapi-orange);
}

.node-type.job,
.node-type.JOB {
  background: rgba(11, 64, 0, 0.1);
  color: var(--gapi-green);
}

.node-type.goal,
.node-type.GOAL {
  background: rgba(221, 187, 255, 0.1);
  color: var(--gapi-purple);
}

.node-type.other,
.node-type.OTHER {
  background: rgba(198, 28, 0, 0.1);
  color: var(--gapi-red);
}

.node-description {
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.selected-nodes {
  flex: 1;
  overflow-y: auto;
}

.selected-nodes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.selected-node-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--gapi-white);
  border-radius: 8px;
  border: 1px solid var(--line);
  transition: all 0.2s ease;
}

.selected-node-item:hover {
  border-color: var(--gapi-violet);
  box-shadow: 0 2px 8px rgba(100, 0, 255, 0.1);
}

.selected-node-name {
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  color: var(--gapi-violet);
  font-size: 0.95rem;
}

.selected-node-type {
  font-family: var(--gapi-font-body) !important;
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 12px;
}

/* Selected node type specific colors */
.selected-node-type.product,
.selected-node-type.PRODUCT {
  background: rgba(100, 0, 255, 0.1);
  color: var(--gapi-violet);
}

.selected-node-type.work_item,
.selected-node-type.WORK_ITEM,
.selected-node-type.work-item,
.selected-node-type.WORK-ITEM {
  background: rgba(255, 145, 0, 0.1);
  color: var(--gapi-orange);
}

.selected-node-type.job,
.selected-node-type.JOB {
  background: rgba(11, 64, 0, 0.1);
  color: var(--gapi-green);
}

.selected-node-type.goal,
.selected-node-type.GOAL {
  background: rgba(221, 187, 255, 0.1);
  color: var(--gapi-purple);
}

.selected-node-type.other,
.selected-node-type.OTHER {
  background: rgba(198, 28, 0, 0.1);
  color: var(--gapi-red);
}

.remove-node {
  background: var(--gapi-red);
  color: var(--gapi-white);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.remove-node:hover {
  background: #a00;
  transform: scale(1.1);
}

/* === Responsive Design === */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .main-content {
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 15px;
  }
  
  .content-row {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 15px;
  }
  
  .header {
    margin: 10px;
    padding: 15px;
  }
  
  .header-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .header-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .logo h1 {
    font-size: 1.5rem;
  }
  
  .panel {
    margin: 10px 0;
    padding: 15px;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .modal-content {
    width: 95%;
    margin: 10% auto;
  }
}

/* === Export Dropdown === */
.export-dropdown {
  position: relative;
  display: inline-block;
}

.export-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--gapi-white);
  border: 2px solid var(--gapi-violet);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  min-width: 200px;
  margin-top: 4px;
}

.export-menu.show {
  display: block;
}

.export-option {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: var(--gapi-white);
  color: var(--gapi-violet);
  text-align: left;
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(100, 0, 255, 0.1);
}

.export-option:last-child {
  border-bottom: none;
}

.export-option:hover {
  background: rgba(100, 0, 255, 0.1);
  color: var(--gapi-violet);
}

.export-option i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

/* === Additional MCP Designer Specific Styles === */
.mcp-server-config {
  background: var(--gapi-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}

.mcp-server-config h4 {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.mcp-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 8px 0;
}

.mcp-endpoint.method {
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.mcp-endpoint.method.get {
  background: var(--gapi-blue);
  color: var(--gapi-white);
}

.mcp-endpoint.method.post {
  background: var(--gapi-green);
  color: var(--gapi-white);
}

.mcp-endpoint.method.put {
  background: var(--gapi-orange);
  color: var(--gapi-white);
}

.mcp-endpoint.method.delete {
  background: var(--gapi-red);
  color: var(--gapi-white);
}

.mcp-tools-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.mcp-tool-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 4px 0;
  background: var(--gapi-white);
}

.mcp-tool-item:hover {
  background: #f8f9fa;
  border-color: var(--gapi-violet);
}

.mcp-tool-name {
  font-family: var(--gapi-font-body) !important;
  font-weight: 600;
  color: var(--gapi-violet);
}

.mcp-tool-description {
  font-family: var(--gapi-font-accent) !important;
  color: var(--gapi-black);
  font-size: 0.9rem;
  margin-top: 4px;
}

.mcp-test-results {
  background: var(--gapi-white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  max-height: 400px;
  overflow-y: auto;
}

.mcp-test-result {
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0;
  font-family: var(--gapi-font-accent) !important;
}

.mcp-test-result.success {
  background: #e8f5e8;
  color: var(--gapi-green);
  border-left: 4px solid var(--gapi-green);
}

.mcp-test-result.error {
  background: #ffeaea;
  color: var(--gapi-red);
  border-left: 4px solid var(--gapi-red);
}

.mcp-test-result.warning {
  background: #fff3cd;
  color: var(--gapi-orange);
  border-left: 4px solid var(--gapi-orange);
}

.mcp-test-result.info {
  background: #d1ecf1;
  color: var(--gapi-violet);
  border-left: 4px solid var(--gapi-violet);
}

.mcp-connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-family: var(--gapi-font-accent) !important;
}

.mcp-connection-status.connected {
  background: #e8f5e8;
  color: var(--gapi-green);
  border-left: 4px solid var(--gapi-green);
}

.mcp-connection-status.disconnected {
  background: #ffeaea;
  color: var(--gapi-red);
  border-left: 4px solid var(--gapi-red);
}

.mcp-connection-status.connecting {
  background: #fff3cd;
  color: var(--gapi-orange);
  border-left: 4px solid var(--gapi-orange);
}

.mcp-connection-status.info {
  background: #d1ecf1;
  color: var(--gapi-violet);
  border-left: 4px solid var(--gapi-violet);
}

.status-indicator {
  font-size: 1.2rem;
  animation: pulse 2s infinite;
}

.status-indicator.connected {
  animation: none;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}