﻿/*
Theme Name: ToolFlic
Theme URI: https://toolflic.com
Author: ToolFlic Team
Author URI: https://toolflic.com
Description: A modern, premium tools website theme with 92+ free online tools. Features glassmorphism design, dark mode, and fully responsive layout.
Version: 1.0.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toolflic
Tags: tools, glassmorphism, dark-mode, responsive
*/

/* ========== CSS RESET & VARIABLES ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #10b981;
  --dark-green: #047857;
  --light-green: #d1fae5;
  --accent: #f59e0b;
  --dark-bg: #111827;
  --light-bg: #ffffff;
  --text-dark: #1f2937;
  --text-light: #f9fafb;
  --bg: var(--light-bg);
  --text: var(--text-dark);
  --card-bg: rgba(255, 255, 255, 0.85);
  --card-border: rgba(16, 185, 129, 0.15);
  --section-bg: #f0fdf4;
  --input-bg: #f9fafb;
  --input-border: #d1d5db;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.dark-mode {
  --bg: var(--dark-bg);
  --text: var(--text-light);
  --card-bg: rgba(30, 41, 59, 0.8);
  --card-border: rgba(16, 185, 129, 0.2);
  --section-bg: #0f172a;
  --input-bg: #1e293b;
  --input-border: #374151;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* ========== BASE STYLES ========== */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--transition);
}

a:hover {
  color: var(--dark-green);
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text);
  line-height: 1.3;
  font-weight: 700;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2.2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.2rem;
}

p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 80px 0;
}

/* ========== GLASSMORPHISM CARD ========== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.glass-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

/* ========== HEADER / NAVIGATION ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(16, 185, 129, 0.1);
  transition: background var(--transition), border-color var(--transition);
}

body.dark-mode .site-header {
  background: rgba(17, 24, 39, 0.9);
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  display: inline-block;
  letter-spacing: 0;
  white-space: nowrap;
}
.site-logo span {
  color: var(--primary);
}

.site-logo span {
  color: var(--primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-nav a {
  color: var(--text);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  font-size: 0.95rem;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary);
  background: var(--light-green);
}

body.dark-mode .main-nav a:hover,
body.dark-mode .main-nav a.active {
  background: rgba(16, 185, 129, 0.15);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 50px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition);
  color: var(--text);
  font-size: 0;
}
.dark-mode-toggle::before {
  content: "\1F319";
  font-size: 1.2rem;
}
body.dark-mode .dark-mode-toggle::before {
  content: "\2600\FE0F";
}
[data-theme-toggle] {
  font-size: 0 !important;
  text-indent: -9999px;
  overflow: hidden;
  position: relative;
}
[data-theme-toggle]::before {
  content: "\1F319";
  font-size: 1.2rem;
  text-indent: 0;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.dark-mode [data-theme-toggle]::before {
  content: "\2600\FE0F";
}

.dark-mode-toggle:hover {
  border-color: var(--primary);
  background: var(--light-green);
}

body.dark-mode .dark-mode-toggle:hover {
  background: rgba(16, 185, 129, 0.15);
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
}

/* ========== HERO SECTION ========== */
.hero {
  padding: 160px 0 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--light-green) 0%, var(--bg) 60%);
}

body.dark-mode .hero {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--dark-bg) 60%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 24px;
  line-height: 1.2;
}

.hero h1 .highlight {
  color: var(--primary);
  position: relative;
}

.hero .subtitle {
  font-size: 1.15rem;
  color: var(--text);
  opacity: 0.8;
  max-width: 650px;
  margin: 0 auto 40px;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Animated Orbs */
.hero-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: orbFloat 8s ease-in-out infinite;
}

.hero-orb:nth-child(1) {
  width: 400px;
  height: 400px;
  background: var(--primary);
  top: -100px;
  right: -100px;
  animation-delay: 0s;
}

.hero-orb:nth-child(2) {
  width: 300px;
  height: 300px;
  background: var(--accent);
  bottom: -50px;
  left: -50px;
  animation-delay: 2s;
}

.hero-orb:nth-child(3) {
  width: 160px;
  height: 160px;
  background: var(--dark-green);
  top: 55%;
  left: 58%;
  animation-delay: 4s;
}

@keyframes orbFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -30px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(15px, 10px) scale(1.02);
  }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  font-family: var(--font);
  min-height: 44px;
  min-width: 44px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--dark-green);
  border-color: var(--dark-green);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-secondary {
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--input-border);
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(16, 185, 129, 0.08);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  padding: 8px;
  border-radius: 8px;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--primary);
  background: rgba(16, 185, 129, 0.1);
}

/* ========== LOADING SPINNER ========== */
.loading-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text);
  opacity: 0.6;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--input-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  z-index: 10;
}

body.dark-mode .loading-overlay {
  background: rgba(17, 24, 39, 0.8);
}

.loading-overlay.active {
  display: flex;
}

/* ========== FAQ ACCORDION ========== */
.faq-section {
  padding: 60px 0;
  background: var(--section-bg);
  transition: background var(--transition);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: all var(--transition);
  user-select: none;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question i {
  transition: transform var(--transition);
  font-size: 0.85rem;
  opacity: 0.5;
}

.faq-item.active .faq-question i,
.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 20px;
}

.faq-item.active .faq-answer,
.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 20px 16px;
}

.faq-answer p {
  opacity: 0.7;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ========== HOW-TO STEPS ========== */
.how-to-section {
  padding: 60px 0;
}

.steps-grid,
.how-to-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 24px auto 0;
}

.step-card {
  text-align: center;
  padding: 28px 20px;
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-weight: 700;
  font-size: 1.1rem;
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.step-card p {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ========== RELATED TOOLS ========== */
.related-tools-section {
  padding: 60px 0;
  background: var(--section-bg);
  transition: background var(--transition);
}

/* ========== TOOL PAGE CONTROLS BAR ========== */
.tool-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--input-border);
}

.tool-controls-left,
.tool-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ========== TOOL RESULTS ========== */
.tool-results {
  margin-top: 24px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius);
}

.tool-results h3 {
  color: var(--primary);
  margin-bottom: 12px;
  font-size: 1.1rem;
}

.tool-results h3 i {
  margin-right: 6px;
}

/* ========== TOOL STATS BAR ========== */
.tool-stats-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 16px;
  padding: 14px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
}

.stat-item {
  text-align: center;
  flex: 1;
}

.stat-item .stat-label {
  display: block;
  font-size: 0.75rem;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.stat-item .stat-value {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
}

/* ========== ERROR STATE ========== */
.error-state {
  text-align: center;
  padding: 60px 20px;
}

.error-state h2 {
  margin-bottom: 10px;
  color: #ef4444;
}

/* ========== DRAG OVER ========== */
.upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.1);
  transform: scale(1.02);
}

.btn-accent:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}

/* ========== STATS BAR ========== */
.stats-section {
  padding: 60px 0;
  background: var(--section-bg);
  transition: background var(--transition);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
}

.stat-card {
  text-align: center;
  padding: 24px 16px;
}

.stat-card .stat-icon {
  font-size: 2rem;
  margin-bottom: 12px;
  display: block;
}

.stat-card .stat-main {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1.2;
}

.stat-card .stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  display: block;
  margin-top: 4px;
}

.stat-card .stat-desc {
  font-size: 0.8rem;
  opacity: 0.65;
  margin-top: 6px;
  display: block;
  line-height: 1.4;
}

/* ========== SECTION TITLES ========== */
.section-title {
  text-align: center;
  margin-bottom: 50px;
}

.section-title h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.section-title h2 .highlight {
  color: var(--primary);
}

.section-title p {
  font-size: 1.05rem;
  opacity: 0.7;
  max-width: 600px;
  margin: 0 auto;
}

/* ========== CATEGORIES GRID ========== */
.categories-section {
  padding: 80px 0;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.category-card {
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  display: block;
}

.category-card .cat-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.category-card h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.category-card .cat-count {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

/* ========== FEATURED TOOLS ========== */
.featured-section {
  padding: 80px 0;
  background: var(--section-bg);
  transition: background var(--transition);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 0 !important;
  justify-content: flex-start;
}

.tool-card .tool-icon,
.tool-card .tool-card-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
}

.tool-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 0.9rem;
  opacity: 0.7;
  flex-grow: 1;
  margin-bottom: 16px;
}

.tool-card .btn {
  align-self: flex-start;
  margin-top: auto;
}

.categories-grid .category-card {
  min-height: 0 !important;
}

/* ========== WHY SECTION ========== */
.why-section {
  padding: 80px 0;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.why-card .why-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: block;
  color: var(--primary);
}

.why-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.why-card p {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--dark-bg);
  color: var(--text-light);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand h3 {
  font-size: 1.4rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.footer-brand h3 span {
  color: var(--primary);
}

.footer-brand p {
  font-size: 0.9rem;
  opacity: 0.7;
  line-height: 1.7;
}

.footer-col h4 {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 16px;
  font-weight: 600;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: rgba(249, 250, 251, 0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.footer-contact p {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 12px;
  color: rgba(249, 250, 251, 0.7);
}

.footer-contact a {
  color: rgba(249, 250, 251, 0.7);
  font-weight: 400;
  text-decoration: none;
}

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

.footer-contact ul {
  list-style: none;
}

.footer-contact ul li {
  margin-bottom: 10px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 0 !important;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}
.footer-bottom p {
  margin: 0 !important;
  line-height: 1.2 !important;
}
.footer-bottom p + p {
  margin-top: 0 !important;
}
.footer-bottom .container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ========== ALL TOOLS PAGE ========== */
.all-tools-hero {
  padding: 120px 0 40px;
  text-align: center;
  background: var(--section-bg);
  transition: background var(--transition);
}

.search-bar {
  max-width: 500px;
  margin: 30px auto 0;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  border-radius: 50px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.search-bar .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.5;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 24px 0 40px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  border: 1px solid var(--input-border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.all-tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 0 80px;
}

/* ========== CATEGORY PAGE ========== */
.category-hero {
  padding: 120px 0 40px;
  text-align: center;
  background: var(--section-bg);
  transition: background var(--transition);
}

.category-hero .cat-hero-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  display: block;
}

.category-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 60px 0 80px;
}

/* ========== SINGLE TOOL PAGE ========== */
.tool-hero {
  padding: 110px 0 30px;
  text-align: center;
  background: var(--section-bg);
  transition: background var(--transition);
}

.tool-hero h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.tool-hero p {
  font-size: 1.1rem;
  opacity: 0.7;
  max-width: 600px;
  margin: 0 auto;
}

.tool-interface {
  padding: 40px 0;
}

.tool-workspace {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.tool-workspace .glass-card {
  padding: 32px;
}

.tool-dark-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
}

/* Upload Area (used by image tools JS) */
.upload-area {
  border: 2px dashed var(--input-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--input-bg);
  margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.upload-area i {
  font-size: 2.5rem;
  color: var(--primary);
  opacity: 0.6;
  display: block;
  margin-bottom: 12px;
}

.upload-area p {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 4px;
}

.upload-area .upload-hint {
  font-size: 0.8rem;
  opacity: 0.5;
  display: block;
}

/* Tool Textarea */
.tool-textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
}

.tool-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Controls Row */
.controls-row {
  display: flex;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
  align-items: flex-end;
}

.control-group {
  flex: 1;
  min-width: 120px;
}

.control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.control-group input,
.control-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition);
}

.control-group input:focus,
.control-group select:focus {
  border-color: var(--primary);
}

/* Stats Box (word counter etc) */
.stat-box {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
}

.stat-box .stat-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1.2;
}

.stat-box span:last-child {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 4px;
  display: block;
}

/* File List (batch uploads) */
.file-list {
  margin: 12px 0;
}

.file-item {
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

/* Preview Area */
.preview-area {
  text-align: center;
  margin: 16px 0;
}

.preview-area img {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* File Upload Area */
.file-upload-area {
  border: 2px dashed var(--input-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--input-bg);
  margin-bottom: 20px;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.file-upload-area .upload-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
  opacity: 0.5;
}

.file-upload-area p {
  font-size: 0.95rem;
  opacity: 0.7;
  margin-bottom: 0;
}

.file-upload-area .browse-btn {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

/* Tool Input Area */
.tool-input-group {
  margin-bottom: 20px;
}

.tool-input-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.tool-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: all var(--transition);
  outline: none;
}

.tool-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

textarea.tool-input {
  min-height: 150px;
  resize: vertical;
}

select.tool-input {
  cursor: pointer;
}

/* Tool Controls */
.tool-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Result Area */
.tool-result {
  margin-top: 24px;
  display: none;
}

.tool-result.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-header h3 {
  font-size: 1.1rem;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-content {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  min-height: 100px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  transition: all var(--transition);
  overflow: auto;
  max-height: 400px;
}

.result-image {
  text-align: center;
}

.result-image img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* Stats Display */
.tool-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-item {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  transition: all var(--transition);
}

.stat-item .stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

.stat-item .stat-name {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 4px;
}

/* Loading Spinner */
.loading-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  border-radius: var(--radius);
  z-index: 10;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

body.dark-mode .loading-overlay {
  background: rgba(17, 24, 39, 0.8);
}

.loading-overlay.active {
  display: flex;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--input-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 0.95rem;
  opacity: 0.7;
}

/* ========== HOW TO USE ========== */
.how-to-section {
  padding: 60px 0;
  max-width: 900px;
  margin: 0 auto;
}

.how-to-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 30px;
}

.step-card {
  text-align: center;
}

.step-card .step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 auto 16px;
}

.step-card h4 {
  margin-bottom: 8px;
}

.step-card p {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* ========== FAQ ACCORDION ========== */
.faq-section {
  padding: 60px 0;
  max-width: 900px;
  margin: 0 auto;
}

.faq-list {
  margin-top: 30px;
}

.faq-item {
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: all var(--transition);
}

.faq-question {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  background: var(--card-bg);
  transition: all var(--transition);
}

.faq-question:hover {
  color: var(--primary);
}

.faq-question .faq-toggle {
  font-size: 1.2rem;
  transition: transform var(--transition);
  color: var(--primary);
}

.faq-item.active .faq-question .faq-toggle {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 20px;
  font-size: 0.95rem;
  opacity: 0.75;
  line-height: 1.7;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 20px 16px;
}

/* ========== RELATED TOOLS ========== */
.related-section {
  padding: 60px 0;
  max-width: 900px;
  margin: 0 auto;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 30px;
}

.related-card {
  text-align: center;
  padding: 20px 12px;
  font-size: 0.9rem;
  color: var(--text);
}

.related-card .related-icon {
  font-size: 1.8rem;
  margin-bottom: 10px;
  display: block;
}

.related-card h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.related-card:hover h4 {
  color: var(--primary);
}

/* ========== EMOTIONAL MESSAGE ========== */
.emotional-section {
  padding: 60px 0;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.emotional-card {
  padding: 40px;
  text-align: center;
}

.emotional-card .heart-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.emotional-card p {
  font-size: 1.05rem;
  line-height: 1.8;
  opacity: 0.8;
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--primary);
  max-width: 400px;
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
}

.toast.error {
  border-left-color: #ef4444;
}

.toast.success {
  border-left-color: var(--primary);
}

.toast-icon {
  font-size: 1.3rem;
}

.toast.removing {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }

  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* ========== STATIC PAGES ========== */
.page-hero {
  padding: 120px 0 40px;
  text-align: center;
  background: var(--section-bg);
  transition: background var(--transition);
}

.page-content {
  padding: 0;
}

.page-content h2 {
  font-size: 1.6rem;
  margin: 32px 0 12px;
}

.page-content h3 {
  font-size: 1.25rem;
  margin: 24px 0 10px;
}

.page-content p,
.page-content li {
  font-size: 1rem;
  line-height: 1.8;
  opacity: 0.8;
}

.page-content ul {
  padding-left: 24px;
  margin-bottom: 16px;
}

.page-content ul li {
  margin-bottom: 8px;
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin: 40px auto 0;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  transition: all var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

/* ========== RANGE SLIDER ========== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--input-border);
  border-radius: 3px;
  outline: none;
  transition: all var(--transition);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js-animations-ready .animate-fade-in {
  opacity: 0;
  transform: translateY(20px);
}

.js-animations-ready .animate-fade-in.visible,
.animate-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE: TABLET ========== */
@media (max-width: 1024px) {
  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .all-tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .how-to-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ========== RESPONSIVE: MOBILE ========== */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  /* Ensure symmetric padding on all containers */
  .container {
    padding: 0 16px;
  }

  .header-inner {
    height: 64px;
    padding: 0 16px;
  }

  .main-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    padding: 20px;
    border-bottom: 1px solid var(--input-border);
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav a {
    padding: 12px 16px;
    width: 100%;
    text-align: center;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .tool-card {
    min-height: auto;
  }

  .why-grid {
    grid-template-columns: 1fr;
  }

  .all-tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .how-to-steps {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .tool-workspace {
    padding: 0 4px;
  }

  .tool-workspace .glass-card {
    padding: 16px;
  }

  .tool-controls {
    flex-direction: column;
  }

  .tool-controls .btn {
    width: 100%;
  }

  .category-filters,
  .category-filter {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn,
  .category-filter .btn {
    flex-shrink: 0;
  }

  section {
    padding: 50px 0;
  }

  .toast {
    max-width: calc(100vw - 40px);
  }

  /* Tool results overflow protection */
  .tool-results,
  #tool-results,
  #comp-result,
  .result-item,
  .preview-area {
    max-width: 100%;
    overflow-x: auto;
    word-break: break-word;
  }

  .tool-results img,
  .preview-area img,
  canvas {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Controls row stacking on mobile */
  .controls-row {
    flex-direction: column;
    gap: 12px;
  }

  .controls-row .control-group {
    min-width: 100%;
  }

  /* Upload area mobile */
  .upload-area,
  .file-upload-area {
    padding: 24px 12px;
  }

  /* Category page grid inside inline scripts */
  #category-tools-grid,
  #all-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Stat cards mobile */
  .stat-card {
    padding: 16px 8px;
  }

  .stat-card .stat-main {
    font-size: 1.4rem;
  }

  /* Page hero mobile */
  .page-hero {
    padding: 100px 0 30px;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  /* Tool page mobile */
  .tool-page {
    padding-top: 60px;
  }

  #tool-title {
    font-size: 1.6rem;
  }

  .tool-stats {
    flex-direction: column;
    gap: 12px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  /* Favicon/results grid mobile */
  .favicon-grid {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .all-tools-grid {
    grid-template-columns: 1fr;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.8rem;
  }
}

/* ========== BATCH PROCESSING ========== */
.batch-list {
  margin-top: 16px;
}

.batch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  font-size: 0.9rem;
  transition: all var(--transition);
}

.batch-item .file-name {
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item .file-size {
  font-size: 0.8rem;
  opacity: 0.5;
  margin: 0 12px;
}

.batch-item .remove-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
}

/* ========== PROGRESS BAR ========== */
.progress-bar-container {
  width: 100%;
  height: 8px;
  background: var(--input-border);
  border-radius: 4px;
  margin-top: 12px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ========== TABS ========== */
.tool-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--input-border);
}

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  opacity: 0.6;
  transition: all var(--transition);
}

.tab-btn.active,
.tab-btn:hover {
  opacity: 1;
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ========== CODE DISPLAY ========== */
.code-display {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* ========== UTILITY CLASSES ========== */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary);
}

.text-accent {
  color: var(--accent);
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-1 {
  margin-bottom: 8px;
}

.mb-2 {
  margin-bottom: 16px;
}

.mb-3 {
  margin-bottom: 24px;
}

.gap-sm {
  gap: 8px;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

/* ========== TOOL PAGE DYNAMIC STYLES ========== */
.page-hero {
  padding: 120px 0 50px;
  text-align: center;
  background: var(--section-bg);
  transition: background var(--transition);
}

.page-hero h1 {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.page-hero p {
  font-size: 1.1rem;
  opacity: 0.7;
  max-width: 650px;
  margin: 0 auto;
}

.content-section {
  padding: 60px 0 80px;
}

.tool-page {
  padding-top: 70px;
}

.tool-header {
  padding: 40px 0;
  text-align: center;
  background: var(--section-bg);
  transition: background var(--transition);
}

.tool-header-content {
  max-width: 700px;
  margin: 0 auto;
}

.tool-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

#tool-title {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.tool-description {
  font-size: 1.05rem;
  opacity: 0.7;
}

.tool-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 14px;
  background: rgba(0, 200, 150, 0.1);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
}

.tool-interface-section {
  padding: 40px 0;
}

.tool-card {
  max-width: 900px;
  margin: 0 auto;
}

.tool-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--input-border);
}

.upload-area {
  border: 2px dashed var(--input-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--input-bg);
  margin-bottom: 20px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: rgba(16, 185, 129, 0.05);
}

.upload-area i {
  font-size: 2.5rem;
  margin-bottom: 10px;
  display: block;
  opacity: 0.5;
}

.upload-area p {
  margin: 8px 0 0;
  opacity: 0.7;
}

.upload-hint {
  font-size: 0.8rem;
  opacity: 0.5;
  display: block;
  margin-top: 6px;
}

.control-group {
  margin-bottom: 16px;
}

.control-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.control-group input[type="text"],
.control-group input[type="number"],
.control-group input[type="url"],
.control-group input[type="email"],
.control-group input[type="date"],
.control-group input[type="datetime-local"],
.control-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition);
}

.control-group input:focus,
.control-group select:focus,
.tool-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.control-group input[type="color"] {
  width: 50px;
  height: 40px;
  border: none;
  cursor: pointer;
  border-radius: 6px;
}

.tool-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: all var(--transition);
}

.controls-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}

.controls-row .control-group {
  flex: 1;
  min-width: 120px;
  margin-bottom: 0;
}

.preview-area {
  margin: 15px 0;
  text-align: center;
}

.preview-area img {
  max-width: 100%;
  max-height: 350px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.tool-results {
  margin-top: 24px;
  padding: 20px;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: var(--radius);
  animation: fadeInUp 0.4s ease;
}

.tool-results h3 {
  color: var(--primary);
  margin-bottom: 12px;
}

.tool-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  padding: 16px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
}

.tool-stats .stat {
  text-align: center;
  flex: 1;
}

.tool-stats .stat strong {
  display: block;
  color: var(--primary);
  font-size: 1.1rem;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
}

.results-table th,
.results-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--input-border);
  font-size: 0.9rem;
}

.results-table th {
  font-weight: 600;
  background: rgba(0, 0, 0, 0.1);
}

.file-list {
  margin: 10px 0;
}

.file-item {
  padding: 10px 14px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.stat-box {
  text-align: center;
  padding: 16px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
}

.stat-box .stat-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.tool-category-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
  margin-top: 8px;
}

.search-input {
  width: 100%;
  padding: 14px 20px;
  border-radius: 50px;
  border: 2px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 20px 0 30px;
}

.how-to-section {
  padding: 60px 0;
}

.how-to-section h2 {
  text-align: center;
  margin-bottom: 30px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.step-card {
  text-align: center;
  padding: 20px;
}

.step-card .step-number {
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin: 0 auto 14px;
}

.step-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.step-card p {
  font-size: 0.85rem;
  opacity: 0.7;
}

.emotional-section {
  padding: 60px 0;
}

.faq-section {
  padding: 60px 0;
}

.faq-section h2 {
  text-align: center;
  margin-bottom: 25px;
}

.faq-item {
  margin-bottom: 10px;
  overflow: hidden;
}

.faq-item .faq-question {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item .faq-question:hover {
  color: var(--primary);
}

.faq-item .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding: 0 18px;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 18px 14px;
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
}

.related-section {
  padding: 60px 0;
}

.related-section h2 {
  text-align: center;
  margin-bottom: 25px;
}

.tool-card-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.loading-placeholder {
  text-align: center;
  padding: 60px 20px;
}

.result-item {
  padding: 15px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  margin: 10px 0;
}

.symbol-btn {
  font-size: 20px !important;
  padding: 10px !important;
  min-width: 50px;
}

/* ========== RESPONSIVE: TOOL PAGES ========== */
@media (max-width: 768px) {
  .page-hero {
    padding: 100px 0 30px;
  }

  .page-hero h1 {
    font-size: 1.8rem;
  }

  .tool-page {
    padding-top: 60px;
  }

  #tool-title {
    font-size: 1.6rem;
  }

  .controls-row {
    flex-direction: column;
  }

  .controls-row .control-group {
    min-width: 100%;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tool-stats {
    flex-direction: column;
    gap: 12px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }
}


/* Emoji Font Fallback */
.stat-icon,.cat-icon,.tool-card-icon,.why-icon,.footer-brand h3,.footer-bottom p,.search-icon{font-family:'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif !important;}

/* Related tools compact grid override */
.related-tools-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
}
.related-tools-grid .tool-card {
  min-height: 0 !important;
}
@media (max-width: 1024px) {
  .related-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 480px) {
  .related-tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
