/* Custom styles for Toolonix */

/* Color Variables */
:root {
  --bg-color: #fff7ea;
  --text-color: #171717;
  --primary-color: #ff9e00;
  --primary-dark: #cc4e00;
}

/* Global Styles */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Tool card hover effects */
.tool-card {
  transition: transform 0.2s ease-in-out;
}

.tool-card:hover {
  transform: translateY(-2px);
}

/* Loading animation for components */
.loading {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Custom focus styles */
.focus-ring {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Mobile menu animation */
.mobile-menu-enter {
  transform: translateY(-100%);
  opacity: 0;
}

.mobile-menu-enter-active {
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.mobile-menu-exit {
  transform: translateY(0);
  opacity: 1;
}

.mobile-menu-exit-active {
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 0.3s ease-in, opacity 0.3s ease-in;
}

/* Tool-specific styles */
.textarea-resize {
  resize: vertical;
  min-height: 200px;
}

/* Ad container styles */
.ad-container {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  text-align: center;
}

/* Dropdown styles */
.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: white;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1;
  border-radius: 4px;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown-content a {
  color: var(--text-color);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: var(--bg-color);
}

/* Ensure mobile menu items are visible */
#mobile-menu:not(.hidden) {
  display: block !important;
}

/* Mobile tools menu visibility */
#mobile-tools-menu:not(.hidden) {
  display: block !important;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .grid {
    gap: 1rem;
  }
}

/* Hero Section Styles */
.hero-section {
  background: linear-gradient(135deg, var(--bg-color) 0%, #fff8f0 100%);
  padding: 4rem 0;
  text-align: center;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.hero-title .highlight {
  color: var(--primary-color);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: #666;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.cta-button {
  background: var(--primary-color);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 158, 0, 0.3);
}

.cta-button.secondary {
  background: transparent;
  color: var(--text-color);
  border: 2px solid var(--primary-color);
}

.cta-button.secondary:hover {
  background: var(--primary-color);
  color: white;
}

/* Tool Categories */
.tool-category {
  margin-bottom: 4rem;
  text-align: center;
}

.category-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.category-description {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Ensure tool cards maintain width during search */
body.search-active .tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

body.search-active .tool-card {
  max-width: none;
  width: auto;
}

.tool-card {
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border: 1px solid #ffb366;
  position: relative;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tool-card.popular {
  border: 1px solid #ffb366;
  position: relative;
}

.popular-badge {
  position: absolute;
  top: 24px;
  right: 16px;
  background: #ff9e00;
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.popular-badge::before {
  content: "★";
  font-size: 0.9rem;
  font-weight: bold;
  position: relative;
}

.popular-badge::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: rgba(255, 255, 255, 0.3);
}

.tool-icon {
  width: 48px;
  height: 48px;
  background: #ffb366;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.tool-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.tool-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
  line-height: 1.3;
}

.tool-description {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

.get-started-btn {
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  width: 100%;
  justify-content: center;
}

.get-started-btn:hover {
  background: #555;
  transform: translateY(-1px);
}

.get-started-btn::after {
  content: "→";
  font-size: 1rem;
  font-weight: bold;
}

/* Header Styles */
.header {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e5e5;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo img {
  width: 126px;
  height: 40px;
}

.nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

.nav-link svg {
  color: var(--text-color);
}

.sign-in-btn {
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.sign-in-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Footer Styles */
.footer {
  background: #ffd5c0;
  color: var(--text-color);
  padding: 3rem 0 1rem;
}

.footer-section h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-color);
}

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

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

.footer-section a {
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--primary-color);
}

.copyright {
  background: #f5f5f5;
  padding: 1rem 0;
  text-align: center;
  color: #333;
  margin-top: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

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

/* Search Bar Styles */
.search-container {
  max-width: 600px;
  margin: 2rem auto;
  width: 100%;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 2px solid #ffb366;
  border-radius: 50px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 12px rgba(255, 158, 0, 0.15);
  transition: all 0.3s ease;
}

.search-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 4px 20px rgba(255, 158, 0, 0.25);
}

.search-icon {
  width: 20px;
  height: 20px;
  color: #666;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-color);
  background: transparent;
  padding: 0;
}

.search-input::placeholder {
  color: #999;
}

.clear-search-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: color 0.2s ease;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.clear-search-btn:hover {
  color: var(--primary-color);
}

.clear-search-btn svg {
  width: 18px;
  height: 18px;
}

/* No Results Message */
.no-results-message {
  text-align: center;
  padding: 3rem 1rem;
  display: none;
}

.no-results-message.show {
  display: block;
}

/* Print styles */
@media print {
  .no-print {
    display: none;
  }

  body {
    background: white;
  }

  .container {
    width: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
  }
}
