/* Reset y configuración base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: #f5f5f5;
  color: #333;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  background: linear-gradient(135deg, #1e76fa 0%, #0064fa 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.topbar-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
}

.search-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 3rem;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.search-input:focus {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.clear-search {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.clear-search:hover {
  background-color: #f0f0f0;
}

.search-stats {
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Contenido principal */
.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #666;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #333;
}

.clear-search-btn {
  background: linear-gradient(135deg, #1e76fa 0%, #0064fa 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  margin-top: 1rem;
  transition: transform 0.2s ease;
}

.clear-search-btn:hover {
  transform: translateY(-2px);
}

/* Secciones de contactos */
.contact-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #333;
  border-bottom: 2px solid #1e76fa;
  padding-bottom: 0.5rem;
}

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

/* Tarjetas de contacto */
.contact-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  border: 1px solid #e1e5e9;
}

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

.contact-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.contact-avatar {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.contact-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #1e76fa;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e76fa 0%, #0064fa 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
  word-break: break-word;
}

.contact-details p {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-github a {
  color: #1e76fa;
  text-decoration: none;
  font-weight: 500;
}

.contact-github a:hover {
  text-decoration: underline;
}

.favorite-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.favorite-btn:hover {
  transform: scale(1.1);
  border-color: #ffd700;
}

.favorite-btn.favorito {
  background: #ffd700;
  border-color: #ffd700;
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  .app-title {
    font-size: 1.5rem;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .contact-card {
    padding: 1rem;
  }

  .contact-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-avatar {
    width: 80px;
    height: 80px;
  }

  .main-content {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .search-input {
    padding: 0.5rem 1rem 0.5rem 2.5rem;
  }

  .search-icon {
    left: 0.75rem;
  }

  .clear-search {
    right: 0.75rem;
  }

  .topbar-content {
    padding: 0 0.5rem;
  }
}