/* ==========================================================================
   OMNITOOLS - MODERN DESIGN SYSTEM & CORE STYLESHEET
   ========================================================================== */

:root {
  /* Color Palette - Light Mode */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.18);
  
  --accent: #8b5cf6;
  --accent-light: #f5f3ff;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #06b6d4;
  --info-light: #ecfeff;

  /* Neutrals - Light */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --border-focus: #6366f1;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-sub: #94a3b8;

  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(226, 232, 240, 0.8);
  --glass-blur: blur(12px);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  --header-height: 72px;
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Theme */
[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #131d33;
  --bg-card-hover: #1b2845;
  --bg-input: #090d16;
  --border: #1e293b;
  --border-focus: #818cf8;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #64748b;

  --glass-bg: rgba(15, 23, 42, 0.85);
  --glass-border: rgba(30, 41, 59, 0.8);

  --primary-light: rgba(79, 70, 229, 0.15);
  --accent-light: rgba(139, 92, 246, 0.15);
  --success-light: rgba(16, 185, 129, 0.15);
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger-light: rgba(239, 68, 68, 0.15);
  --info-light: rgba(6, 182, 212, 0.15);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

[data-theme="dark"] html {
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* --- Global Custom Modern Scrollbars --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  transition: background 0.2s ease;
}

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

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  position: relative;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

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

img, svg {
  vertical-align: middle;
  max-width: 100%;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header & Navigation (Sticky Header) --- */
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--text-main);
  text-decoration: none;
}

.site-logo-img {
  max-width: 220px;
  height: auto;
  object-fit: contain;
  display: inline-block;
  transition: opacity 0.2s ease;
}

[data-theme="light"] .site-logo-dark {
  display: none !important;
}

[data-theme="light"] .site-logo-light {
  display: inline-block !important;
}

[data-theme="dark"] .site-logo-light {
  display: none !important;
}

[data-theme="dark"] .site-logo-dark {
  display: inline-block !important;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.brand-icon i {
  width: 22px;
  height: 22px;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 4px;
  margin-left: 4px;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-trigger-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.search-trigger-btn:hover {
  border-color: var(--primary);
  color: var(--text-main);
  box-shadow: var(--shadow-md);
}

.search-shortcut {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  font-weight: 700;
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--warning);
  border-color: var(--warning);
  transform: rotate(15deg);
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  background: radial-gradient(circle at 50% 0%, var(--primary-glow) 0%, transparent 65%);
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  animation: pulseGlow 3s infinite;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--info) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 2.25rem;
}

.hero-search-wrapper {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: 1.1rem 1.25rem 1.1rem 3.25rem;
  font-size: 1.05rem;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.hero-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow), var(--shadow-xl);
}

.hero-search-icon {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Category Filter Pills */
.category-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cat-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.cat-pill:hover, .cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title i {
  color: var(--primary);
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* --- Tool Cards Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  text-decoration: none;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}

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

.tool-card:hover::before {
  opacity: 1;
}

.tool-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tool-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

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

.badge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.badge-popular { background: var(--primary-light); color: var(--primary); }
.badge-hot { background: var(--danger-light); color: var(--danger); }
.badge-fast { background: var(--success-light); color: var(--success); }
.badge-security { background: var(--accent-light); color: var(--accent); }
.badge-seopro { background: var(--info-light); color: var(--info); }
.badge-finance { background: var(--warning-light); color: var(--warning); }
.badge-default { background: var(--bg-body); color: var(--text-muted); }

.tool-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.tool-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.tool-card-footer i {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-footer i {
  transform: translateX(4px);
}

/* Category-specific theme accent icons */
.cat-image .tool-icon-wrapper { background: rgba(59, 130, 246, 0.12); color: #3b82f6; }
.cat-pdf .tool-icon-wrapper { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.cat-developer .tool-icon-wrapper { background: rgba(139, 92, 246, 0.12); color: #8b5cf6; }
.cat-text .tool-icon-wrapper { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.cat-calculator .tool-icon-wrapper { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.cat-seo .tool-icon-wrapper { background: rgba(6, 182, 212, 0.12); color: #06b6d4; }

/* --- AdSense Container --- */
.ad-container {
  margin: 2rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.ad-placeholder {
  width: 100%;
  max-width: 970px;
  background: var(--bg-surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.ad-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-sub);
}

.ad-badge i {
  width: 14px;
  height: 14px;
}

.ad-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.ad-hint {
  font-size: 0.8rem;
  color: var(--text-sub);
}

/* --- Features Showcase Section --- */
.features-section {
  padding: 4rem 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 3.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-item {
  text-align: center;
  padding: 1.5rem;
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--primary-light);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.feature-item h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature-item p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Tool Page Specific Layout --- */
.tool-header {
  padding: 2.5rem 0 1.5rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
}

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

.breadcrumbs span {
  color: var(--text-sub);
}

.tool-headline {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.tool-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 800px;
}

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  margin-bottom: 4rem;
  min-width: 0;
  max-width: 100%;
}

.tool-main-col {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1260px) {
  .tool-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.tool-workspace {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Studio tools with their own self-contained widget container */
.tool-workspace:has(.resizer-studio-container),
.tool-workspace:has(#compressorControls),
.tool-workspace:has(.compressor-studio-grid),
.tool-workspace:has(#cropperControls),
.tool-workspace:has(.cropper-studio-container),
.tool-workspace:has(#mergePdfControls),
.tool-workspace:has(.pdf-studio-container) {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

@media (max-width: 768px) {
  .tool-workspace {
    padding: 1rem 0.85rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
  }

  .tool-workspace:has(.resizer-studio-container),
  .tool-workspace:has(#compressorControls),
  .tool-workspace:has(.compressor-studio-grid),
  .tool-workspace:has(#cropperControls),
  .tool-workspace:has(.cropper-studio-container),
  .tool-workspace:has(#mergePdfControls),
  .tool-workspace:has(.pdf-studio-container) {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }
}

.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.related-tool-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.9rem;
}

.related-tool-item:last-child {
  border-bottom: none;
}

.related-tool-item:hover {
  color: var(--primary);
}

/* Content & FAQ Accordion Section */
.tool-content-section {
  margin-top: 3rem;
}

.content-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
}

.content-box h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
  counter-reset: step-counter;
}

.steps-list li {
  position: relative;
  padding-left: 3rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.steps-list li::before {
  counter-increment: step-counter;
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.features-bullets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  list-style: none;
}

.features-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.features-bullets li i {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 3px;
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-surface);
}

.faq-question {
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.faq-question i {
  transition: transform 0.25s ease;
  color: var(--text-muted);
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* --- Search Command Palette Modal --- */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.search-modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.search-modal {
  width: 100%;
  max-width: 600px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.search-modal-backdrop.active .search-modal {
  transform: scale(1);
}

.modal-search-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-search-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: var(--text-main);
  outline: none;
}

.modal-search-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.modal-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  transition: var(--transition);
}

.modal-result-item:hover, .modal-result-item.selected {
  background: var(--primary-light);
  color: var(--primary);
}

.modal-result-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-result-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-result-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-full);
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  transform: translateY(20px);
  opacity: 0;
  transition: var(--transition);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--info); }

/* --- Footer --- */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 320px;
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.footer-social-links {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
}

.footer-social-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  transition: transform 0.25s ease;
}

.footer-social-btn:hover {
  transform: translateY(-3px) scale(1.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.footer-social-btn:hover svg {
  transform: scale(1.1);
}

.footer-social-btn.social-twitter:hover {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.footer-social-btn.social-github:hover {
  background: #24292e;
  color: #ffffff;
  border-color: #24292e;
}

.footer-social-btn.social-discord:hover {
  background: #5865f2;
  color: #ffffff;
  border-color: #5865f2;
}

.footer-social-btn.social-linkedin:hover {
  background: #0a66c2;
  color: #ffffff;
  border-color: #0a66c2;
}

.footer-social-btn.social-youtube:hover {
  background: #ff0000;
  color: #ffffff;
  border-color: #ff0000;
}

.footer-social-btn.social-facebook:hover {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* --- Mobile Drawer Navigation Menu --- */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.mobile-drawer-backdrop.active .mobile-drawer {
  transform: translateX(0);
}

.mobile-drawer-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-body);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.mobile-drawer-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.mobile-drawer-search {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.mobile-drawer-nav {
  padding: 1rem 1rem 1.5rem;
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem 0.25rem;
}

.drawer-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: var(--transition);
}

.drawer-nav-link:hover {
  background: var(--bg-card-hover);
  color: var(--primary);
}

.drawer-nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.drawer-nav-link i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.mobile-drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card-hover);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 992px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  .container {
    padding: 0 1rem;
  }
  .hero-title {
    font-size: 2.15rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }
  .search-shortcut {
    display: none;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .tool-headline {
    font-size: 1.85rem;
  }
}

@media (max-width: 540px) {
  .brand-logo span:not(.brand-badge) {
    font-size: 1.2rem;
  }
  .brand-icon {
    width: 34px;
    height: 34px;
  }
  .search-trigger-btn .search-text {
    display: none;
  }
  .search-trigger-btn {
    padding: 0.5rem 0.65rem;
    border-radius: 50%;
  }
  .theme-toggle-btn {
    width: 36px;
    height: 36px;
  }
  .mobile-menu-btn {
    width: 36px;
    height: 36px;
  }
  .nav-actions {
    gap: 0.5rem;
  }
}

/* ==========================================================================
   BLOG & ARTICLE CUSTOM CONTENT WIDGETS
   ========================================================================== */

/* 1. Callout Boxes */
.blog-callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  line-height: 1.7;
}
.blog-callout-info {
  border-left: 4px solid var(--primary);
  background: var(--primary-light);
}
.blog-callout-success {
  border-left: 4px solid var(--success);
  background: var(--success-light);
}
.blog-callout-warning {
  border-left: 4px solid var(--warning);
  background: var(--warning-light);
}
.blog-callout-danger {
  border-left: 4px solid var(--danger);
  background: var(--danger-light);
}

/* 2. Step-by-Step Tutorial Widget */
.blog-steps-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 2rem 0;
}
.blog-step-item {
  display: flex;
  gap: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.blog-step-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px var(--primary-glow);
}
.blog-step-content {
  flex: 1;
}
.blog-step-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

/* 3. Feature Cards Grid */
.blog-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.blog-feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.blog-feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}
.blog-feature-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

/* 4. Tool Action CTA Box */
.blog-tool-cta {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08), rgba(139, 92, 246, 0.12));
  border: 2px solid var(--primary-glow);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.blog-tool-cta-info {
  flex: 1;
  min-width: 250px;
}
.blog-tool-cta-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  color: var(--text-main);
}

/* 5. Code Snippet Box */
.blog-code-box {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: var(--radius-md);
  margin: 1.75rem 0;
  overflow: hidden;
}
.blog-code-header {
  background: #1e293b;
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #94a3b8;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
}
.blog-code-box pre {
  padding: 1.25rem;
  margin: 0;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  overflow-x: auto;
}

/* 6. Pros vs Cons Grid */
.blog-comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 0;
}
.blog-pros-card {
  background: var(--bg-surface);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-top: 4px solid var(--success);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}
.blog-cons-card {
  background: var(--bg-surface);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-top: 4px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

/* 7. FAQ Collapsible Accordions */
.blog-faq-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 2rem 0;
}
.blog-faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.blog-faq-question {
  padding: 1.15rem 1.25rem;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.blog-faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* 8. YouTube Responsive Video Embed */
.blog-video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.blog-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 9. Image with Caption */
.blog-img-caption {
  margin: 2rem 0;
  text-align: center;
}
.blog-img-caption img {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}
.blog-img-caption figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  font-style: italic;
}

@media (max-width: 640px) {
  .blog-comparison-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   NEW FRONTEND FEATURES: FAVORITES, PALETTE, FULLSCREEN, RATINGS & SHARE
   ========================================================================== */

/* 1. Header Favorites Button & Badge */
.header-fav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.header-fav-btn:hover {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}
.fav-badge-counter {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-surface);
}

/* 2. Tool Card Favorite Button */
.tool-card-wrapper {
  position: relative;
}
.card-fav-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}
.card-fav-btn:hover {
  color: var(--danger);
  transform: scale(1.15);
  border-color: rgba(239, 68, 68, 0.4);
}
.card-fav-btn.active {
  color: var(--danger);
  fill: var(--danger);
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
}
.card-fav-btn.active svg {
  fill: var(--danger);
}
.tool-fav-btn.active {
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
  background: rgba(239, 68, 68, 0.1) !important;
}
.tool-fav-btn.active svg {
  fill: var(--danger);
}

/* 3. Command Palette Categories & Footer */
.modal-search-categories {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.modal-search-categories::-webkit-scrollbar {
  display: none;
}
.modal-cat-chip {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-body);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.modal-cat-chip:hover {
  color: var(--text-main);
  border-color: var(--primary);
}
.modal-cat-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.modal-search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-search-close:hover {
  color: var(--text-main);
  background: var(--bg-body);
}
.modal-search-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-body);
}
.modal-kbd-hint {
  display: flex;
  gap: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.modal-kbd-hint kbd {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* 4. Fullscreen Focus Mode */
body.tool-fullscreen-active {
  overflow: hidden !important;
}
.tool-workspace.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  overflow-y: auto !important;
  background: var(--bg-surface) !important;
  padding: 2.5rem 2rem 2rem 2rem !important;
  box-shadow: none !important;
}
.fullscreen-exit-btn {
  position: fixed;
  top: 16px;
  right: 24px;
  z-index: 100000;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}
.fullscreen-exit-btn:hover {
  background: var(--danger);
  transform: scale(1.05);
}

/* 5. 5-Star Interactive Rating & Feedback */
.tool-rating-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.04), rgba(245, 158, 11, 0.04));
  border: 1px solid var(--border);
}
.interactive-star-rating {
  display: inline-flex;
  gap: 0.25rem;
  font-size: 1.6rem;
  color: var(--border);
  cursor: pointer;
  user-select: none;
}
.interactive-star-rating .rate-star {
  transition: transform 0.15s ease, color 0.15s ease;
}
.interactive-star-rating .rate-star:hover {
  transform: scale(1.25);
}
.interactive-star-rating .rate-star.hover,
.interactive-star-rating .rate-star.active {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}
.star-rating-select {
  display: flex;
  gap: 0.4rem;
  font-size: 1.75rem;
  color: var(--border);
  cursor: pointer;
}
.star-rating-select .star-item.active,
.star-rating-select .star-item:hover {
  color: #f59e0b;
}

/* 6. Share Social Cards */
.share-social-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.share-social-card:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}
.share-wa { background: #25d366; }
.share-tw { background: #000000; }
.share-li { background: #0a66c2; }
.share-tg { background: #229ed9; }

