/* Graphing Calculator - Self-contained WordPress Plugin Styles */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

.gc-root {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8f9fa;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  border: 1px solid #e5e7eb;
}

/* Function inputs */
.gc-inputs {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.gc-fn-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

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

.gc-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gc-fn-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #9ca3af;
  flex-shrink: 0;
}

.gc-fn-input {
  flex: 1;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: #1f2937;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gc-fn-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.gc-fn-input::placeholder { color: #d1d5db; }

.gc-btn-remove {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gc-btn-remove:hover { background: #fee2e2; color: #ef4444; }

.gc-add-fn {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  background: none;
  border: none;
  color: #6366f1;
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s;
}

.gc-add-fn:hover { color: #4f46e5; }

.gc-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: #ef4444;
}

/* Toolbar */
.gc-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  flex-wrap: wrap;
}

.gc-toolbar-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-family: 'Space Grotesk', sans-serif;
  color: #4b5563;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}

.gc-toolbar-btn:hover { background: #e5e7eb; color: #1f2937; }
.gc-toolbar-btn.active { background: #6366f1; color: #fff; border-color: #6366f1; }

.gc-toolbar-sep {
  width: 1px;
  height: 20px;
  background: #e5e7eb;
  margin: 0 4px;
}

/* Canvas */
.gc-canvas-wrap {
  position: relative;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
}

.gc-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.gc-range-label {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(107,114,128,0.7);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(229,231,235,0.5);
  pointer-events: none;
}

/* Keypad */
.gc-keypad-wrap {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
}

.gc-keypad-toggle {
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  transition: background 0.15s;
}

.gc-keypad-toggle:hover { background: #f9fafb; }

.gc-keypad {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 12px;
}

.gc-key {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  text-align: center;
  transition: all 0.1s;
  user-select: none;
}

.gc-key:hover { background: #e5e7eb; }
.gc-key:active { background: #d1d5db; transform: scale(0.95); }
.gc-key.gc-key-fn { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.gc-key.gc-key-fn:hover { background: #e0e7ff; }
.gc-key.gc-key-op { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.gc-key.gc-key-op:hover { background: #dcfce7; }
.gc-key.gc-key-clear { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.gc-key.gc-key-clear:hover { background: #fee2e2; }

/* Values table */
.gc-table-wrap {
  border-top: 1px solid #e5e7eb;
  background: #ffffff;
  max-height: 200px;
  overflow-y: auto;
}

.gc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.gc-table th {
  background: #f9fafb;
  padding: 6px 12px;
  text-align: left;
  color: #6b7280;
  font-weight: 500;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
}

.gc-table td {
  padding: 4px 12px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.gc-table tr:hover td { background: #f9fafb; }

/* Responsive */
@media (max-width: 600px) {
  .gc-keypad { grid-template-columns: repeat(4, 1fr); }
  .gc-toolbar { gap: 2px; padding: 6px 10px; }
  .gc-toolbar-btn { padding: 5px 8px; font-size: 11px; }
  .gc-inputs { padding: 10px; }
}
