* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #B0DB9C;
    --secondary-color: #8fc77d;
    --primary-dark: #7ab566;
    --background-color: #f8fafc;
    --sidebar-bg: #fff;
    --main-bg: #f8fafc;
    --card-bg: #fff;
    --text-color: #1e293b;
    --muted-text: #64748b;
    --border-radius: 16px;
    --shadow: 0 4px 24px rgba(176, 219, 156, 0.15);
    --transition: all 0.2s cubic-bezier(.4,0,.2,1);
    --badge-featured: #B0DB9C;
    --badge-trending: #fbbf24;
    --badge-paid: #f87171;
    --badge-freemium: #34d399;
    --badge-beta: #a78bfa;
    --input-bg: #fff;
    --input-border: #e2e8f0;
    --tag-bg: #f1f5f9;
    --sidebar-about-bg: #f1f5f9;
    --footer-bg: #1e293b;
    --footer-text: #e2e8f0;
    --footer-link: #B0DB9C;
    --content-max-width: 1320px;
    --content-gap: 2rem;
    --card-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --card-shadow-hover: 0 14px 34px rgba(15, 23, 42, 0.12);
    --bg-color: var(--background-color);
    --border-color: var(--input-border);
    --heading-color: var(--text-color);
    --text-muted: var(--muted-text);
    --primary: var(--primary-color);
}

[data-theme="dark"] {
    --primary-color: #8fc77d;
    --secondary-color: #B0DB9C;
    --primary-dark: #7ab566;
    --background-color: #0f172a;
    --sidebar-bg: #1e293b;
    --main-bg: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --muted-text: #94a3b8;
    --shadow: 0 4px 24px rgba(176, 219, 156, 0.1);
    --input-bg: #1e293b;
    --input-border: #334155;
    --tag-bg: #334155;
    --sidebar-about-bg: #334155;
    --footer-bg: #0f172a;
    --footer-text: #e2e8f0;
    --footer-link: #B0DB9C;
    --card-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
    --card-shadow-hover: 0 16px 36px rgba(2, 6, 23, 0.5);
    --bg-color: var(--background-color);
    --border-color: var(--input-border);
    --heading-color: var(--text-color);
    --text-muted: var(--muted-text);
    --primary: var(--primary-color);
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden; /* Prevent horizontal scrolling */
    overflow-y: auto; /* Enable vertical scrolling for the body */
    width: 100%;
    max-width: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    z-index: 2000;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    transition: top 0.2s ease;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 1rem;
}

/* Enhanced theme transition styles */
.theme-transitioning * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

/* Theme toggle button enhanced styles */
.theme-toggle {
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(176, 219, 156, 0.4);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

/* My Tools Section Styles */
.tools-section {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin: 32px 0;
    border: 1px solid var(--input-border);
    transition: var(--transition);
}

.tools-section h2 {
    font-size: 1.6rem;
    margin-bottom: 18px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tools-list {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: center;
    margin-bottom: 16px;
    min-height: 80px;
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding: 8px;
    border-radius: 12px;
}

.tool-item:hover {
    background: var(--tag-bg);
    transform: translateY(-2px);
}
.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f4f4f4;
    object-fit: contain;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.tool-name {
    font-size: 0.95rem;
    color: #222;
    text-align: center;
    margin-bottom: 2px;
}
.edit-btn {
    background: #f5f5f5;
    border: none;
    color: #222;
    font-size: 1rem;
    padding: 6px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    float: right;
}
.edit-btn:hover {
    background: #e0e0e0;
}

/* Tool Edit and Delete Button Styles */
.tool-edit, .tool-delete {
  position: absolute;
  top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-color);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 2;
  line-height: 1;
}

.tool-edit {
  right: 60px;
  background: var(--primary-color);
  color: var(--text-color);
}

.tool-delete {
  right: 4px;
  background: #ef4444;
  color: white;
  border-color: #dc2626;
}

.tool-edit:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(176, 219, 156, 0.3);
}

.tool-delete:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}
/* Modal Styles */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  min-width: 400px;
  max-width: 90vw;
  position: relative;
  border: 1px solid var(--input-border);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from { 
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to { 
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-color);
  font-size: 1.4rem;
  font-weight: 600;
}

.modal-content label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.9rem;
}

.modal-content input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-color);
  font-size: 1rem;
  transition: var(--transition);
  box-sizing: border-box;
}

.modal-content input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(176, 219, 156, 0.1);
}

/* Auto Logo Fetch additions */
.icon-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: -8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.fetch-logo-btn {
    background: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: var(--transition);
}
.fetch-logo-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}
.icon-hint {
    font-size: 0.7rem;
    color: var(--muted-text);
}
.icon-preview {
    width: 72px;
    height: 72px;
    border: 1px dashed var(--input-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--input-bg);
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}
.icon-preview img { width: 100%; height: 100%; object-fit: contain; }
.icon-preview-placeholder { font-size: 0.65rem; color: var(--muted-text); text-align:center; padding:4px; }
.icon-preview.loading::after { content: 'Fetching...'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:0.65rem; backdrop-filter: blur(2px); background:rgba(255,255,255,0.6); color:#333; }
[data-theme="dark"] .icon-preview.loading::after { background:rgba(0,0,0,0.4); color: var(--text-color); }
[data-theme="dark"] .icon-preview { border-color: var(--input-border); }

.tool-form-status {
    border-radius: 8px;
    margin: 4px 0 12px;
    padding: 10px 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.tool-form-status.is-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}

.tool-form-status.is-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #166534;
}

.tool-form-status.is-warning {
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #92400e;
}

[data-theme="dark"] .tool-form-status.is-error {
    color: #fecaca;
}

[data-theme="dark"] .tool-form-status.is-success {
    color: #bbf7d0;
}

[data-theme="dark"] .tool-form-status.is-warning {
    color: #fcd34d;
}


.modal-content button[type="submit"] {
  background: var(--primary-color);
  color: var(--text-color);
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  margin-top: 8px;
  transition: var(--transition);
  width: 100%;
  box-shadow: 0 2px 8px rgba(176, 219, 156, 0.3);
}

.modal-content button[type="submit"]:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(176, 219, 156, 0.4);
}

.close {
  position: absolute;
  top: 16px;
  right: 20px;
    border: none;
    background: transparent;
    padding: 0;
  font-size: 1.5rem;
  color: var(--muted-text);
  cursor: pointer;
  transition: var(--transition);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close:hover {
  background: var(--tag-bg);
  color: var(--text-color);
}

/* Dark mode specific enhancements for My Tools */
[data-theme="dark"] .tools-section {
  border-color: var(--input-border);
  background: var(--card-bg);
}

[data-theme="dark"] .tool-icon {
  background: var(--sidebar-bg);
  border: 1px solid var(--input-border);
}

[data-theme="dark"] .modal {
  background: rgba(0,0,0,0.8);
}

[data-theme="dark"] .modal-content {
  border-color: var(--input-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

[data-theme="dark"] .tool-edit,
[data-theme="dark"] .tool-delete {
  background: var(--sidebar-bg);
  border-color: var(--input-border);
  color: var(--text-color);
}

[data-theme="dark"] .tool-edit {
  background: var(--primary-color);
  color: var(--text-color);
}

[data-theme="dark"] .tool-delete {
  background: #ef4444;
  color: white;
  border-color: #dc2626;
}/* Custom Scrollbar Styles */
/* For WebKit browsers (Chrome, Safari) */
::-webkit-scrollbar {
    width: 10px; /* width of the scrollbar */
}

::-webkit-scrollbar-track {
    background: var(--main-bg); /* Color of the tracking area */
    border-radius: 10px; /* Rounded corners for the track */
}

::-webkit-scrollbar-thumb {
    background: #000; /* Color of the scroll thumb */
    border-radius: 10px; /* Rounded corners for the thumb */
    border: 2px solid var(--main-bg); /* Space around thumb */
}

/* For Firefox */
html {
    scrollbar-width: thin; /* "auto" or "thin" */
    scrollbar-color: #000 var(--main-bg); /* thumb color track color */
}

.layout {
    display: flex;
    background: var(--main-bg);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar {
    width: 270px;
    background: var(--sidebar-bg);
    box-shadow: 2px 0 16px rgba(0,0,0,0.04);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto; /* Allow internal scrolling for sidebar content */
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px 0px 20px;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0;
    margin-top: 10px;
}

.sidebar-categories h3,
.sidebar-about h3 {
    font-size: 1rem;
    margin-bottom: 0;
    color: var(--muted-text);
    font-weight: 600;
}

.sidebar-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-categories li {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    cursor: pointer;
    color: var(--text-color);
    transition: var(--transition);
    font-size: 1rem;
}

.sidebar-nav {
    margin-top: 1.5rem;
}

.sidebar-nav-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.sidebar-nav-icon {
    margin-right: 0.5rem;
}

.sidebar-categories li.active,
.sidebar-categories li:hover {
    background: var(--primary-color);
    color: #fff;
}

.sidebar-about {
    font-size: 0.95rem;
    color: var(--text-color);
    background: var(--sidebar-about-bg);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    margin-top: auto;
    border: 1px solid var(--input-border);
}

.sidebar-about h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.sidebar-about p {
    line-height: 1.6;
    margin: 0;
    color: var(--text-color);
    opacity: 0.9;
}

.sidebar-about .copyright {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--input-border);
    font-size: 0.85rem;
    color: var(--muted-text);
    text-align: center;
}

.main-content {
    flex: 1;
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: var(--content-max-width);
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

.main-content > section {
    margin-bottom: var(--content-gap);
}

.main-content > section:last-of-type {
    margin-bottom: 0;
}

/* ===== Hero Section - Redesigned ===== */
.hero-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--background-color) 100%);
    border-radius: var(--border-radius);
    padding: 4rem 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--input-border);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(176, 219, 156, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: min(1200px, 100%);
    margin: 0 auto;
    text-align: center;
}

.hero-headline {
    font-size: 3.2rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero-headline::after {
    content: '';
    display: block;
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 1rem auto 0;
    border-radius: 3px;
}

.hero-subheadline {
    font-size: 1.25rem;
    color: var(--muted-text);
    line-height: 1.7;
    margin-bottom: 2.5rem;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

/* Desktop: reduce side gutters so hero/content fills the viewport better */
@media (min-width: 1200px) {
    .main-content {
        max-width: none;
        margin: 0;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-subheadline {
        max-width: 1050px;
    }
}

@media (min-width: 1440px) {
    .main-content {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .tools-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Hero CTA Button */
.hero-primary-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--primary-color);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(176, 219, 156, 0.35);
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
}

.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(176, 219, 156, 0.45);
}

.hero-cta:hover::before {
    opacity: 1;
}

.hero-cta:active {
    transform: translateY(-1px);
}

.hero-cta span,
.hero-cta i {
    position: relative;
    z-index: 1;
}

.hero-cta i {
    transition: transform 0.3s ease;
}

.hero-cta:hover i {
    transform: translateX(5px);
}

.hero-nav-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 56px;
    padding: 0.95rem 1.2rem;
    border-radius: 14px;
    border: 1px solid var(--input-border);
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
}

.hero-nav-action:hover {
    border-color: var(--primary-color);
    background: var(--tag-bg);
    transform: translateY(-2px);
}

.hero-nav-action i {
    color: var(--primary-color);
}

/* Quick Categories in Hero */
.hero-quick-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 0 0 2rem;
}

.category-pill {
    appearance: none;
    border: 1.5px solid var(--input-border);
    background: var(--tag-bg);
    color: var(--text-color);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.category-pill:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
}
.category-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(176, 219, 156, 0.35);
}

/* Featured Tools Section */
.hero-featured-tools {
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.featured-label {
    font-size: 0.95rem;
    color: var(--muted-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.hero-tool-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.hero-tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    background: var(--card-bg);
    border: 2px solid var(--input-border);
}

.hero-tool-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.3s ease;
}

.hero-tool-icon:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 24px rgba(176, 219, 156, 0.3);
    border-color: var(--primary-color);
}

.hero-tool-icon:hover img {
    transform: scale(1.1);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: var(--tag-bg);
    border-radius: 50px;
    max-width: fit-content;
    margin: 0 auto;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.hero-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--muted-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.hero-stat-divider {
    width: 2px;
    height: 40px;
    background: var(--input-border);
    border-radius: 1px;
}

/* ===== Search & Filter Section ===== */
.main-header {
    margin-bottom: 1.5rem;
}
.main-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
    flex-wrap: wrap;
}
.header-content {
    flex: 1;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}
.main-header-top h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-weight: 500;
    opacity: 0.9;
    border-left: 4px solid var(--primary-color);
    padding-left: 1.2rem;
    margin-left: -1.2rem;
}

.header-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted-text);
    font-weight: 500;
}

.tools-counter {
    color: var(--muted-text);
    font-size: 1rem;
    padding-top: 0.5rem;
    background: var(--tag-bg);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    font-weight: 500;
}

.main-header-actions {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto auto;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    background: var(--card-bg);
    padding: 1.1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--input-border);
}
.search-container {
    position: relative;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.search-container input {
    width: 100%;
    min-height: 46px;
    padding: 0.75rem 2.8rem 0.75rem 2.5rem;
    border: 2px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--input-bg);
    color: var(--text-color);
    transition: var(--transition);
}
.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(176, 219, 156, 0.2);
}
.search-container > i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a1a1aa;
}

.search-clear-btn {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.8rem;
    height: 1.8rem;
    border: none;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--muted-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-clear-btn:hover {
    color: var(--text-color);
    background: var(--input-border);
}

.search-clear-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
#sortSelect {
    min-height: 46px;
    min-width: 140px;
    padding: 0.7rem 1.2rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: var(--transition);
    box-sizing: border-box;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.15rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--input-border);
}

.tools-catalog-section {
    scroll-margin-top: 2rem;
}

.featured-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0;
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    background: var(--tag-bg);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted-text);
    transition: var(--transition);
}

.view-btn:hover, .view-btn.active {
    background: var(--primary-color);
    color: white;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.25rem;
    width: 100%;
    box-sizing: border-box;
    /* Stretch items to equal height per row so action buttons align */
    align-items: stretch;
}

.tools-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.empty-state {
    display: none;
    text-align: center;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--card-shadow);
}

.empty-state-reset-btn {
    margin-top: 1rem;
    border: none;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.empty-state-reset-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.empty-state-reset-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Load More Button */
.load-more-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 3rem 0 2rem;
    gap: 1rem;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #1e293b;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(176, 219, 156, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(176, 219, 156, 0.4);
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(176, 219, 156, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-btn:disabled:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(176, 219, 156, 0.3);
}

.load-more-spinner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.load-more-info {
    color: var(--muted-text);
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
    transition: color 0.3s ease;
}

.load-more-info.error {
    color: var(--badge-paid);
    font-weight: 600;
}

/* Loading state visual feedback */
.load-more-btn[aria-busy="true"] {
    pointer-events: none;
    opacity: 0.8;
}

.load-more-btn.error {
    background: linear-gradient(135deg, var(--badge-paid), #ef4444);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Success feedback */
.load-more-container.success::after {
    content: '✓ Loaded successfully';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--badge-freemium);
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    animation: fadeInOut 2s ease;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

[data-theme="dark"] .load-more-btn {
    color: #0f172a;
}

[data-theme="dark"] .show-more-btn {
    color: var(--primary-color);
}

[data-theme="dark"] .show-more-btn:hover {
    color: var(--secondary-color);
}

[data-theme="dark"] .show-more-tags-btn {
    background: var(--tag-bg);
    border-color: var(--input-border);
    color: var(--primary-color);
}

[data-theme="dark"] .show-more-tags-btn:hover {
    background: var(--primary-color);
    color: #0f172a;
}

/* Loading progress bar */
.load-more-container.loading {
    position: relative;
}

.load-more-container.loading::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 300px;
    height: 3px;
    background: linear-gradient(90deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: loadingProgress 1.5s ease-in-out infinite;
    border-radius: 10px;
    opacity: 0.7;
}

@keyframes loadingProgress {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner h2 {
    margin-top: 1rem;
    color: var(--text-color);
    font-size: 1.5rem;
}

.tool-card {
    background-color: var(--card-bg);
    border-radius: 14px;
    padding: 1.2rem;
    border: 1px solid var(--input-border);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s ease-in;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---- Keyboard focus visibility (Day 13) ---- */
/*
  Single source of truth for all focus rings.
  Uses :focus-visible so mouse users are never shown the ring.
*/
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

/* Suppress browser default outline only where we define our own */
.category-pill:focus-visible,
.view-btn:focus-visible,
.hero-cta:focus-visible,
.hero-nav-action:focus-visible,
.load-more-btn:focus-visible,
.edit-btn:focus-visible,
.tool-edit:focus-visible,
.tool-delete:focus-visible,
.fetch-logo-btn:focus-visible,
.theme-toggle:focus-visible,
.back-to-top:focus-visible,
.sidebar-toggle:focus-visible,
.skip-link:focus-visible,
.sidebar-categories a:focus-visible,
#categoryList li:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 5px rgba(176, 219, 156, 0.25);
}

/* Pills and view buttons get a rounder ring to match their shape */
.category-pill:focus-visible {
    outline-offset: 4px;
}

/* Sidebar category items are keyboard-focusable via JS role/tabindex setup */
#categoryList li:focus-visible {
    border-radius: 8px;
}

/* Link-style items keep underline cue as well */
.sidebar-categories a:focus-visible,
.hero-nav-action:focus-visible {
    text-decoration: underline;
    text-underline-offset: 3px;
}
/* ---- end focus visibility ---- */

/* ---- Skeleton cards (Day 12) ---- */
@keyframes skeletonShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.tool-card-skeleton {
    background-color: var(--card-bg);
    border-radius: 14px;
    padding: 1.2rem;
    border: 1px solid var(--input-border);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    gap: 12px;
    pointer-events: none;
    overflow: hidden;
}

.skeleton-block {
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--input-border) 25%,
        var(--card-bg)      50%,
        var(--input-border) 75%
    );
    background-size: 800px 100%;
    animation: skeletonShimmer 1.4s infinite linear;
}

.skeleton-logo  { width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0; }
.skeleton-title { height: 16px; width: 65%; }
.skeleton-line  { height: 12px; width: 100%; }
.skeleton-line-short { height: 12px; width: 45%; }

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.skeleton-header-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* ---- end skeleton cards ---- */

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

/* List view styles */
.tools-grid.list-view {
    grid-template-columns: 1fr;
    gap: 1rem;
}

.tools-grid.list-view .tool-card {
    flex-direction: row;
    align-items: flex-start;
    padding: 1rem;
}

.tools-grid.list-view .tool-header {
    flex: 0 0 80px;
    margin-right: 1.5rem;
    flex-direction: column;
    align-items: center;
}

.tools-grid.list-view .tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tools-grid.list-view .tool-logo {
    width: 60px;
    height: 60px;
    margin-right: 0;
    margin-bottom: 0.5rem;
}

.tools-grid.list-view .tool-name {
    font-size: 1rem;
    text-align: center;
    margin: 0;
}

.tools-grid.list-view .tool-badges {
    margin-bottom: 0.5rem;
}

.tools-grid.list-view .tool-description {
    margin-bottom: 1rem;
}

.tools-grid.list-view .tags-container {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tools-grid.list-view .tool-tags {
    margin-right: 0.5rem;
}

.tools-grid.list-view .tool-footer {
    margin-top: auto;
}

.tools-grid.list-view .tool-card {
    flex-direction: row;
    align-items: flex-start;
    min-height: 120px;
    gap: 1.5rem;
}

.tools-grid.list-view .tool-header {
    width: 200px;
    flex-shrink: 0;
}

.tools-grid.list-view .tool-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tools-grid.list-view .tool-description {
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.tools-grid.list-view .tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
/* In list view (row layout), keep natural spacing for the CTA */
.tools-grid.list-view .tool-link {
    margin-top: 0.5rem;
}
.tool-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 8px;
    background: #f1f5f9;
    margin-bottom: 0.3rem;
    /* Image optimization: prevent layout shift and improve rendering */
    contain: layout style paint;
    will-change: auto;
}

/* Skeleton placeholder for loading images */
.tool-logo[src*="data:image"],
.tool-logo:not([src]) {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

[data-theme="dark"] .tool-logo {
    background: #334155;
}

[data-theme="dark"] .tool-logo[src*="data:image"],
[data-theme="dark"] .tool-logo:not([src]) {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}
.tool-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.tool-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}
.tool-badges {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    color: #fff;
    background: var(--primary-color);
    display: inline-block;
    margin-bottom: 0.1rem;
}
.badge.featured { background: var(--badge-featured); }
.badge.trending { background: var(--badge-trending); color: #fff; }
.badge.paid { background: var(--badge-paid); }
.badge.freemium { background: var(--badge-freemium); }

.tool-description {
    color: var(--muted-text);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    flex-grow: 1;
    line-height: 1.55;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.tool-description.truncated {
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-description-container {
    margin-bottom: 0.75rem;
}

/* Show More Button */
.show-more-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    position: relative;
}

.show-more-btn::after {
    content: '↓';
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.show-more-btn[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.show-more-btn:hover {
    color: var(--primary-dark);
    transform: translateX(2px);
}

.show-more-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.show-more-btn:focus:not(:focus-visible) {
    outline: none;
}

.show-more-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.show-more-btn:active {
    transform: translateX(0);
}

/* Show More Tags Button */
.show-more-tags-btn {
    background: var(--tag-bg);
    border: 1px solid var(--input-border);
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
}

.show-more-tags-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.show-more-tags-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.show-more-tags-btn:focus:not(:focus-visible) {
    outline: none;
}

.show-more-tags-btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.show-more-tags-btn:active {
    transform: scale(0.98);
}

.tool-tags-container {
    margin-bottom: 0.5rem;
}

.hidden-tags {
    animation: slideDown 0.3s ease-out forwards;
    transform-origin: top;
}

.hidden-tags.collapsed {
    animation: slideUp 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px) scaleY(0.95);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 200px;
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 200px;
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scaleY(0.95);
        max-height: 0;
    }
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}
.tag {
    background: var(--tag-bg);
    color: var(--muted-text);
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    display: inline-block;
}
.tool-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition);
    text-align: center;
    /* Push CTA to bottom inside flex column cards for consistent alignment */
    margin-top: auto;
}

.tool-link:hover {
    background: var(--primary-dark);
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(176, 219, 156, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner p {
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition), transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(176, 219, 156, 0.2);
    z-index: 100;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.sidebar-toggle {
    display: none;
    position: fixed;
    top: 1.2rem;
    left: 1.2rem;
    z-index: 1300;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    width: 54px;
    height: 54px;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(176, 219, 156, 0.2);
    transition: var(--transition), transform 0.3s ease;
    padding: 0;
}
.sidebar-toggle:active {
    background: var(--secondary-color);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

/* Footer Styles */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 2rem 1.5rem;
    margin-top: 3rem;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 1rem;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: var(--footer-text);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-section ul li a:hover {
    color: var(--footer-link);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    color: var(--footer-text);
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--footer-link);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* Media Queries */
@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet / Medium Screens */
@media (max-width: 1024px) {
    .hero-section {
        padding: 3rem 2rem;
    }
    
    .hero-headline {
        font-size: 2.5rem;
    }
    
    .hero-subheadline {
        font-size: 1.15rem;
    }
    
    .hero-stats {
        gap: 1.5rem;
    }
}

/* Mobile / Small Screens */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        width: 280px;
        max-width: 85vw;
        overflow-y: auto;
    }
    
    .sidebar.open {
        left: 0;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-container {
        width: 100%;
        margin-top: 1rem;
    }

    .main-header-actions {
        grid-template-columns: 1fr;
    }
    
    .sort-container {
        margin-top: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-options {
        margin-top: 1rem;
    }
    
    .tools-grid.list-view .tool-card {
        flex-direction: column;
    }
    
    .tools-grid.list-view .tool-header {
        flex: none;
        margin-right: 0;
        margin-bottom: 1rem;
        flex-direction: row;
    }
    
    .tools-grid.list-view .tool-logo {
        margin-right: 1rem;
        margin-bottom: 0;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .header-stats {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        gap: 1rem;
    }
    
    .stat-item {
        flex: 1;
        text-align: center;
        margin-bottom: 0;
    }
    
    /* Hero Section Mobile Styles */
    .hero-section {
        padding: 2.5rem 1.5rem;
    }
    
    .hero-headline {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-headline::after {
        width: 60px;
        height: 4px;
        margin-top: 0.75rem;
    }
    
    .hero-subheadline {
        font-size: 1.05rem;
        margin-bottom: 2rem;
    }
    
    .hero-cta {
        font-size: 1rem;
        padding: 0.875rem 2rem;
        margin-bottom: 0;
    }

    .hero-primary-actions {
        flex-direction: column;
        gap: 0.65rem;
        margin-bottom: 2rem;
    }

    .hero-nav-action {
        width: 100%;
        max-width: 280px;
    }
    
    .hero-featured-tools {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-tool-icons {
        gap: 0.75rem;
    }
    
    .hero-tool-icon {
        width: 48px;
        height: 48px;
    }
    
    .hero-tool-icon img {
        padding: 6px;
    }
    
    .featured-label {
        font-size: 0.85rem;
    }
    
    .hero-stats {
        gap: 1rem;
        padding: 1.25rem 1.5rem;
        flex-wrap: wrap;
    }
    
    .hero-stat-item {
        min-width: 70px;
    }
    
    .hero-stat-number {
        font-size: 1.5rem;
    }
    
    .hero-stat-label {
        font-size: 0.75rem;
    }
    
    .hero-stat-divider {
        height: 30px;
    }
    
    .main-header-top h1 {
        font-size: 1.5rem;
        width: 100%;
    }
    
    .subtitle {
        width: 100%;
        box-sizing: border-box;
    }
    
    .tools-counter {
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .search-container {
        width: 100%;
    }
    
    #sortSelect {
        width: 100%;
    }
    
    /* Ensure fixed buttons are properly positioned on mobile */
    .sidebar-toggle,
    .back-to-top,
    .theme-toggle {
        will-change: transform;
    }
    
    .sidebar-toggle {
        display: flex;
    }
    
    /* Adjust spacing between fixed buttons */
    .theme-toggle {
        bottom: 5.5rem;
    }
    
    .back-to-top {
        bottom: 9rem;
    }
    
    /* Load More Button Mobile */
    .load-more-container {
        margin: 2rem 0 1.5rem;
    }
    
    .load-more-btn {
        padding: 0.875rem 2rem;
        font-size: 0.95rem;
        min-width: 180px;
    }
    
    .load-more-info {
        font-size: 0.85rem;
    }
    
    /* Show More buttons mobile optimization */
    .show-more-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0;
        min-height: 44px; /* Touch target size */
        min-width: 44px;
    }
    
    .show-more-tags-btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
        min-height: 36px; /* Slightly smaller for tags */
    }
    
    .tool-description {
        font-size: 0.8rem;
    }
    
    .tool-description.truncated {
        line-clamp: 2;
        -webkit-line-clamp: 2;
    }
}

/* Footer Styles */
.site-footer {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding: 0 1.5rem;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1.2rem;
    color: var(--heading-color);
    position: relative;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background-color: var(--primary);
}

.footer-section p {
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}

.footer-section ul li a:hover {
    color: var(--primary);
}

.footer-section ul li a i {
    margin-right: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.2s;
}

.social-links a:hover {
    background-color: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 700px) {
    .main-content {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        width: 100%;
    }
    .main-header-actions {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.5rem;
    }
    .search-container {
        width: 100%;
    }
    #sortSelect {
        width: 100%;
    }
    .tool-card {
        padding: 0.8rem;
        min-height: 180px;
    }
    .tool-header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    .tool-logo {
        width: 28px;
        height: 28px;
        margin-bottom: 0;
    }
    .tool-name {
        font-size: 0.95rem;
    }
    .tool-badges {
        gap: 0.2rem;
    }
    .badge {
        font-size: 0.65rem;
        padding: 0.12rem 0.4rem;
    }
    .tool-description {
        font-size: 0.8rem;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        margin-bottom: 0.2rem;
    }
    .tool-tags {
        gap: 0.2rem;
        margin-bottom: 0.2rem;
    }
    .tag {
        font-size: 0.65rem;
        padding: 0.12rem 0.4rem;
    }
    .tool-link {
        width: 100%;
        text-align: center;
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    .main-header-top h1 {
        font-size: 1.5rem;
        margin-bottom: 0.4rem;
    }
    .subtitle {
        font-size: 0.9rem;
        padding-left: 0.6rem;
        margin-left: -0.6rem;
        border-left-width: 2px;
    }
    #toolCount {
        font-size: 0.8rem;
    }
    .featured-title {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    .sidebar {
        width: 100%;
        max-width: 250px;
        padding: 0.6rem;
    }
    .sidebar-header {
        flex-direction: row;
        align-items: center;
        gap: 0.3rem;
        padding: 0;
        margin-bottom: 0.4rem;
    }
    .sidebar-header h2 {
        font-size: 1.4rem;
        margin-top: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .logo {
        max-height: 30px;
        flex-shrink: 0;
    }
    .sidebar-categories {
        margin-bottom: 0.6rem;
    }
    .sidebar-categories h3,
    .sidebar-about h3 {
        font-size: 1.05rem;
        margin-bottom: 0.2rem;
    }
    .sidebar-categories ul {
        padding: 0;
        margin: 0;
    }
    .sidebar-categories li {
        padding: 0.5rem 1rem;
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
        line-height: 1.6;
        word-wrap: break-word;
    }
    .sidebar-about {
        padding: 1.2rem;
    }
    .sidebar-about p {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    .copyright {
        font-size: 0.65rem;
    }
    .back-to-top {
        right: 0.8rem;
        bottom: 0.8rem;
        width: 36px;
        height: 36px;
        will-change: transform;
    }
    .theme-toggle {
        right: 0.8rem;
        bottom: 4.5rem;
        width: 36px;
        height: 36px;
        will-change: transform;
    }
    .theme-toggle i {
        font-size: 0.9rem;
    }
    .search-container input {
        padding: 0.5rem 0.8rem 0.5rem 2.2rem;
        font-size: 0.9rem;
    }
    #sortSelect {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
    .main-header {
        margin-bottom: 1.2rem;
    }
    .main-header-top {
        margin-bottom: 1.2rem;
    }
    .main-header-actions {
        margin-top: 0.8rem;
        gap: 0.8rem;
    }
    .tools-grid {
        margin-top: 0.8rem;
    }
    .sidebar-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        top: 0.8rem;
        left: 0.8rem;
    }
}

/* Add smooth scrolling for mobile */
@media (max-width: 700px) {
    html {
        scroll-behavior: smooth;
    }
}

/* Improve touch targets for mobile */
@media (max-width: 700px) {
    .sidebar-categories li,
    .tool-link,
    .search-container input,
    #sortSelect {
        min-height: 40px;
    }
}

/* Add better spacing for mobile */
@media (max-width: 700px) {
    .main-header {
        margin-bottom: 1.5rem;
    }
    .main-header-top {
        margin-bottom: 1.5rem;
    }
    .main-header-actions {
        margin-top: 1rem;
    }
    .tools-grid {
        margin-top: 1rem;
    }
}

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition), transform 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1.2rem;
}

.sidebar-logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px; /* Adjust as needed for vertical space */
  margin-bottom: 12px;
}

.logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 50%; /* Optional: makes it circular */
  background: #fff;   /* Optional: white background for contrast */
  box-shadow: 0 2px 8px rgba(0,0,0,0.06); /* Optional: subtle shadow */
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
} 

/* Submission Form Styles */
.submission-section {
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: 16px;
    padding: 32px 28px 36px;
    margin: 48px 0 24px;
    box-shadow: var(--shadow);
    position: relative;
}
.submission-section h2 {
    margin-top: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}
.submission-intro {
    margin: 0 0 28px;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--muted-text);
    max-width: 760px;
}
.submission-form {
    display: flex;
    flex-direction: column;
    gap: 26px;
}
.submission-form .form-row {
    display: flex;
    flex-direction: column;
    position: relative;
}
.submission-form label {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--text-color);
}
.submission-form input[type="text"],
.submission-form input[type="url"] {
    padding: 14px 16px;
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-color);
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.submission-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(176,219,156,0.15);
}
.field-hint {
    margin-top: 6px;
    font-size: 0.7rem;
    color: var(--muted-text);
    letter-spacing: .3px;
}
.field-error {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #dc2626;
    min-height: 14px;
    letter-spacing: .3px;
}
.submission-form input.error {
    border-color: #dc2626;
    background: rgba(220,38,38,0.05);
}
.form-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.submit-btn, .reset-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: .4px;
    padding: 14px 22px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
}
.submit-btn {
    background: var(--primary-color);
    color: var(--text-color);
    box-shadow: 0 4px 14px -2px rgba(176,219,156,0.4);
}
.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -2px rgba(176,219,156,0.45);
}
.submit-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}
.reset-btn {
    background: var(--tag-bg);
    color: var(--text-color);
}
.reset-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}
.form-status {
    margin-top: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted-text);
    min-height: 16px;
}
.form-status.success { color: #15803d; }
.form-status.error { color: #dc2626; }

@media (max-width: 700px) {
    .submission-section { padding: 28px 22px 32px; margin: 40px 0 16px; }
    .submission-section h2 { font-size: 1.5rem; }
    .submission-form { gap: 22px; }
    .submit-btn, .reset-btn { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 700px) {
  .sidebar-logo-container {
    width: 56px;
    height: 56px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 4px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    overflow: hidden;
  }
  .logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
  }
}


/* ============================================================
   UI REFRESH 2026 — Premium Design & Aesthetic Polish Layer
   Elevates Toolly's clean light/white + green identity with
   glassmorphism, modern typography, rich micro-animations,
   and deep slate dark mode.
   ============================================================ */

/* ---------- 1. Typography & Global Polish ---------- */
body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
                 Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

::selection {
    background: rgba(176, 219, 156, 0.45);
    color: #1e293b;
}

/* Thin, rounded scrollbar with brand-colored thumb */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(176, 219, 156, 0.8) transparent;
}
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: rgba(176, 219, 156, 0.7);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
    background: rgba(122, 181, 102, 0.9);
    background-clip: content-box;
}

/* ---------- 2. Hero — Ambient Radial Glow & Gradient ---------- */
.hero-section {
    background:
        radial-gradient(ellipse 60% 70% at 10% 10%, rgba(176, 219, 156, 0.2) 0%, transparent 65%),
        radial-gradient(ellipse 50% 60% at 90% 90%, rgba(143, 199, 125, 0.15) 0%, transparent 60%),
        linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f2f9ee 100%);
    border: 1px solid rgba(176, 219, 156, 0.45);
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.03),
        0 14px 44px rgba(176, 219, 156, 0.16);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.hero-headline {
    background: linear-gradient(125deg, #0f172a 30%, #2f5424 65%, #6aa855 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.hero-subheadline {
    font-size: 1.15rem;
    letter-spacing: 0.01em;
    color: var(--muted-text);
    line-height: 1.7;
}

.hero-stat-number {
    background: linear-gradient(120deg, #3f6e2f, #7ab566);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* ---------- 3. Buttons & CTA Elements ---------- */
.hero-cta {
    background: linear-gradient(135deg, #9dd485 0%, #68a952 100%);
    box-shadow:
        0 2px 4px rgba(94, 141, 74, 0.22),
        0 8px 24px rgba(122, 181, 102, 0.38);
    border: 1px solid rgba(122, 181, 102, 0.55);
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta:hover {
    background: linear-gradient(135deg, #93cf79 0%, #5d9e47 100%);
    box-shadow:
        0 4px 8px rgba(94, 141, 74, 0.26),
        0 14px 32px rgba(122, 181, 102, 0.48);
    transform: translateY(-2px);
}

.hero-nav-action {
    background: #ffffff;
    border: 1px solid rgba(176, 219, 156, 0.6);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-nav-action:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(176, 219, 156, 0.35);
    transform: translateY(-2px);
}

.tool-link {
    background: linear-gradient(135deg, #9dd485 0%, #68a952 100%);
    box-shadow: 0 1px 3px rgba(94, 141, 74, 0.2);
    border: 1px solid rgba(122, 181, 102, 0.45);
    font-weight: 600;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-link:hover {
    background: linear-gradient(135deg, #93cf79 0%, #5d9e47 100%);
    box-shadow: 0 6px 18px rgba(122, 181, 102, 0.42);
    transform: translateY(-1.5px);
}

/* ---------- 4. Tool Cards — Soft Brand Glow on Hover ---------- */
.tool-card {
    border-radius: 18px;
    padding: 1.4rem;
    border: 1px solid rgba(226, 232, 240, 0.85);
    background: var(--card-bg);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 6px 18px rgba(15, 23, 42, 0.04);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.28s ease;
}

.tool-card:hover {
    transform: translateY(-6px);
    border-color: rgba(176, 219, 156, 0.85);
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 18px 40px rgba(15, 23, 42, 0.09),
        0 8px 26px rgba(176, 219, 156, 0.3);
}

.tool-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    padding: 3px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: transform 0.25s ease;
    object-fit: contain;
}

.tool-card:hover .tool-logo {
    transform: scale(1.08);
}

[data-theme="dark"] .tool-logo {
    background: #1e293b;
    border-color: #334155;
}

.tool-name {
    font-weight: 700;
    letter-spacing: -0.015em;
    font-size: 1.15rem;
}

/* ---------- 5. Badges — Modern Translucent Pills ---------- */
.badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: capitalize;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    color: #3f6631;
    background: rgba(176, 219, 156, 0.28);
    border: 1px solid rgba(176, 219, 156, 0.55);
    display: inline-flex;
    align-items: center;
    line-height: 1.3;
}

.badge.featured {
    color: #2e5421;
    background: rgba(176, 219, 156, 0.35);
    border-color: rgba(143, 199, 125, 0.7);
}

.badge.trending {
    color: #925f0a;
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.5);
}

.badge.paid {
    color: #b42318;
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.4);
}

.badge.freemium {
    color: #047857;
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.45);
}

.badge.beta {
    color: #6d28d9;
    background: rgba(167, 139, 250, 0.16);
    border-color: rgba(167, 139, 250, 0.45);
}

.badge.new {
    color: #1d4ed8;
    background: rgba(96, 165, 250, 0.16);
    border-color: rgba(96, 165, 250, 0.45);
}

.badge.popular {
    color: #0e7490;
    background: rgba(34, 211, 238, 0.15);
    border-color: rgba(34, 211, 238, 0.4);
}

.badge.open-source,
.badge.open\ source {
    color: #3f6631;
    background: rgba(176, 219, 156, 0.28);
    border-color: rgba(176, 219, 156, 0.55);
}

.badge.free {
    color: #047857;
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.45);
}

.badge.enterprise {
    color: #1e293b;
    background: rgba(100, 116, 139, 0.15);
    border-color: rgba(100, 116, 139, 0.35);
}

[data-theme="dark"] .badge { color: #c4e9b4; border-color: rgba(143, 199, 125, 0.4); }
[data-theme="dark"] .badge.trending { color: #fcd34d; border-color: rgba(251, 191, 36, 0.4); }
[data-theme="dark"] .badge.paid { color: #fca5a5; border-color: rgba(248, 113, 113, 0.4); }
[data-theme="dark"] .badge.freemium { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.4); }
[data-theme="dark"] .badge.beta { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.4); }
[data-theme="dark"] .badge.new { color: #93c5fd; border-color: rgba(96, 165, 250, 0.4); }
[data-theme="dark"] .badge.popular { color: #67e8f9; border-color: rgba(34, 211, 238, 0.4); }
[data-theme="dark"] .badge.enterprise { color: #cbd5e1; border-color: rgba(148, 163, 184, 0.35); }

/* ---------- 6. Search Input & Controls ---------- */
.search-container input {
    border-radius: 999px;
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) inset;
    padding-left: 2.75rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.search-container input::placeholder { color: #94a3b8; }

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow:
        0 0 0 4px rgba(176, 219, 156, 0.24),
        0 1px 3px rgba(15, 23, 42, 0.04);
}

#sortSelect {
    border-radius: 999px;
    border: 1.5px solid var(--input-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
    cursor: pointer;
    font-weight: 500;
}

#sortSelect:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(176, 219, 156, 0.24);
}

/* ---------- 7. Category Pills & View Buttons ---------- */
.category-pill {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 999px;
}

.category-pill:hover {
    border-color: rgba(176, 219, 156, 0.85);
    color: #3f6631;
    transform: translateY(-1px);
}

.category-pill.active {
    background: linear-gradient(135deg, #9dd485 0%, #68a952 100%);
    border-color: rgba(122, 181, 102, 0.6);
    color: #fff;
    box-shadow: 0 6px 18px rgba(122, 181, 102, 0.38);
}

.view-btn {
    border-radius: 10px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: rgba(176, 219, 156, 0.25);
    color: #3f6631;
}

.view-btn.active {
    background: linear-gradient(135deg, #9dd485 0%, #68a952 100%);
    box-shadow: 0 4px 12px rgba(122, 181, 102, 0.32);
}

/* ---------- 8. Sidebar Styling ---------- */
#categoryList li {
    border-radius: 10px;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    padding: 10px 14px;
    font-weight: 500;
}

#categoryList li:hover {
    background: rgba(176, 219, 156, 0.2);
    color: #2f5424;
    transform: translateX(3px);
}

#categoryList li.active {
    background: linear-gradient(135deg, rgba(163, 214, 140, 0.25), rgba(122, 181, 102, 0.2));
    border: 1px solid rgba(176, 219, 156, 0.6);
    font-weight: 700;
    color: #27471d;
}

/* ---------- 9. My Tools Modal Polish ---------- */
.modal {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(15, 23, 42, 0.6) !important;
}

.modal-content {
    border-radius: 20px !important;
    border: 1px solid rgba(176, 219, 156, 0.4) !important;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25) !important;
    max-width: 480px !important;
}

.modal-content input[type="text"],
.modal-content input[type="url"] {
    border-radius: 10px;
    border: 1.5px solid var(--input-border);
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.modal-content input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(176, 219, 156, 0.25);
    outline: none;
}

/* ---------- 10. Dark Mode Refinements ---------- */
[data-theme="dark"] {
    --background-color: #0b1120;
    --main-bg: #0b1120;
    --sidebar-bg: #0f172a;
    --card-bg: #131d31;
    --text-color: #f1f5f9;
    --muted-text: #94a3b8;
    --input-bg: #131d31;
    --input-border: #1e293b;
    --tag-bg: #1e293b;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 16px 36px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .hero-section {
    background:
        radial-gradient(ellipse 60% 70% at 10% 10%, rgba(143, 199, 125, 0.12) 0%, transparent 65%),
        radial-gradient(ellipse 50% 60% at 90% 90%, rgba(122, 181, 102, 0.08) 0%, transparent 60%),
        linear-gradient(165deg, #131d31 0%, #0f172a 60%, #0b1120 100%);
    border-color: rgba(143, 199, 125, 0.25);
    box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hero-headline {
    background: linear-gradient(125deg, #f8fafc 30%, #b0db9c 75%, #8fc77d 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-nav-action {
    background: #131d31;
    border-color: rgba(143, 199, 125, 0.3);
    color: #f1f5f9;
}

[data-theme="dark"] .category-pill {
    background: #131d31;
    border-color: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .category-pill:hover {
    border-color: rgba(143, 199, 125, 0.6);
    color: #b0db9c;
}

[data-theme="dark"] #categoryList li.active {
    background: linear-gradient(135deg, rgba(143, 199, 125, 0.2), rgba(122, 181, 102, 0.15));
    border-color: rgba(143, 199, 125, 0.45);
    color: #b0db9c;
}

[data-theme="dark"] .modal-content {
    background: #131d31;
    border-color: rgba(143, 199, 125, 0.3) !important;
}

/* ---------- 11. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .tool-card,
    .tool-logo,
    .category-pill,
    .hero-cta,
    .hero-nav-action,
    .tool-link,
    #categoryList li {
        transition: none !important;
        animation: none !important;
    }
}


/* Enhanced Tool Logo & Fallback Styling */
.tool-logo {
    text-indent: -9999px;
    color: transparent;
}
.tool-logo[src*="data:image/svg+xml"] {
    background: transparent !important;
    animation: none !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] .tool-logo[src*="data:image/svg+xml"] {
    background: transparent !important;
    border-color: rgba(255, 255, 255, 0.1);
}
