@import url("/assets/css/colors.css");
@import url("/assets/css/common.css");

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

body {
  font-family: "Satoshi";
  background: #f9f8fa;
  min-height: 100vh;
  /* padding: 20px; */
}

.container {
  max-width: 92vw;
  /* margin: 0 auto; */
  background: #f9f8fa;
  /* border-radius: 16px; */
  /* box-shadow: 0 20px 40px rgba(0,0,0,0.1); */
  overflow: hidden;
  margin-right: 0px;
}

@media (min-width: 1400px) {
  .container {
    max-width: 94%;
    margin-right: 0px;
  }
}

.header {
  background: #f8f9fa;
  color: white;
  padding: 10px;
  text-align: center;
}

.heading-section {
  font-size: 2.5rem;
  /* margin-bottom: 10px; */
  font-weight: 700;
  color: #141a21;
  font-size: 28px;
}

.search-filter-section {
  /* padding: 10px; */
  background: #f8fafc;
  /* border-bottom: 1px solid #e2e8f0; */
}

.search-container {
  position: relative;
  width: 70%; /* same as your input */
  margin: 10px auto; /* same as your input */
}

.search-bar {
  width: 100%; /* take full width of container */
  padding: 16px 50px 16px 20px; /* extra right padding for icon */
  font-size: 16px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  transition: all 0.3s ease;
  display: flex;
}

.search-bar:focus {
  border-color: #6a94c4;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: #9ca3af;
}

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: 8px 12px;
  border: 1px solid #d5d6ed;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 16px;
  color: #2f2f2f;
  font-family: "Satoshi";
}

.filter-btn:hover {
  border-color: #265baa;
  color: #265baa;
}

.filter-btn.active {
  background: #265baa;
  color: white;
  border: none;
}

/* UPDATED: Fixed width grid layout */
.tools-grid {
  padding: 30px;
  display: grid;
  grid-template-columns: repeat(auto-fit, 350px);
  gap: 25px;
  background: #f9f8fa;
  justify-content: center; /* Center the grid when there's extra space */
}

/* Alternative option with slightly wider cards */
/* 
.tools-grid {
    padding: 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, 400px);
    gap: 25px;
    background: #f9f8fa;
    justify-content: center;
}
*/

.tool-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #d3d3d3;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  width: 350px; /* Explicit width to ensure consistency */
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  border-color: #6a94c4;
  cursor: pointer;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  /* background: var(--accent-color, #265BAA); */
}

.tool-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  justify-content: space-between;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  margin-right: 15px;
  font-size: 18px;
}

.tool-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.tool-category {
  font-size: 18px;
  color: #111928;
  margin-bottom: 10px;
  font-weight: 500;
  background-color: #f1f1f1;
  padding: 5px 12px;
  border-radius: 6px;
}

.tool-tool_name {
  font-weight: 700;
  font-size: 24px;
  color: #2f2f2f;
}

.tool-tool_description {
  color: #505050;
  font-weight: 400;
  font-size: 18px;
}

.tool-description {
  color: #475569;
  line-height: 1.6;
  margin-bottom: 20px;
}

.use-tool-btn {
  /* background: linear-gradient(135deg, #265BAA, #7c3aed); */
  color: #3e3e3e;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  background-color: var(--color-white);
  cursor: pointer;
  border: 1px solid #d3d3d3;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  font-weight: 500;
  font-size: 18px;
}

.use-tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
  background-color: #265baa;
  color: white;
}

.tool-card:has(.use-tool-btn:hover) {
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.15),
    0 8px 16px rgba(106, 148, 196, 0.6);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 1.125rem;
}

.no-results-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

/* Category specific colors */
.writing {
  --accent-color: #10b981;
}
.editing {
  --accent-color: #f59e0b;
}
.marketing {
  --accent-color: #3b82f6;
}
.social {
  --accent-color: #8b5cf6;
}

@media (max-width: 768px) {
  .tools-grid {
    grid-template-columns: 1fr;
    padding: 20px;
    justify-content: stretch;
  }

  .tool-card {
    width: 100%; /* Full width on mobile */
  }

  .heading-section {
    font-size: 2rem;
  }

  .filters {
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .filter-btn {
    white-space: nowrap;
  }
}

/* Additional responsive breakpoints for better control */
@media (max-width: 1200px) and (min-width: 769px) {
  .tools-grid {
    grid-template-columns: repeat(auto-fit, 350px);
    justify-content: center;
  }
}

@media (max-width: 400px) {
  .tools-grid {
    padding: 15px;
  }

  .tool-card {
    padding: 20px;
  }
}

.hero-section {
  position: relative;
  width: calc(100% - 120px);
  height: auto;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;

  /* Shimmer placeholder */
  background-color: #e0e0e0;
  background-image: linear-gradient(
    90deg,
    #e0e0e0 0px,
    #f8f8f8 40px,
    #e0e0e0 80px
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.hero-section.loaded {
  animation: none; /* stop shimmer */
}

.text-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 800px;
  padding: 20px 20px 0 20px;
}

@media (max-width: 786px) {
  .text-overlay {
    margin-top: 50px;
  }
}

.text-overlay h1 {
  font-size: 40px;
  font-weight: 700;
  color: #2f2f2f;
}

.text-overlay span {
  font-size: 40px;
  font-weight: 700;
  background: linear-gradient(360deg, #2463eb 0%, #7c3bed 69%, #21c45d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: bold;
}

.text-overlay p {
  font-size: 20px;
  color: #3e3e3e;
}

.cta-button {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  font-size: 1.1rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
  .text-overlay h1 {
    font-size: 36px;
    width: 70%;
    margin: 8px auto;
  }

  .text-overlay span {
    font-size: 36px;
  }

  .text-overlay p {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .text-overlay h1 {
    font-size: 36px;
  }

  .text-overlay p {
    font-size: 1rem;
  }
}

.filter-btn.active[data-category="all"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px; /* space between icon and text */
}

.filter-btn.active[data-category="all"]::before {
  content: url("../assets/icons/more-tool-icons/Sparkle.svg");
  display: inline-block;
  vertical-align: middle;
  height: 20px;
  /* animation: sparkleAnim 1s infinite ease-in-out; */
}

@keyframes sparkleAnim {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  50% {
    transform: scale(1.2) rotate(15deg);
    opacity: 0.8;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.badge {
  border-radius: 6px;
  border-top: 2px solid #4344b2;
  border-right: 4px solid #4344b2;
  border-bottom: 4px solid #4344b2;
  border-left: 2px solid #4344b2;
  padding: 6px 8px;
}

.badge span {
  font-weight: 700;
  font-size: 12px;
  color: #4344b2;
  margin-left: 3px;
}

.top-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
  justify-content: center;
  position: relative;
  width: calc(100% - 120px);
  margin-left: auto;
  padding: 12px 10px;
  border-bottom: 1px solid #bebebe;
}

.top-tools span {
  color: #2f2f2f;
  font-weight: 500;
  font-size: 14px;
  margin-left: 8px;
}

@media (max-width: 990px) {
  .hero-section {
    margin-top: 90px;
    width: 100%;
  }

  .top-tools {
    width: 100%;
    overflow-x: auto;
  }

  .container {
    max-width: 100vw;
  }

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

.top-tools img {
  width: 40px; /* adjust if needed */
  height: 40px;
  display: inline-block;
  position: relative;
  border-radius: 100%;
  background-color: #e0e0e0; /* fallback color */
}

.top-tools img.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    #e9e9e9 0%,
    #f6f6f6 40%,
    #e9e9e9 80%
  );
  background-size: 200% 100%;
  animation: lazy-shimmer 1.2s linear infinite;
  border-radius: 6px;
}

@keyframes lazy-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.star-icon {
  position: absolute;
  bottom: 4%;
  left: 30%;
}

.ellipse-icon {
  position: absolute;
  top: 20%;
  right: 30%;
}

.background-blur-1 {
  position: absolute;
  top: 44%;
  left: 15%;
}

.background-blur-2 {
  position: absolute;
  top: 30%;
  left: 20%;
}

@media (max-width: 1400px) {
  .star-icon {
    position: absolute;
    bottom: 4%;
    left: 21%;
  }

  .ellipse-icon {
    position: absolute;
    top: 20%;
    right: 25%;
  }

  .background-blur-1 {
    position: absolute;
    top: 44%;
    left: 8%;
  }

  .background-blur-2 {
    position: absolute;
    top: 30%;
    left: 13%;
  }
}

@media (max-width: 786px) {

  .hero-section {
    margin-top: 80px;
  }
  .ellipse-icon img {
    width: 34px;
  }
  .ellipse-icon {
    right: 12%;
    top: 30%;
  }
  .background-blur-1 img {
    height: 31px;
  }
  .background-blur-2 img {
    height: 22px;
    width: 21px;
  }
  .background-blur-1 {
    top: 50%;
  }
  .background-blur-2 {
    top: 43%;
  }
  .star-icon img {
    width: 40px;
  }

  .star-icon {
    left: 14%;
  }
}
@media (min-width: 990px) {
  .container {
    width: calc(100% - 120px);
    margin-left: auto;
  }
}

@media (max-width: 990px) {
  .top-tools {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
    scrollbar-width: none; /* hide scrollbar in Firefox */
    justify-content: start;
  }

  .top-tools::-webkit-scrollbar {
    display: none; /* hide scrollbar in Chrome/Safari */
  }

  .top-tools > div {
    flex: 0 0 auto; /* prevent shrinking, allow horizontal scroll */
    padding: 0 8px; /* spacing so first/last don't get cut off */
  }
}

.use-tool-btn {
  /* background: linear-gradient(135deg, #265BAA, #7c3aed); */
  color: #3e3e3e;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  background-color: var(--color-white);
  cursor: pointer;
  border: 1px solid #d3d3d3;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  font-weight: 500;
  font-size: 18px;
  /* New styles for anchor tag */
  display: inline-block;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
}

.use-tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
  background-color: #265baa;
  color: white;
  text-decoration: none; /* Prevent underline on hover */
}

.use-tool-btn:focus {
  outline: 2px solid #265baa;
  outline-offset: 2px;
  text-decoration: none;
}

.use-tool-btn:visited {
  color: #3e3e3e; /* Maintain original color for visited links */
}

.use-tool-btn:visited:hover {
  color: white; /* White on hover even if visited */
}

.top-tools-item:hover span {
  color: var(--color-primary-light);
}

@media (max-width: 1290px) {
  .top-tools-item {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .top-tools-item {
    flex-direction: row;
  }
}

.tool-card.disabled {
  opacity: 0.6;
  pointer-events: none;
  background-color: #f8f9fa;
}

.tool-card.disabled .use-tool-btn {
  background-color: #6c757d;
  cursor: not-allowed;
}

.tool-card.disabled::after {
  content: "Coming Soon";
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc3545;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tool-card.disabled {
  opacity: 0.7;
  background-color: #f8f9fa;
}

.tool-card.disabled .use-tool-btn {
  background-color: #c4ccd4;
  cursor: not-allowed;
}

.tool-card.disabled .tool-status {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #dc3545;
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.tool-card .tool-status {
  display: none;
}

.tool-card.disabled .tool-status {
  display: block;
}


/* ================================
    Shimmer for tools-grid icons
   ================================ */
.tool-icon img.is-loading {
  position: relative;
  background-color: #e0e0e0;
  overflow: hidden;
  border-radius: 10px;
}

/* The shimmer layer */
.tool-icon img.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    #e9e9e9 0%,
    #f6f6f6 40%,
    #e9e9e9 80%
  );
  background-size: 200% 100%;
  animation: lazy-shimmer 1.2s linear infinite;
  border-radius: inherit;
}

/* Once image loads, JS will remove the 'is-loading' class */
.tool-icon img:not(.is-loading) {
  background: none;
}

/* Reuse the shimmer keyframes */
@keyframes lazy-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

