{% load static %}

/* ============================================
   CORE RESETS
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================
   THEME VARIABLES
   ============================================ */
:root {
  /* Colors - Primary */
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  
  /* Colors - Secondary & Accents */
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --danger-color: #ef4444;

  /* Text Colors */
  --text-primary: #e5e7eb;
  --text-secondary: #cbd5e1;
  --text-light: #94a3b8;
  
  /* Background Colors */
  --bg-primary: #0f172a;
  --bg-secondary: #0b1220;
  --bg-tertiary: #111827;
  --border-color: #1f2a44;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.55);

  /* Layout */
  --container-max-width: 1280px;
  --section-padding: 80px 20px;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HEADER
   ============================================ */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("{% static 'home_tools/img/bg-dots.svg' %}");
  background-repeat: repeat;
  background-size: auto;
  opacity: 0.1;
  pointer-events: none;
}

.header-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.header h1 {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 15px;
  letter-spacing: -0.02em;
}

.header p {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 15px 20px;
}

.breadcrumb-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-dark);
}

.breadcrumb-separator {
  color: var(--text-light);
}

/* ============================================
   CONTAINER
   ============================================ */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: var(--section-padding);
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
  margin-bottom: 50px;
}

.search-container {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 16px 50px 16px 20px;
  font-size: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-primary);
  transition: all 0.3s ease;
  font-family: inherit;
  color: var(--text-primary);
}

.search-input::placeholder {
  color: var(--text-light);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1.25rem;
}

/* ============================================
   CATEGORY FILTERS
   ============================================ */
.category-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 50px;
}

.category-btn {
  padding: 10px 24px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.3s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.category-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

.category-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* ============================================
   TOOLS GRID
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

/* ============================================
   TOOL CARDS
   ============================================ */
.tool-card {
  background: var(--bg-primary);
  border-radius: 16px;
  padding: 30px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeIn 0.5s ease forwards;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.tool-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.tool-card:hover::before {
  transform: scaleX(1);
}

.tool-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(7, 70, 207, 0.1), rgba(37, 99, 235, 0.05));
  color: var(--primary-color);
}

.tool-card h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.tool-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.tool-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--text-light);
}

.tool-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.tool-meta-item i {
  font-size: 0.875rem;
}

.tool-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-badge.new {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary-color);
}

.tool-badge.popular {
  background: rgba(245, 158, 11, 0.1);
  color: var(--accent-color);
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  transition: gap 0.3s ease;
}

.tool-link:hover {
  gap: 12px;
}

.tool-link i {
  font-size: 0.875rem;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  border-radius: 20px;
  padding: 50px 30px;
  margin-bottom: 50px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("{% static 'home_tools/img/bg-dots.svg' %}");
  background-repeat: repeat;
  background-size: auto;
  opacity: 0.1;
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: block;
}

.stat-label {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 500;
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta-section {
  background: var(--bg-primary);
  border-radius: 20px;
  padding: 50px 30px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.cta-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.cta-section p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 600px;
  margin-inline: auto;
}

.cta-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  padding: 14px 32px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary-color);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 2px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-primary);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 20px;
  margin-top: 80px;
}

.footer-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-section h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.9375rem;
}

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

.footer-bottom {
  max-width: var(--container-max-width);
  margin: 40px auto 0;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: none;
  text-align: center;
  padding: 80px 20px;
}

.empty-state i {
  font-size: 4rem;
  color: var(--text-light);
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ============================================
   RIPPLE EFFECT
   ============================================ */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: scale(0);
  animation: ripple-animation 0.6s ease-out;
  pointer-events: none;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.btn:focus-visible,
.category-btn:focus-visible,
.tool-link:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
  /* Header */
  .header h1 {
    font-size: 2rem;
  }

  .header p {
    font-size: 1rem;
  }

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

  /* Category Filters */
  .category-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }

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

  /* Stats */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* CTA Section */
  .cta-section h2 {
    font-size: 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   END OF STYLESHEET
   ============================================ */
