/* @import url("footer.css"); */
/* Main CSS - Replaces Tailwind */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap");

/* CSS Variables */
:root {
  --warm-cream: #fef3c7;
  --burnt-orange: #ea580c;
  --golden-yellow: #f59e0b;
  --dark-brown: #78350f;
  --peach-bg: #fed7aa;
  --card-white: #fff7ed;
  --warm-gray: #f5f5f4;
  --footer-bg: #f8f4f0;
  --orange-gradient: linear-gradient(135deg, #ea580c, #f59e0b);
}

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

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: "Inter", "Poppins", sans-serif;
  background-color: var(--warm-cream);
  color: var(--dark-brown);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Ensure navbar container is properly positioned */
.navbar-container {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

/* Layout */
.section-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 15px; /* Reduced for mobile */
}

@media (min-width: 768px) {
  .section-container {
    width: 90vw;
    padding: 0 20px;
  }
}

.main-section {
  padding: 48px 0;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 1024px) {
  .dashboard-layout {
    flex-direction: row;
  }
}

.sidebar {
  width: 100%;
  margin-bottom: 30px;
}

@media (min-width: 1024px) {
  .sidebar {
    width: 25%;
    position: sticky;
    top: 96px;
    align-self: flex-start;
    margin-bottom: 0;
  }
}

.sidebar-card {
  background-color: var(--card-white);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--peach-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--peach-bg);
}

/* Categories */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.category-item.active {
  background: linear-gradient(to right, var(--peach-bg), #ffedd5);
  border: 1px solid #fdba74;
}

.category-item:not(.active) {
  background-color: transparent;
  border: 1px solid transparent;
}

.category-item:not(.active):hover {
  background-color: var(--warm-gray);
  border-color: var(--peach-bg);
}

.category-icon-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.category-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-icon.active-icon {
  background: var(--orange-gradient);
}

.category-icon:not(.active-icon) {
  background-color: var(--warm-gray);
}

.category-icon i {
  font-size: 1rem;
}

.category-icon.active-icon i {
  color: white;
}

.category-icon:not(.active-icon) i {
  color: rgba(120, 53, 15, 0.6);
}

.category-name {
  font-weight: 500;
  white-space: nowrap;
}

.category-item.active .category-name {
  color: var(--dark-brown);
  font-weight: 600;
}

.category-item:not(.active) .category-name {
  color: rgba(120, 53, 15, 0.7);
  font-weight: 500;
}

.category-count {
  background-color: var(--burnt-orange);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  flex-shrink: 0;
}

.category-count.inactive {
  background-color: transparent;
  color: rgba(120, 53, 15, 0.4);
  padding: 4px 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Main Content */
.main-content {
  width: 100%;
}

@media (min-width: 1024px) {
  .main-content {
    width: 75%;
  }
}

.content-header {
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 8px;
}

.section-subtitle {
  color: rgba(120, 53, 15, 0.7);
  font-size: 0.875rem;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tool Cards - FIXED FOR ICON OVERLAP ISSUE */
.tool-card {
  background-color: var(--card-white);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--peach-bg);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: fadeInUp 0.6s ease-out forwards;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 280px;
  position: relative;
  overflow: visible;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(234, 88, 12, 0.15);
}

.tool-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 1;
}

.tool-icon-wrapper.orange-icon {
  background: var(--orange-gradient);
}

.tool-icon-wrapper i {
  color: white;
  font-size: 1.25rem;
  position: relative;
  z-index: 2;
}

/* REMOVE glow effect if it exists */
.tool-icon-glow-effect {
  display: none;
}

.tool-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--dark-brown);
  margin-bottom: 12px;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.tool-description {
  color: rgba(120, 53, 15, 0.7);
  font-size: 0.875rem;
  margin-bottom: 20px;
  line-height: 1.5;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.tool-link {
  display: block;
  text-decoration: none;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.tool-button {
  width: 100%;
  background: #ea580c; /* Changed from var(--orange-gradient) */
  color: white;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.tool-button:hover {
  background: rgba(234, 88, 12, 0.9);
  transform: translateY(-1px);
}

.tool-button i {
  font-size: 0.75rem;
}

/* Popular Section - FIXED FOR 90% WIDTH */
.popular-section {
  padding: 32px 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.popular-section .section-container {
  width: 90vw; /* Set to 90% of viewport width */
  max-width: 1400px; /* Increased from 1200px */
  margin: 0 auto;
  padding: 0 20px;
}

.popular-container {
  width: 100%;
  background: linear-gradient(
    to right,
    rgba(254, 215, 170, 0.5),
    rgba(255, 237, 213, 0.5)
  );
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(253, 186, 116, 0.5);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 96px;
  z-index: 10;
}

.popular-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.popular-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.popular-icon {
  width: 40px;
  height: 40px;
  background: var(--orange-gradient);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popular-icon i {
  color: white;
}

.popular-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-brown);
}

.trending-badge {
  background: var(--orange-gradient);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 9999px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
  white-space: nowrap;
}

/* Popular Grid */
.popular-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .popular-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.popular-card {
  background-color: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--peach-bg);
  border-radius: 12px;
  padding: 16px;
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

.popular-card:hover {
  background-color: white;
}

.popular-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex: 1;
}

.popular-tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popular-tool-icon.orange-icon {
  background: var(--orange-gradient);
}

.popular-tool-icon.small {
  width: 40px;
  height: 40px;
}

.popular-tool-icon i {
  color: white;
  font-size: 1rem;
}

.popular-tool-title {
  font-weight: 700;
  color: var(--dark-brown);
  font-size: 0.875rem;
  line-height: 1.3;
}

.popular-link {
  display: block;
  text-decoration: none;
  margin-top: auto;
}

.popular-button {
  width: 100%;
  background-color: var(--burnt-orange);
  color: white;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  font-size: 0.875rem;
  white-space: nowrap;
}

.popular-button:hover {
  background-color: rgba(234, 88, 12, 0.9);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animations for cards */
.tool-card:nth-child(1) {
  animation-delay: 0.1s;
}
.tool-card:nth-child(2) {
  animation-delay: 0.2s;
}
.tool-card:nth-child(3) {
  animation-delay: 0.3s;
}
.tool-card:nth-child(4) {
  animation-delay: 0.4s;
}
.tool-card:nth-child(5) {
  animation-delay: 0.5s;
}
.tool-card:nth-child(6) {
  animation-delay: 0.6s;
}
.tool-card:nth-child(7) {
  animation-delay: 0.7s;
}
.tool-card:nth-child(8) {
  animation-delay: 0.8s;
}
.tool-card:nth-child(9) {
  animation-delay: 0.9s;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--peach-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--burnt-orange);
  border-radius: 4px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  .section-container {
    width: 90vw; /* Changed from 95vw to 90vw */
    padding: 0 16px;
  }

  .popular-section .section-container {
    width: 90vw; /* Ensure consistency on mobile */
    padding: 0 16px;
  }

  .main-section {
    padding: 32px 0;
  }

  .popular-section {
    padding: 24px 0;
  }

  .tool-card {
    min-height: 260px;
    padding: 20px;
  }

  .tool-description {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .tool-icon-wrapper {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
  }

  .tool-icon-wrapper i {
    font-size: 1.125rem;
  }
}

/* Fix for text overflow */
.tool-card * {
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

/* Ensure proper spacing */
.tools-grid {
  align-items: stretch;
}

/* Card content alignment fix */
.tool-card > *:last-child {
  margin-top: auto;
}

/* Additional fixes to prevent icon overlap */
.tool-card-content {
  position: relative;
  z-index: 2;
}

/* Clear any absolute positioning that might cause overlap */
.tool-card::before,
.tool-card::after {
  content: none;
}

/* Fix for any decorative shapes that might be overlapping */
.decorative-shape {
  display: none;
}

/* Ensure all card content has proper z-index */
.tool-card > * {
  position: relative;
  z-index: 2;
}

/* If there's a glow effect class from the HTML, hide it */
.glow-effect,
.icon-glow,
.tool-glow {
  display: none !important;
}

/* Simple navbar fallback */
.simple-navbar {
  background-color: var(--peach-bg);
  padding: 16px;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--burnt-orange);
  text-decoration: none;
}

/* Hero section icon fixes if needed */
.hero-tool-icon-container,
.tool-icon-gradient-bg,
.tool-icon-base {
  position: relative;
  z-index: 1;
}

.tool-icon-wrapper {
  transform: none !important;
}

.tool-card {
  isolation: isolate;
}

.tool-icon-wrapper {
  isolation: isolate;
}

.tools-grid .tool-card .tool-icon-wrapper {
  position: static !important;
  float: none !important;
  clear: both !important;
}

.tools-grid .tool-card .tool-title,
.tools-grid .tool-card .tool-description {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
}
