* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  color: #333;
  line-height: 1.6;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

.search-container {
  margin: 20px 0;
}

.search-input {
  width: 100%;
  max-width: 500px;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin: 0 auto;
  display: block;
}

.search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.contact-section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
  color: #333;
}

.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.contact-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.contact-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

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

.avatar-initials {
  width: 100%;
  height: 100%;
  background: #007bff;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
}

.contact-info {
  flex: 1;
}

.contact-name {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 5px;
  color: #333;
}

.contact-details {
  margin-bottom: 8px;
}

.contact-detail {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 3px;
}

.favorite-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #ccc;
  transition: color 0.2s;
  padding: 5px;
  border-radius: 50%;
}

.favorite-btn:hover {
  color: #ffc107;
  background: rgba(255, 193, 7, 0.1);
}

.favorite-btn.is-favorite {
  color: #ffc107;
}

.loading-container, .error-container {
  text-align: center;
  padding: 60px 20px;
}

.loading-container h1, .error-container h1 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.loading-container p, .error-container p {
  font-size: 1.1rem;
  color: #666;
}

@media (max-width: 768px) {
  .app-container {
    padding: 15px;
  }
  
  .contacts-grid {
    grid-template-columns: 1fr;
  }
  
  .contact-card {
    padding: 15px;
  }
  
  .section-title {
    font-size: 1.3rem;
  }
}