/* Base Styles & Variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #e5e7eb;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --background: #f9fafb;
  --card-background: #ffffff;
  --border: #e5e7eb;
  --accent: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.5;
  padding-bottom: 2rem;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
header {
  background-color: var(--primary);
  color: white;
  padding: 1.5rem 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

header p {
  font-size: 1rem;
  opacity: 0.9;
}

/* Filter Section */
.filters {
  background-color: var(--card-background);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

select, input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background-color: white;
  font-size: 1rem;
  width: 100%;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.btn {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

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

/* Stats */
.stats {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

#company-count {
  font-weight: 600;
  color: var(--text-primary);
}

/* Company Grid */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.company-card {
  background-color: var(--card-background);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.company-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.company-header {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.logo-placeholder {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--primary);
  color: white;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-right: 1rem;
  flex-shrink: 0;
}

.company-name {
  font-weight: 600;
  font-size: 1rem;
}

.company-body {
  padding: 1.25rem;
}

.company-industry {
  display: inline-block;
  background-color: var(--secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.company-description {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.company-holding {
  font-size: 0.813rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

/* Messages */
.error, .no-results {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

.error {
  color: var(--accent);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .filter-group {
    min-width: 100%;
  }
  
  .company-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 480px) {
  header {
    padding: 1rem 0;
  }
  
  header h1 {
    font-size: 1.5rem;
  }
  
  .filters {
    padding: 1rem;
  }
}
