/* Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #165dff;
  --primary-light: #e8f3ff;
  --secondary-color: #6b9bff;
  --text-color: #333;
  --text-secondary: #666;
  --bg-color: #f5f7fa;
  --card-bg: #ffffff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
  --radius: 6px;
  --transition: all 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, 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-top {
  background-color: var(--card-bg);
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
}

.header-top .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
}

.logo a {
  text-decoration: none;
}

.logo i {
  margin-right: 10px;
  font-size: 1.8rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.search-container {
  display: flex;
  align-items: center;
  position: relative;
  flex: 0 0 300px;
}

#search-input {
  width: 100%;
  padding: 8px 40px 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  outline: none;
  font-size: 14px;
  transition: var(--transition);
}

#search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.1);
}

#search-button {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}

#search-button:hover {
  color: var(--primary-color);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-color);
  cursor: pointer;
}

/* Navbar Styles */
.nav-container {
  background-color: var(--primary-color);
}

nav {
  padding: 0;
}

nav ul {
  display: flex;
  list-style: none;
  align-items: center;
}

nav ul li {
  position: relative;
}

nav ul li a {
  display: block;
  padding: 15px 20px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

nav ul li a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.category-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 20px;
  color: white;
  cursor: pointer;
  font-weight: 500;
}

.dropdown-toggle.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background-color: white;
  box-shadow: var(--shadow-md);
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  display: none;
  z-index: 1000;
}

.category-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
}

.dropdown-item:hover {
  background-color: var(--primary-light);
  border-left-color: var(--primary-color);
}

.dropdown-item i {
  color: var(--primary-color);
}

/* Hero Section */
.hero {
  padding: 40px 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Categories Section */
.categories {
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

.categories h2 {
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: var(--text-color);
  position: relative;
  padding-bottom: 10px;
}

.categories h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.tool-card {
  background-color: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.tool-icon {
  width: 50px;
  height: 50px;
  background-color: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.tool-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-color);
}

.tool-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: auto;
}

/* Footer Styles */
footer {
  background-color: var(--card-bg);
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  opacity: 0;
  visibility: hidden;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

/* Responsive Styles */
@media (max-width: 768px) {
  .header-top .container {
    flex-direction: column;
    gap: 15px;
  }

  .nav-container .container {
    padding: 0;
  }

  .search-container {
    flex: 1;
    width: 100%;
  }

  .mobile-menu-btn {
    display: block;
    position: absolute;
    top: 20px;
    right: 20px;
  }

  nav ul {
    flex-direction: column;
    display: none;
  }

  nav.active ul {
    display: flex;
  }

  nav ul li {
    width: 100%;
  }

  nav ul li a {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .category-dropdown {
    width: 100%;
  }

  .dropdown-toggle {
    width: 100%;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    background-color: rgba(255, 255, 255, 0.05);
  }

  .dropdown-item {
    color: white;
    padding: 10px 20px;
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .dropdown-item i {
    color: white;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .categories h2 {
    font-size: 1.5rem;
  }

  .tool-card {
    padding: 15px;
  }

  #back-to-top {
    bottom: 20px;
    right: 20px;
    width: 35px;
    height: 35px;
  }
}
