@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #ff9000;
  --primary-gradient: linear-gradient(135deg, #ff9000, #ff6a00);
  --bg-color: #0d0d0d;
  --card-bg-color: #1a1a1a;
  --card-hover-bg: #2a2a2a;
  --text-color: #ffffff;
  --text-secondary: #b3b3b3;
  --border-radius: 12px;
  --transition: all 0.3s ease;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 6px 25px rgba(255, 144, 0, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(90deg, #000000, #1a1a1a);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

nav {
  background-color: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  padding: 0.75rem 1rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

nav ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav li {
  margin: 0;
}

nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  transition: var(--transition);
  background: transparent;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

nav a:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-gradient);
  z-index: -1;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s ease;
  border-radius: 50px;
}

nav a:hover:before,
nav a.active:before {
  transform: scaleX(1);
  transform-origin: left;
}

nav a:hover,
nav a.active {
  color: #000;
  border-color: var(--primary-color);
}

main {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  flex: 1;
}

.category-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2.5rem 0 1.5rem;
  color: var(--primary-color);
  border-left: 5px solid var(--primary-color);
  padding-left: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  display: flex;
  align-items: center;
}

.category-title:after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--primary-color), transparent);
  margin-left: 1rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 1.2rem;
  margin-bottom: 2.5rem;
}

.link-card {
  background-color: var(--card-bg-color);
  border-radius: var(--border-radius);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.link-card:hover {
  background-color: var(--card-hover-bg);
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(255, 144, 0, 0.2);
}

.link-card:active {
  transform: translateY(0);
}

.link-card a {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-decoration: none;
  z-index: 12;
  display: block;
}

.link-card i {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  transition: var(--transition);
  position: relative;
  z-index: 11;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.link-card:hover i {
  transform: scale(1.15);
  text-shadow: 0 0 15px rgba(255, 144, 0, 0.5);
}

.link-card h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--text-color);
  line-height: 1.4;
  font-weight: 500;
  max-width: 100%;
  height: 2.8em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  white-space: normal;
  padding: 0 0.3rem;
  position: relative;
  z-index: 11;
  transition: var(--transition);
}

.link-card:hover h3 {
  color: var(--primary-color);
}

footer {
  background: linear-gradient(90deg, #000000, #1a1a1a);
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

footer p {
  margin: 0 0 1rem;
}

footer nav {
  margin-top: 0.8rem;
  background-color: transparent;
}

footer nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

footer nav li {
  margin: 0;
}

footer nav a {
  color: var(--text-secondary);
  margin: 0 0.8rem;
  font-size: 0.9rem;
  text-decoration: none;
  transition: var(--transition);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
}

footer nav a:hover {
  color: var(--primary-color);
  background: rgba(255, 144, 0, 0.1);
}

/* Search styles */
.search-container {
  padding: 1.5rem 1rem;
  text-align: center;
  background: rgba(13, 13, 13, 0.7);
  backdrop-filter: blur(5px);
  position: sticky;
  top: 60px;
  z-index: 999;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#search-input {
  width: 100%;
  max-width: 600px;
  padding: 1rem 1.5rem;
  border-radius: 50px;
  border: 2px solid var(--primary-color);
  background: rgba(26, 26, 26, 0.8);
  color: var(--text-color);
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#search-input:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 144, 0, 0.3);
  background: rgba(26, 26, 26, 1);
}

#search-input::placeholder {
  color: var(--text-secondary);
}

#search-results {
  display: none;
  margin-top: 1.5rem;
}

#search-results .link-grid {
  margin-top: 0;
}

/* Scroll to top button */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-gradient);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  border: none;
}

#scroll-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#scroll-top:hover {
  transform: scale(1.1);
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty state for search */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
  font-size: 1.2rem;
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  opacity: 0.5;
}

/* Media Queries */
@media (max-width: 1200px) {
  main {
    padding: 1.2rem;
    max-width: 95%;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 1.1rem;
  }
}

@media (max-width: 992px) {
  header h1 {
    font-size: 2.2rem;
  }

  nav ul {
    gap: 0.3rem;
  }

  nav a {
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
  }

  .category-title {
    font-size: 1.6rem;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
    gap: 1rem;
  }

  .link-card {
    padding: 1.3rem 0.8rem;
    min-height: 100px;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  header {
    padding: 1.2rem 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  nav {
    padding: 0.6rem 0.8rem;
    top: 0;
  }

  nav ul {
    gap: 0.2rem;
  }

  nav a {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
  }

  main {
    padding: 1rem;
  }

  .category-title {
    font-size: 1.5rem;
    margin: 2rem 0 1.2rem;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.9rem;
  }

  .link-card {
    padding: 1.2rem 0.7rem;
    min-height: 90px;
  }

  .link-card i {
    font-size: 2rem;
    margin-bottom: 0.8rem;
  }

  .link-card h3 {
    font-size: 0.9rem;
    height: 2.7em;
  }

  .search-container {
    padding: 1.2rem 1rem;
    top: 55px;
  }

  #search-input {
    padding: 0.9rem 1.2rem;
    font-size: 1rem;
  }

  #scroll-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}

@media (max-width: 576px) {
  header {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.8rem;
  }

  nav {
    padding: 0.5rem;
  }

  nav ul {
    gap: 0.1rem;
  }

  nav a {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
  }

  main {
    padding: 0.8rem;
  }

  .category-title {
    font-size: 1.4rem;
    margin: 1.8rem 0 1rem;
    padding-left: 0.8rem;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
    gap: 0.8rem;
  }

  .link-card {
    padding: 1rem 0.6rem;
    min-height: 85px;
  }

  .link-card i {
    font-size: 1.8rem;
    margin-bottom: 0.7rem;
  }

  .link-card h3 {
    font-size: 0.85rem;
    padding: 0 0.2rem;
    height: 2.6em;
  }

  .search-container {
    padding: 1rem 0.8rem;
    top: 50px;
  }

  #search-input {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
  }

  footer {
    padding: 1.5rem 0.8rem;
    font-size: 0.8rem;
  }

  footer nav a {
    margin: 0 0.5rem;
    font-size: 0.8rem;
  }

  #scroll-top {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 400px) {
  html {
    font-size: 14px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  nav a {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  .link-grid {
    grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
    gap: 0.7rem;
  }

  .link-card {
    padding: 0.9rem 0.5rem;
    min-height: 80px;
  }

  .link-card i {
    font-size: 1.6rem;
    margin-bottom: 0.6rem;
  }

  .link-card h3 {
    font-size: 0.8rem;
    padding: 0 0.15rem;
    height: 2.5em;
  }
}