/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: linear-gradient(135deg, var(--dust-grey), #ffffff);
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

header {
  width: 100%;
  background-color: var(--pine-teal);
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

header a {
  color: white;
  text-decoration: none;
}

.container {
  max-width: 1200px;
  width: 100%;
  padding: 2rem;
  margin: 0 auto;
}

/* Responsive Layout */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
}

/* Symbol Grid */
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.symbol-item {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
}

.symbol-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.symbol-item.copied::after {
  content: "Copied!";
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fern);
  color: white;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  animation: fadeOut 1.5s forwards;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Category Section */
.category-section {
  margin-bottom: 3rem;
}

.category-section h2 {
  color: #333;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f0f0f0;
}

/* Search Bar */
.search-container {
  position: relative;
  margin: 1rem 0;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  border-color: var(--fern);
  outline: none;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 10;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.search-result-item {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: #f8f9fa;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-symbol {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

/* Footer */
footer {
  width: 100%;
  background-color: var(--dust-grey);
  color: var(--pine-teal);
  padding: 2rem;
  margin-top: auto;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2rem;
}

.footer-section {
  flex: 1;
  min-width: 250px;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--dry-sage);
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--pine-teal);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--fern);
  text-decoration: underline;
}

.copyright {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(58, 90, 64, 0.2);
  color: var(--pine-teal);
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background-color: var(--fern);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: var(--hunter-green);
}

.btn-secondary {
  background-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5a6268;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

.mb-4 {
  margin-bottom: 2rem;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  body.dark-mode {
    background: #121212;
    color: #e0e0e0;
  }

  body.dark-mode header {
    background-color: #1e1e1e;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  body.dark-mode .container {
    background-color: #1e1e1e;
  }

  body.dark-mode .symbol-item {
    background: #2d2d2d;
    color: #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  }

  body.dark-mode .symbol-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  body.dark-mode .category-section h2 {
    color: #e0e0e0;
    border-bottom-color: #333;
  }

  body.dark-mode .search-input {
    background: #2d2d2d;
    border-color: #444;
    color: #e0e0e0;
  }

  body.dark-mode .search-input:focus {
    border-color: var(--fern);
  }

  body.dark-mode .search-results {
    background: #2d2d2d;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  }

  body.dark-mode .search-result-item {
    border-bottom-color: #333;
  }

  body.dark-mode .search-result-item:hover {
    background-color: #333;
  }

  body.dark-mode footer {
    background-color: #1e1e1e;
  }

  body.dark-mode .copyright {
    border-top-color: #333;
  }
}
