/* Component Styles - Buttons, cards, forms, and interactive elements */

/* Button Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  min-height: 44px; /* Accessibility - minimum touch target */
  gap: 0.5rem;
}

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

.btn-primary {
  background: #2563eb;
  color: white;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: white;
  color: #2563eb;
  border: 2px solid #2563eb;
}

.btn-secondary:hover:not(:disabled) {
  background: #2563eb;
  color: white;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.btn-outline:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Form Components */
input[type="text"],
input[type="email"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input.error,
select.error,
textarea.error {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  min-height: 1.25rem;
}

/* Search Input Group */
.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-group input {
  border-radius: 8px 0 0 8px;
  border-right: none;
}

.search-btn {
  background: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 0 8px 8px 0;
  padding: 0.75rem 1rem;
  color: white;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-btn:hover {
  background: #1d4ed8;
}

.search-icon {
  font-size: 1.1rem;
}

/* Filter Tags */
.filter-tag {
  display: inline-flex;
  align-items: center;
  background: #2563eb;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  gap: 0.5rem;
}

.filter-tag-remove {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
}

/* Startup Card Component */
.startup-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid #e5e7eb;
  position: relative;
  overflow: hidden;
}

.startup-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.startup-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.startup-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.startup-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

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

.startup-logo {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
}

.startup-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-placeholder {
  font-size: 2rem;
  color: #6b7280;
}

.startup-description {
  color: #4b5563;
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.startup-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
}

.startup-location {
  color: #6b7280;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.startup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* Tag Components */
.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.tag-industry {
  background: #dbeafe;
  color: #1e40af;
}

.tag-stage {
  background: #dcfce7;
  color: #166534;
}

.tag-location {
  background: #fef3c7;
  color: #92400e;
}

.tag-small {
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

/* Industry specific tag colors */
.tag-fintech { background: #dbeafe; color: #1e40af; }
.tag-healthtech { background: #dcfce7; color: #166534; }
.tag-edtech { background: #fef3c7; color: #92400e; }
.tag-ai_ml { background: #f3e8ff; color: #7c2d12; }
.tag-cybersecurity { background: #fee2e2; color: #991b1b; }
.tag-saas { background: #e0f2fe; color: #0369a1; }
.tag-cleantech { background: #d1fae5; color: #065f46; }
.tag-proptech { background: #fde68a; color: #78350f; }
.tag-foodtech { background: #fed7d7; color: #c53030; }
.tag-retailtech { background: #e9d8fd; color: #553c9a; }
.tag-hrtech { background: #bee3f8; color: #2a69ac; }
.tag-martech { background: #fbb6ce; color: #97266d; }

/* Stage specific tag colors */
.stage-pre_seed { background: #fef3c7; color: #92400e; }
.stage-seed { background: #dcfce7; color: #166534; }
.stage-series_a { background: #dbeafe; color: #1e40af; }
.stage-series_b { background: #e0f2fe; color: #0369a1; }
.stage-series_c_plus { background: #f3e8ff; color: #7c2d12; }
.stage-unknown { background: #f3f4f6; color: #6b7280; }

/* Loading Components */
.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 4px solid #f3f4f6;
  border-left-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-state {
  color: #6b7280;
}

/* Message Components */
.form-message {
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-message.success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.form-message.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.message-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Modal Close Button */
.modal-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Link Components */
.startup-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #2563eb;
  text-decoration: none;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.startup-link:hover {
  background: #eff6ff;
}

.link-icon {
  font-size: 1rem;
}

/* Funding Amount Display */
.funding-amount {
  font-weight: 600;
  color: #059669;
}

.funding-amount::before {
  content: '$';
}

/* Team Size Display */
.team-size {
  font-weight: 500;
  color: #6b7280;
}

/* Date Display */
.funding-date {
  color: #6b7280;
  font-size: 0.875rem;
}

/* Responsive Component Adjustments */
@media (max-width: 768px) {
  .startup-card {
    padding: 1.25rem;
  }

  .startup-card-header {
    flex-direction: column;
    gap: 1rem;
  }

  .startup-logo {
    width: 50px;
    height: 50px;
  }

  .startup-name {
    font-size: 1.125rem;
  }

  .startup-details {
    flex-direction: column;
    align-items: start;
    gap: 0.75rem;
  }

  .btn {
    padding: 0.6875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .modal-header h3 {
    font-size: 1.375rem;
  }
}

@media (max-width: 480px) {
  .startup-card {
    padding: 1rem;
  }

  .startup-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .startup-tags {
    margin-top: 0.5rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .startup-card {
    border: 2px solid #000;
  }

  .btn-primary {
    background: #000;
    border: 2px solid #000;
  }

  .btn-secondary {
    border: 2px solid #000;
    color: #000;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .startup-card,
  .btn,
  .modal-content,
  .spinner {
    transition: none;
    animation: none;
  }

  .startup-card:hover {
    transform: none;
  }
}

/* Dark mode support (system preference) */
@media (prefers-color-scheme: dark) {
  .startup-card {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
  }

  .startup-name {
    color: #f9fafb;
  }

  .startup-description {
    color: #d1d5db;
  }

  .tag-small {
    background: #374151;
    color: #d1d5db;
  }
}