:root {
  --background: #ffffff;
  --foreground: #111827;
  --muted: #f3f4f6;
  --muted-foreground: #6b7280;
  --border: #e5e7eb;
  --primary: #4f46e5;
  --primary-foreground: #ffffff;
  --accent: #eff6ff;
  --accent-foreground: #1d4ed8;
  --radius: 0.5rem;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-sans);
  background-color: #f9fafb; /* Light gray background for the whole page */
  color: var(--foreground);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Header */
.main-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--foreground);
  text-decoration: none;
  letter-spacing: -0.025em;
}

.logo-icon {
  font-size: 1.5rem;
}

.tool-list-dropdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--foreground);
  cursor: pointer;
}

/* Wallet Connect Button Styling Override */
.header-right button {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: white;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: 9999px; /* Pill shape */
  border: none;
  transition: opacity 0.2s;
}

.header-right button:hover {
  opacity: 0.9;
}

/* Main Content */
main {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 4rem 0 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.hero-section h1 {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: #111827;
}

.hero-section p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: #f3f4f6;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: #e5e7eb;
}

.filter-btn.active {
  background: #1f2937;
  color: white;
}

.search-container {
  position: relative;
  width: 300px;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.875rem;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  outline: none;
}

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

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s;
  text-decoration: none;
  height: 100%;
  box-sizing: border-box;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: #d1d5db;
}

.card-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #111827;
}

.card-content p {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  margin-top: 1.5rem;
}

.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: #eff6ff;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  text-transform: uppercase;
}

/* Specific tag colors (optional) */
.tag:nth-child(2n) {
  background: #fdf2f8;
  color: #db2777;
}

/* Responsive */
@media (max-width: 768px) {
  .main-header {
    padding: 1rem;
  }
  
  .header-left {
    gap: 1rem;
  }
  
  .tool-list-dropdown {
    display: none;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-container {
    width: 100%;
  }
}

/* Wallet Connection Styles */
.wallet-connected-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 0.25rem 0.25rem 0.25rem 1rem;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wallet-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.info-label {
  color: var(--muted-foreground);
  font-weight: 500;
}

.info-value {
  color: var(--foreground);
  font-weight: 600;
}

.info-value.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.info-divider {
  width: 1px;
  height: 1rem;
  background-color: var(--border);
}

.disconnect-btn {
  background-color: #f3f4f6 !important;
  color: #4b5563 !important;
  border: 1px solid transparent !important;
  font-size: 0.75rem !important;
  padding: 0.375rem 0.75rem !important;
  height: auto !important;
  border-radius: 9999px !important;
  font-weight: 600 !important;
  transition: all 0.2s;
}

.disconnect-btn:hover {
  background-color: #e5e7eb !important;
  color: #111827 !important;
}

/* Tool Page Layout */
.tool-page-container {
  max-width: 1000px;
  margin: 0 auto;
}

.tool-header {
  margin-bottom: 2rem;
}

.tool-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.tool-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

/* Card Styles (Vercel/Stripe style) */
.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.card-body {
  padding: 2rem;
}

/* Controls */
.control-panel {
  display: flex;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.input-group {
  flex: 1;
  max-width: 250px;
}

.input-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 0.5rem;
}

.input-field {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.25rem;
  color: var(--foreground);
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.button-group {
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  line-height: 1.25rem;
}

.btn-primary {
  background-color: #111827; /* Vercel Black */
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

.btn-secondary {
  background-color: #ffffff;
  color: #374151;
  border-color: var(--border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Results Table */
.results-container {
  max-height: 600px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.results-table th {
  text-align: left;
  padding: 0.875rem 1.25rem;
  background-color: #f9fafb;
  color: #4b5563;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.results-table td {
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--border);
  color: #111827;
}

.results-table tr:last-child td {
  border-bottom: none;
}

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

.font-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.blur-key {
  filter: blur(4px);
  transition: filter 0.2s;
  cursor: pointer;
  user-select: all;
}

.blur-key:hover {
  filter: none;
}

.empty-state {
  padding: 3rem;
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.9375rem;
}

.disconnect-btn:hover {
  background-color: #fecaca !important;
  color: #dc2626 !important;
}


/* Form Utilities */
.form-section {
  max-width: 600px;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
}

.checkbox-input {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  margin-right: 0.75rem;
  cursor: pointer;
  accent-color: #111827;
}

.font-medium {
  font-weight: 500;
}

.cursor-pointer {
  cursor: pointer;
}

textarea.input-field {
  min-height: 150px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.input-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%; /* Override previous max-width if needed */
}

/* Grid Utilities */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.justify-end {
  justify-content: flex-end;
}
