/* Maya 2.0 ULTRA - Tools View */
.tools-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tools-search {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 400px;
}

.tools-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  font-size: var(--text-sm);
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.tools-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
  outline: none;
}

.tools-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
}

.tools-category-filter {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.category-filter-btn {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.category-filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.category-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
}

.tool-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.tool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--space-4);
  gap: var(--space-3);
}

.tool-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tool-card-icon svg {
  width: 20px;
  height: 20px;
}

.tool-card-info {
  flex: 1;
  min-width: 0;
}

.tool-card-name {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.tool-card-category {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.tool-card-toggle {
  flex-shrink: 0;
}

.tool-card-body {
  padding: 0 var(--space-4) var(--space-4);
}

.tool-card-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}

.tool-card-stats {
  display: flex;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

.tool-card-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.tool-card-stat-value {
  font-weight: 600;
  color: var(--text-secondary);
}

.tool-card-footer {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

.tool-test-btn {
  flex: 1;
}

.tool-test-btn svg {
  width: 16px;
  height: 16px;
}

/* Tool tester panel */
.tool-tester {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-modal);
  display: flex;
  flex-direction: column;
  animation: slideInRight var(--transition) ease-out;
}

.tool-tester-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tool-tester-title {
  font-size: var(--text-lg);
  font-weight: 600;
}

.tool-tester-body {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: var(--space-5);
}

.tool-tester-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.tool-tester-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.tool-tester-input {
  width: 100%;
  min-height: 120px;
  padding: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  resize: vertical;
  transition: all var(--transition-fast);
}

.tool-tester-input:focus {
  border-color: var(--border-focus);
  box-shadow: var(--focus-ring);
  outline: none;
}

.tool-tester-result {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  max-height: 300px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.tool-tester-result.error {
  border-color: var(--error);
  background: var(--error-light);
  color: var(--error);
}

.tool-tester-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Tool logs */
.tools-logs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tools-logs-table {
  width: 100%;
}

.tools-logs-table th,
.tools-logs-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.tools-logs-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.tools-logs-table tbody tr:hover {
  background: var(--bg-secondary);
}

.tools-logs-table td {
  font-size: var(--text-sm);
}

.tools-logs-table .tool-name {
  font-weight: 500;
  color: var(--text-primary);
}

.tools-logs-table .metric {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
  .tools-header {
    flex-direction: column;
    align-items: stretch;
  }
  .tools-search {
    max-width: none;
  }
  .tool-tester {
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
}