/**
 * MCP Server Directory - Custom CSS
 *
 * Cleaned up to remove:
 * - Redundant classes already defined in tailwind.css
 * - Unused CSS classes
 * - Duplicate styling for components
 */

/* Custom CSS for MCP Servers Directory */

:root {
  /* Primary colors - warm beige palette */
  --primary-color: #D4A373; /* Warm beige */
  --primary-light: #F8F1E9; /* Very light beige */
  --primary-dark: #B88A5E; /* Darker beige */

  /* Secondary colors */
  --secondary-color: #FAEDCD; /* Light warm beige */
  --secondary-light: #FDF8F3; /* Off-white with warm undertone */
  --secondary-dark: #F5DEB3; /* Medium warm beige */

  /* Accent colors */
  --accent-color: #E9D8A6; /* Muted gold */
  --accent-light: #F9F5EB; /* Very light gold */
  --accent-dark: #C9B984; /* Deep gold */

  /* Neutral colors */
  --neutral-light: #FEFCF8; /* Off-white background with warm undertone */
  --neutral-dark: #3D3A34; /* Deep warm charcoal */

  /* Utility colors */
  --success-color: #0E8A6E; /* Green */
  --success-light: #E6F6F2; /* Light green background */
  --danger-color: #CF3919; /* Red */
  --danger-dark: #A62C12; /* Dark red */
  --danger-light: #FBEAE5; /* Light red background */

  /* Text colors */
  --text-dark: #1A1A1A; /* Almost black */
  --text-medium: #4D4D4D; /* Dark gray */
  --text-light: #767676; /* Medium gray */
  --text-white: #FFFFFF; /* White */

  /* Gray scale */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
}

/* Base styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, Cantarell, Ubuntu, roboto, noto, helvetica, arial, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
  background-color: var(--neutral-light);
  margin: 0;
  padding: 0;
}

/* Background colors */
.bg-neutral-light {
  background-color: var(--neutral-light);
}

.bg-neutral-dark {
  background-color: var(--neutral-dark);
}

/* Buttons - improved contrast and visibility with warm colors */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease-in-out;
  background-color: var(--primary-color);
  color: var(--text-white);
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(212, 163, 115, 0.1);
}

.btn:hover {
  background-color: var(--primary-dark);
  color: var(--text-white);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(212, 163, 115, 0.15), 0 2px 4px -1px rgba(212, 163, 115, 0.1);
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--primary-dark);
  border: 1px solid var(--secondary-dark);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  color: var(--primary-dark);
}

.btn-action {
  background-color: var(--danger-color);
  color: var(--text-white);
}

.btn-action:hover {
  background-color: var(--danger-dark);
}

/* Server Card Components - Reusable classes */
.server-card {
  background-color: var(--text-white);
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(212, 163, 115, 0.1);
  transition: all 0.2s ease-in-out;
  border: 1px solid var(--gray-200);
  overflow: hidden;
  height: 100%; /* Ensure all cards take full height of their container */
  display: flex;
  flex-direction: column;
}

.server-card:hover {
  box-shadow: 0 4px 6px -1px rgba(212, 163, 115, 0.1), 0 2px 4px -1px rgba(212, 163, 115, 0.06);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}

.server-card-image {
  height: 10rem; /* 160px */
  background-color: var(--secondary-light);
  position: relative;
  overflow: hidden;
}

.server-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.server-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  color: var(--text-dark);
  transition: color 0.2s ease-in-out;
  height: 2.4em; /* Fixed height for title (2 lines) */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.server-card-description {
  color: var(--text-medium);
  margin-bottom: 1rem;
  height: 3em; /* Fixed height for description (2 lines) */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  flex-shrink: 0;
}

.server-card-features {
  margin-top: auto;
  min-height: 2.5rem; /* Minimum height for feature tags */
  overflow: visible; /* Allow tags to be fully visible */
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
  padding-bottom: 0.5rem; /* Add some padding at the bottom */
}

.server-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(212, 163, 115, 0.2);
  white-space: normal; /* Allow text to wrap within the tag */
  overflow: visible; /* Ensure text is fully visible */
  text-overflow: clip; /* Don't use ellipsis */
  line-height: 1.2; /* Tighter line height for wrapped text */
  hyphens: auto; /* Enable hyphenation for better text wrapping */
  word-break: break-word; /* Break long words if needed */
  max-width: 100%; /* Ensure it doesn't overflow its container */
}

.server-category-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary-color);
  background-opacity: 0.9;
  color: var(--text-white);
  font-size: 0.75rem;
  border-radius: 0.375rem;
}

/* Compact server card for sidebar and category listings */
.server-card-compact {
  display: flex;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease-in-out;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.server-card-compact:hover {
  background-color: var(--neutral-light);
}

.server-card-compact-image {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  background-color: var(--text-white);
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-right: 0.75rem;
}

.server-card-compact-content {
  flex: 1;
  min-width: 0;
}

.server-card-compact-title {
  font-weight: 500;
  color: var(--text-dark);
  transition: color 0.2s ease-in-out;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-card-compact-description {
  font-size: 0.875rem;
  color: var(--text-light);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Form elements */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--text-dark);
  background-color: var(--text-white);
  background-clip: padding-box;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.15);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Utility classes */
.text-primary {
  color: var(--primary-color);
}

.text-primary-dark {
  color: var(--primary-dark);
}

.bg-primary {
  background-color: var(--primary-color);
}

.bg-primary-dark {
  background-color: var(--primary-dark);
}

.bg-primary-light {
  background-color: var(--primary-light);
}

.border-primary {
  border-color: var(--primary-color);
}

/* Shadow for cards */
.shadow-card {
  box-shadow: 0 1px 3px rgba(212, 163, 115, 0.1), 0 2px 4px -1px rgba(212, 163, 115, 0.06);
}

/* Background gradients - warm and inviting */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
}

.section-divider {
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  margin-bottom: 1.5rem;
}
