:root {
  --primary-color: #4361ee;
  --primary-light: #4895ef;
  --secondary-color: #3a0ca3;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header styles */
.header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 4rem 0;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.header-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.header-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Main content styles */
.main {
  padding: 2rem 0;
}

/* Controls section */
.controls {
  margin-bottom: 2rem;
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

/* Search container */
.search-container {
  display: flex;
  margin-bottom: 1.5rem;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-btn {
  padding: 12px 24px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Category navigation */
.category-nav {
  overflow-x: auto;
  white-space: nowrap;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-list {
  display: inline-flex;
  list-style: none;
  gap: 10px;
}

.category-item {
  flex-shrink: 0;
}

.category-btn {
  padding: 8px 16px;
  background-color: #f0f0f0;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.category-btn:hover {
  background-color: #e0e0e0;
  transform: translateY(-1px);
}

.category-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Loading state */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

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

/* Emoji grid */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 2rem;
}

/* Emoji card */
.emoji-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.emoji-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.emoji-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 12px;
  transition: var(--transition);
}

.emoji-card:hover .emoji-image {
  transform: scale(1.1);
}

.emoji-name {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 4px;
  color: var(--text-color);
}

.emoji-category {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: center;
}

/* No results */
.no-results {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  text-align: center;
  color: var(--text-light);
}

/* Modal styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 2rem;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.close-modal:hover {
  color: var(--text-color);
  transform: scale(1.1);
}

.preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preview-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  margin-bottom: 1.5rem;
}

.preview-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.preview-category {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Footer styles */
.footer {
  background-color: var(--card-bg);
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

.footer-text {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Hidden class */
.hidden {
  display: none !important;
}

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

  .header-subtitle {
    font-size: 1rem;
  }

  .emoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
  }

  .emoji-image {
    width: 80px;
    height: 80px;
  }

  .controls {
    padding: 1rem;
  }

  .search-container {
    flex-direction: column;
  }

  .search-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 3rem 0;
  }

  .header-title {
    font-size: 1.8rem;
  }

  .main {
    padding: 1rem 0;
  }

  .emoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }

  .emoji-image {
    width: 70px;
    height: 70px;
  }

  .emoji-name {
    font-size: 0.8rem;
  }

  .modal-content {
    padding: 1.5rem;
  }
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}