/*
 * HackyTools.com - Main CSS Framework
 * Scalable design system for 1000+ tools with accessibility and performance focus
 * Supports both light and dark themes
 */

/* CSS Custom Properties (CSS Variables) for theming */
:root {
  /* Brand Colors - Distinctive Purple-Blue System */
  --ht-primary: #6366f1;
  --ht-primary-dark: #4f46e5;
  --ht-primary-light: #818cf8;
  --ht-accent: #8b5cf6;
  --ht-accent-light: #a78bfa;
  --ht-gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --ht-gradient-secondary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  
  --ht-secondary: #64748b;
  --ht-secondary-dark: #475569;
  --ht-secondary-light: #94a3b8;
  
  /* Professional Status Colors */
  --ht-success: #059669;
  --ht-success-light: #10b981;
  --ht-warning: #d97706;
  --ht-warning-light: #f59e0b;
  --ht-danger: #dc2626;
  --ht-danger-light: #ef4444;
  --ht-info: #0891b2;
  --ht-info-light: #06b6d4;
  
  
  /* Refined Neutral Palette */
  --ht-white: #ffffff;
  --ht-black: #0a0a0a;
  --ht-gray-50: #f8fafc;
  --ht-gray-100: #f1f5f9;
  --ht-gray-200: #e2e8f0;
  --ht-gray-300: #cbd5e1;
  --ht-gray-400: #94a3b8;
  --ht-gray-500: #64748b;
  --ht-gray-600: #475569;
  --ht-gray-700: #334155;
  --ht-gray-800: #1e293b;
  --ht-gray-900: #0f172a;
  
  /* Light Theme Semantic Colors */
  --ht-background: var(--ht-white);
  --ht-surface: var(--ht-gray-50);
  --ht-surface-elevated: var(--ht-white);
  --ht-border: var(--ht-gray-200);
  --ht-border-light: var(--ht-gray-100);
  --ht-text: var(--ht-gray-900);
  --ht-text-secondary: var(--ht-gray-600);
  --ht-text-muted: var(--ht-gray-500);
  
  /* Component Colors */
  --ht-input-bg: var(--ht-white);
  --ht-input-border: var(--ht-gray-300);
  --ht-input-border-focus: var(--ht-primary);
  --ht-button-primary-bg: var(--ht-primary);
  --ht-button-primary-text: var(--ht-white);
  --ht-button-secondary-bg: var(--ht-gray-100);
  --ht-button-secondary-text: var(--ht-gray-700);
  
  /* Professional Shadow System */
  --ht-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --ht-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --ht-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --ht-shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --ht-shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --ht-shadow-brand: 0 4px 14px 0 rgba(99, 102, 241, 0.2);
  --ht-shadow-accent: 0 4px 14px 0 rgba(139, 92, 246, 0.2);
  
  /* Professional Typography Stack */
  --ht-font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ht-font-family-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ht-font-family-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
  
  /* Typography Scale & Weights */
  --ht-font-weight-light: 300;
  --ht-font-weight-normal: 400;
  --ht-font-weight-medium: 500;
  --ht-font-weight-semibold: 600;
  --ht-font-weight-bold: 700;
  --ht-font-weight-black: 900;
  
  /* Spacing Scale */
  --ht-space-1: 0.25rem;
  --ht-space-2: 0.5rem;
  --ht-space-3: 0.75rem;
  --ht-space-4: 1rem;
  --ht-space-5: 1.25rem;
  --ht-space-6: 1.5rem;
  --ht-space-8: 2rem;
  --ht-space-10: 2.5rem;
  --ht-space-12: 3rem;
  --ht-space-16: 4rem;
  --ht-space-20: 5rem;
  --ht-space-24: 6rem;
  
  /* Border Radius */
  --ht-radius-sm: 0.25rem;
  --ht-radius: 0.375rem;
  --ht-radius-md: 0.5rem;
  --ht-radius-lg: 0.75rem;
  --ht-radius-xl: 1rem;
  --ht-radius-full: 9999px;
  
  /* Professional Animation System */
  --ht-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --ht-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --ht-transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ht-transition-bounce: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ht-ease-out-quart: cubic-bezier(0.165, 0.84, 0.44, 1);
  --ht-ease-in-out-quart: cubic-bezier(0.77, 0, 0.175, 1);
  
  /* Z-Index Scale */
  --ht-z-dropdown: 1000;
  --ht-z-sticky: 1020;
  --ht-z-fixed: 1030;
  --ht-z-modal: 1040;
  --ht-z-popover: 1050;
  --ht-z-tooltip: 1060;
}

/* Dark Theme - Professional Dark Mode */
.theme-dark {
  --ht-background: var(--ht-gray-900);
  --ht-surface: var(--ht-gray-800);
  --ht-surface-elevated: var(--ht-gray-700);
  --ht-border: rgba(148, 163, 184, 0.1);
  --ht-border-light: rgba(148, 163, 184, 0.05);
  --ht-text: #f1f5f9;
  --ht-text-secondary: #cbd5e1;
  --ht-text-muted: #94a3b8;
  
  --ht-input-bg: rgba(15, 23, 42, 0.5);
  --ht-input-border: rgba(148, 163, 184, 0.2);
  --ht-input-border-focus: var(--ht-primary-light);
  --ht-button-secondary-bg: rgba(51, 65, 85, 0.8);
  --ht-button-secondary-text: var(--ht-gray-200);
  
  /* Enhanced shadows for dark theme */
  --ht-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --ht-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5), 0 1px 2px -1px rgba(0, 0, 0, 0.3);
  --ht-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --ht-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --ht-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --ht-shadow-brand: 0 4px 14px 0 rgba(129, 140, 248, 0.3);
  --ht-shadow-accent: 0 4px 14px 0 rgba(167, 139, 250, 0.3);
  
  /* Dark gradient overrides */
  --ht-gradient-secondary: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
}

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

/* Ensure proper scrolling behavior */
html, body {
  overflow-x: hidden;
  overflow-y: auto;
}

html {
  font-size: 16px;
  line-height: 1.5;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--ht-font-family);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ht-text);
  background-color: var(--ht-background);
  transition: background-color 0.2s ease, color 0.2s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  width: 100%;
}

/* Professional Typography Scale */
.ht-text-xs { 
  font-size: 0.75rem; 
  line-height: 1.2; 
  font-weight: var(--ht-font-weight-normal);
  letter-spacing: 0.025em;
}
.ht-text-sm { 
  font-size: 0.875rem; 
  line-height: 1.35; 
  font-weight: var(--ht-font-weight-normal);
}
.ht-text-base { 
  font-size: 1rem; 
  line-height: 1.5; 
  font-weight: var(--ht-font-weight-normal);
}
.ht-text-lg { 
  font-size: 1.125rem; 
  line-height: 1.45; 
  font-weight: var(--ht-font-weight-medium);
}
.ht-text-xl { 
  font-size: 1.25rem; 
  line-height: 1.4; 
  font-weight: var(--ht-font-weight-medium);
}
.ht-text-2xl { 
  font-size: 1.5rem; 
  line-height: 1.35; 
  font-weight: var(--ht-font-weight-semibold);
}
.ht-text-3xl { 
  font-size: 1.875rem; 
  line-height: 1.3; 
  font-weight: var(--ht-font-weight-bold);
  letter-spacing: -0.02em;
}
.ht-text-4xl { 
  font-size: 2.25rem; 
  line-height: 1.2; 
  font-weight: var(--ht-font-weight-bold);
  letter-spacing: -0.025em;
}
.ht-text-5xl { 
  font-size: 3rem; 
  line-height: 1.1; 
  font-weight: var(--ht-font-weight-black);
  letter-spacing: -0.03em;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: var(--ht-space-4);
  padding-right: var(--ht-space-4);
  position: relative;
}

@media (min-width: 640px) {
  .container { padding-left: var(--ht-space-6); padding-right: var(--ht-space-6); }
}

@media (min-width: 1024px) {
  .container { padding-left: var(--ht-space-8); padding-right: var(--ht-space-8); }
}

/* Skip Navigation (Accessibility) */
.ht-skip-nav {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--ht-primary);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: var(--ht-radius);
  z-index: var(--ht-z-tooltip);
  font-size: 0.875rem;
  font-weight: 600;
  transition: top 0.2s ease;
}

.ht-skip-nav:focus {
  top: 6px;
}

/* Premium Header Styles */
.ht-header {
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--ht-border);
  position: sticky;
  top: 0;
  z-index: var(--ht-z-sticky);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--ht-shadow-sm);
}

.theme-dark .ht-header {
  background: rgba(15, 23, 42, 0.85);
}

.ht-header__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ht-space-4) 0;
  gap: var(--ht-space-4);
}

/* Professional Logo Design */
.ht-logo {
  flex-shrink: 0;
}

.ht-logo__link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: var(--ht-transition);
  padding: var(--ht-space-2);
  margin: calc(-1 * var(--ht-space-2));
  border-radius: var(--ht-radius);
}

.ht-logo__link:hover {
  background: var(--ht-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transform: translateY(-1px);
}

.ht-logo__text {
  font-size: 1.5rem;
  font-weight: var(--ht-font-weight-black);
  background: var(--ht-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.ht-logo__tagline {
  font-size: 0.7rem;
  color: var(--ht-text-muted);
  display: block;
  margin-top: -1px;
  font-weight: var(--ht-font-weight-medium);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Search Component */
.ht-search {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.ht-search__container {
  position: relative;
  display: flex;
  align-items: center;
}

.ht-search__input {
  width: 100%;
  padding: var(--ht-space-3) var(--ht-space-4);
  padding-right: var(--ht-space-10);
  border: 1px solid var(--ht-input-border);
  border-radius: var(--ht-radius-lg);
  background: var(--ht-input-bg);
  color: var(--ht-text);
  font-size: 0.875rem;
  transition: var(--ht-transition);
  outline: none;
}

.ht-search__input:focus {
  border-color: var(--ht-input-border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ht-search__btn {
  position: absolute;
  right: var(--ht-space-2);
  background: none;
  border: none;
  color: var(--ht-text-muted);
  cursor: pointer;
  padding: var(--ht-space-2);
  border-radius: var(--ht-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ht-transition);
}

.ht-search__btn:hover {
  color: var(--ht-text);
  background: var(--ht-gray-100);
}

.theme-dark .ht-search__btn:hover {
  background: var(--ht-gray-700);
}

/* Search Dropdown */
.ht-search__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--ht-surface-elevated);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-lg);
  box-shadow: var(--ht-shadow-lg);
  margin-top: var(--ht-space-2);
  z-index: var(--ht-z-dropdown);
  display: none;
  overflow: hidden;
}

.ht-search__dropdown.show {
  display: block;
}

.ht-search__results {
  max-height: 400px;
  overflow-y: auto;
  padding: var(--ht-space-2);
}

/* Search result styles */
.ht-search-result {
  display: flex;
  align-items: center;
  padding: var(--ht-space-3);
  cursor: pointer;
  border-bottom: 1px solid var(--ht-border);
  transition: var(--ht-transition);
}

.ht-search-result:hover {
  background: var(--ht-surface);
}

.ht-search-result__main {
  flex: 1;
}

.ht-search-result__name {
  font-weight: 600;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-1);
}

.ht-search-result__description {
  font-size: 0.75rem;
  color: var(--ht-text-secondary);
}

.ht-search-result__category {
  font-size: 0.75rem;
  color: var(--ht-primary);
  background: rgba(37, 99, 235, 0.1);
  padding: var(--ht-space-1) var(--ht-space-2);
  border-radius: var(--ht-radius-sm);
}

.ht-search-no-results {
  padding: var(--ht-space-4);
  text-align: center;
}

.ht-search-no-results__text {
  color: var(--ht-text);
  margin-bottom: var(--ht-space-2);
}

.ht-search-no-results__hint {
  font-size: 0.75rem;
  color: var(--ht-text-muted);
}

.ht-search__footer {
  padding: var(--ht-space-3) var(--ht-space-4);
  border-top: 1px solid var(--ht-border);
  background: var(--ht-surface);
}

.ht-search__hint {
  font-size: 0.75rem;
  color: var(--ht-text-muted);
  display: flex;
  align-items: center;
  gap: var(--ht-space-2);
}

/* Header Actions */
.ht-header__actions {
  display: flex;
  align-items: center;
  gap: var(--ht-space-2);
  flex-shrink: 0;
}

/* Professional Button System */
.ht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ht-space-2);
  padding: var(--ht-space-3) var(--ht-space-4);
  border: 1px solid transparent;
  border-radius: var(--ht-radius-md);
  font-size: 0.875rem;
  font-weight: var(--ht-font-weight-medium);
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: var(--ht-transition);
  outline: none;
  position: relative;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-height: 40px;
}

.ht-btn:focus-visible {
  outline: 2px solid var(--ht-primary);
  outline-offset: 2px;
}

/* Enhanced Button Variants */
.ht-btn--primary {
  background: var(--ht-gradient-primary);
  color: var(--ht-white);
  border-color: transparent;
  box-shadow: var(--ht-shadow-brand);
  font-weight: var(--ht-font-weight-semibold);
}

.ht-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--ht-shadow-lg), var(--ht-shadow-brand);
  filter: brightness(1.05);
}

.ht-btn--primary:active {
  transform: translateY(0);
  box-shadow: var(--ht-shadow), var(--ht-shadow-brand);
}

.ht-btn--secondary {
  background: var(--ht-gradient-secondary);
  color: var(--ht-text);
  border-color: var(--ht-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ht-btn--secondary:hover {
  background: var(--ht-surface-elevated);
  border-color: var(--ht-primary);
  transform: translateY(-1px);
  box-shadow: var(--ht-shadow-md);
}

.ht-btn--secondary:active {
  transform: translateY(0);
  box-shadow: var(--ht-shadow-sm);
}

.theme-dark .ht-btn--secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--ht-primary-light);
}

.ht-btn--ghost {
  background: transparent;
  color: var(--ht-text-secondary);
  border-color: transparent;
}

.ht-btn--ghost:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--ht-primary);
  border-color: rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.ht-btn--ghost:active {
  transform: translateY(0);
  background: rgba(99, 102, 241, 0.12);
}

.theme-dark .ht-btn--ghost:hover {
  background: rgba(129, 140, 248, 0.15);
  color: var(--ht-primary-light);
}

/* Button Sizes */
.ht-btn--sm {
  padding: var(--ht-space-1) var(--ht-space-3);
  font-size: 0.75rem;
}

.ht-btn--lg {
  padding: var(--ht-space-3) var(--ht-space-6);
  font-size: 1rem;
}

/* Theme Toggle */
.ht-theme-toggle {
  position: relative;
}

.ht-theme-icon--dark {
  display: none;
}

.theme-dark .ht-theme-icon--light {
  display: none;
}

.theme-dark .ht-theme-icon--dark {
  display: block;
}

/* Favorites Button */
.ht-favorites-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--ht-danger);
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 2px 4px;
  border-radius: var(--ht-radius-full);
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ht-favorites-count:empty {
  display: none;
}

/* Main Content */
.ht-main {
  padding: var(--ht-space-8) 0;
  flex: 1;
}

/* Premium Hero Section */
.ht-hero {
  text-align: center;
  margin-bottom: var(--ht-space-16);
  padding: var(--ht-space-8) var(--ht-space-4);
  background: var(--ht-gradient-secondary);
  border-radius: var(--ht-radius-xl);
  border: 1px solid var(--ht-border-light);
}

.ht-hero__title {
  font-size: 2.25rem;
  font-weight: var(--ht-font-weight-black);
  background: var(--ht-gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--ht-space-4);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

@media (min-width: 640px) {
  .ht-hero__title {
    font-size: 3rem;
  }
}

.ht-hero__description {
  font-size: 1.125rem;
  color: var(--ht-text-secondary);
  max-width: 600px;
  margin: 0 auto var(--ht-space-8);
  line-height: 1.6;
}

/* Quick Access */
.ht-quick-access {
  margin-top: var(--ht-space-8);
}

/* Section Titles */
.ht-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-6);
  line-height: 1.3;
}

.ht-section-title--small {
  font-size: 1.25rem;
  margin-bottom: var(--ht-space-4);
}

/* Grid Systems */
.ht-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--ht-space-6);
  margin-bottom: var(--ht-space-12);
  width: 100%;
}

.ht-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--ht-space-4);
  width: 100%;
}

.ht-quick-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--ht-space-3);
  max-width: 800px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .ht-quick-tools {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

/* Professional Category Cards */
.ht-category-card {
  background: var(--ht-gradient-secondary);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-xl);
  padding: var(--ht-space-6);
  transition: var(--ht-transition);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--ht-shadow-sm);
}

.ht-category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ht-shadow-lg), var(--ht-shadow-brand);
  border-color: var(--ht-primary-light);
  background: var(--ht-surface-elevated);
}

.ht-category-card:hover .ht-category-card__icon {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.ht-category-card:active {
  transform: translateY(-2px);
  box-shadow: var(--ht-shadow-md);
}

.ht-category-card__icon {
  font-size: 2rem;
  margin-bottom: var(--ht-space-3);
  display: block;
  transition: var(--ht-transition-bounce);
  filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

.ht-category-card__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--ht-space-2);
  color: var(--ht-text);
}

.ht-category-card__description {
  font-size: 0.875rem;
  color: var(--ht-text-secondary);
  margin-bottom: var(--ht-space-3);
  line-height: 1.5;
}

.ht-category-card__count {
  font-size: 0.75rem;
  color: var(--ht-text-muted);
  font-weight: 500;
}

/* Enhanced Tool Cards */
.ht-tool-card {
  background: var(--ht-gradient-secondary);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-lg);
  padding: var(--ht-space-4);
  transition: var(--ht-transition);
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.ht-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ht-shadow-md);
  border-color: var(--ht-primary-light);
  background: var(--ht-surface-elevated);
}

.ht-tool-card:active {
  transform: translateY(-1px);
  box-shadow: var(--ht-shadow);
}

.ht-tool-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--ht-space-1);
  color: var(--ht-text);
  line-height: 1.3;
}

.ht-tool-card__description {
  font-size: 0.75rem;
  color: var(--ht-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ht-tool-card__icon {
  position: absolute;
  top: var(--ht-space-3);
  right: var(--ht-space-3);
  font-size: 1rem;
  opacity: 0.6;
}

/* Command Palette */
.ht-command-palette {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--ht-z-modal);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: var(--ht-space-20) var(--ht-space-4);
}

.ht-command-palette.show {
  display: flex;
}

.ht-command-palette__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ht-command-palette__container {
  position: relative;
  background: var(--ht-surface-elevated);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-lg);
  box-shadow: var(--ht-shadow-xl);
  width: 100%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ht-command-palette__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--ht-space-4);
  border-bottom: 1px solid var(--ht-border);
  flex-shrink: 0;
}

.ht-command-palette__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.ht-command-palette__close {
  background: none;
  border: none;
  color: var(--ht-text-muted);
  cursor: pointer;
  padding: var(--ht-space-1);
  border-radius: var(--ht-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ht-transition);
}

.ht-command-palette__close:hover {
  color: var(--ht-text);
  background: var(--ht-gray-100);
}

.ht-command-palette__search {
  padding: var(--ht-space-4);
  border-bottom: 1px solid var(--ht-border);
  flex-shrink: 0;
}

.ht-command-palette__input {
  width: 100%;
  padding: var(--ht-space-3);
  border: 1px solid var(--ht-input-border);
  border-radius: var(--ht-radius);
  background: var(--ht-input-bg);
  color: var(--ht-text);
  font-size: 1rem;
  outline: none;
  transition: var(--ht-transition);
}

.ht-command-palette__input:focus {
  border-color: var(--ht-input-border-focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ht-command-palette__results {
  flex: 1;
  overflow-y: auto;
  padding: var(--ht-space-2);
}

.ht-command-palette__footer {
  padding: var(--ht-space-3) var(--ht-space-4);
  border-top: 1px solid var(--ht-border);
  background: var(--ht-surface);
  flex-shrink: 0;
}

.ht-command-palette__hint {
  font-size: 0.75rem;
  color: var(--ht-text-muted);
  display: flex;
  align-items: center;
  gap: var(--ht-space-2);
}

/* Keyboard shortcuts styling */
kbd {
  background: var(--ht-gray-100);
  border: 1px solid var(--ht-gray-300);
  border-radius: var(--ht-radius-sm);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
  color: var(--ht-text);
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}

.theme-dark kbd {
  background: var(--ht-gray-700);
  border-color: var(--ht-gray-600);
}

/* Loading States */
.ht-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ht-background);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--ht-space-4);
  z-index: var(--ht-z-modal);
}

.ht-loading.show {
  display: flex;
}

.ht-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ht-border);
  border-top-color: var(--ht-primary);
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ht-loading__text {
  font-size: 0.875rem;
  color: var(--ht-text-secondary);
}

/* Footer */
.ht-footer {
  background: var(--ht-surface);
  border-top: 1px solid var(--ht-border);
  padding: var(--ht-space-12) 0 var(--ht-space-8);
  margin-top: var(--ht-space-16);
}

.ht-footer__content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--ht-space-8);
  margin-bottom: var(--ht-space-8);
}

.ht-footer__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--ht-space-3);
  color: var(--ht-text);
}

.ht-footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--ht-space-2);
}

.ht-footer__links a {
  color: var(--ht-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--ht-transition);
}

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

.ht-footer__text {
  font-size: 0.875rem;
  color: var(--ht-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--ht-space-4);
}

.ht-footer__bottom {
  border-top: 1px solid var(--ht-border);
  padding-top: var(--ht-space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ht-space-4);
  font-size: 0.75rem;
  color: var(--ht-text-muted);
}

.ht-footer__performance {
  display: flex;
  gap: var(--ht-space-3);
}

/* Social Links */
.ht-social-links {
  display: flex;
  gap: var(--ht-space-3);
}

.ht-social-link {
  color: var(--ht-text-muted);
  transition: var(--ht-transition);
  padding: var(--ht-space-2);
  border-radius: var(--ht-radius);
}

.ht-social-link:hover {
  color: var(--ht-primary);
  background: var(--ht-gray-100);
}

.theme-dark .ht-social-link:hover {
  background: var(--ht-gray-700);
}

/* Recent Tools Section */
.ht-recent-tools {
  margin-bottom: var(--ht-space-12);
}

/* Responsive Design */
@media (max-width: 768px) {
  .ht-header__content {
    flex-wrap: wrap;
    gap: var(--ht-space-3);
  }
  
  .ht-search {
    order: 3;
    flex-basis: 100%;
  }
  
  .ht-hero__title {
    font-size: 2rem;
  }
  
  .ht-categories-grid {
    grid-template-columns: 1fr;
  }
  
  .ht-tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .ht-footer__content {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--ht-space-6);
  }
  
  .ht-footer__bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ================================
   CATEGORY PAGE STYLES
   ================================ */

/* Category Page Header */
.ht-category-header {
  text-align: center;
  padding: var(--ht-space-12) 0 var(--ht-space-8);
  background: linear-gradient(135deg, var(--ht-surface) 0%, var(--ht-background) 100%);
  border-radius: var(--ht-radius-lg);
  margin-bottom: var(--ht-space-8);
  border: 1px solid var(--ht-border-light);
}

.ht-category-hero {
  max-width: 600px;
  margin: 0 auto;
}

.ht-category-icon {
  font-size: 4rem;
  margin-bottom: var(--ht-space-4);
  display: block;
}

.ht-category-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
  line-height: 1.2;
}

.ht-category-description {
  font-size: 1.125rem;
  color: var(--ht-text-secondary);
  margin-bottom: var(--ht-space-6);
  line-height: 1.6;
}

.ht-category-stats {
  display: flex;
  justify-content: center;
  gap: var(--ht-space-8);
  flex-wrap: wrap;
}

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

.ht-stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ht-primary);
}

.ht-stat__label {
  display: block;
  font-size: 0.875rem;
  color: var(--ht-text-muted);
  margin-top: var(--ht-space-1);
}

/* Subcategory Filters */
.ht-subcategory-filters {
  margin-bottom: var(--ht-space-8);
  padding: var(--ht-space-6);
  background: var(--ht-surface);
  border-radius: var(--ht-radius-lg);
  border: 1px solid var(--ht-border-light);
}

.ht-filters-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
}

.ht-filters-grid {
  display: flex;
  gap: var(--ht-space-2);
  flex-wrap: wrap;
}

.ht-filter-btn {
  padding: var(--ht-space-2) var(--ht-space-4);
  border: 1px solid var(--ht-border);
  background: var(--ht-background);
  color: var(--ht-text-secondary);
  border-radius: var(--ht-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--ht-transition);
}

.ht-filter-btn:hover {
  border-color: var(--ht-primary);
  color: var(--ht-primary);
  background: var(--ht-primary-light);
  background-opacity: 0.1;
}

.ht-filter-btn--active {
  background: var(--ht-primary);
  color: var(--ht-white);
  border-color: var(--ht-primary);
}

/* Tools Section */
.ht-tools-section {
  margin-bottom: var(--ht-space-12);
}

.ht-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ht-space-6);
  flex-wrap: wrap;
  gap: var(--ht-space-4);
}

.ht-tools-sort {
  display: flex;
  align-items: center;
  gap: var(--ht-space-2);
}

.ht-select {
  padding: var(--ht-space-2) var(--ht-space-3);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius);
  background: var(--ht-background);
  color: var(--ht-text);
  font-size: 0.875rem;
  min-width: 150px;
}

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

/* Enhanced Tools Grid for Category Pages */
.ht-tools-grid--large {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--ht-space-6);
  margin-bottom: var(--ht-space-8);
  width: 100%;
  min-height: auto;
}

.ht-tool-card--detailed {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--ht-space-6);
  background: var(--ht-surface-elevated);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-lg);
  text-decoration: none;
  color: inherit;
  transition: var(--ht-transition);
  box-shadow: var(--ht-shadow-sm);
  height: 100%;
}

.ht-tool-card--detailed:hover {
  transform: translateY(-2px);
  box-shadow: var(--ht-shadow-lg);
  border-color: var(--ht-primary-light);
}

.ht-tool-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--ht-space-3);
}

.ht-tool-card__popularity {
  font-size: 0.75rem;
  color: var(--ht-warning);
  line-height: 1;
}

.ht-tool-card__footer {
  margin-top: auto;
  padding-top: var(--ht-space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ht-space-2);
}

.ht-tool-card__tags {
  display: flex;
  gap: var(--ht-space-1);
  flex-wrap: wrap;
}

.ht-tag {
  padding: var(--ht-space-1) var(--ht-space-2);
  background: var(--ht-primary);
  color: var(--ht-white);
  border-radius: var(--ht-radius-sm);
  font-size: 0.625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.ht-difficulty {
  padding: var(--ht-space-1) var(--ht-space-2);
  border-radius: var(--ht-radius-sm);
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.ht-difficulty--beginner {
  background: var(--ht-success);
  color: var(--ht-white);
}

.ht-difficulty--intermediate {
  background: var(--ht-warning);
  color: var(--ht-white);
}

.ht-difficulty--advanced {
  background: var(--ht-danger);
  color: var(--ht-white);
}

/* Pagination */
.ht-pagination {
  text-align: center;
  margin: var(--ht-space-8) 0;
}

/* Related Categories */
.ht-related-categories {
  margin-top: var(--ht-space-12);
  padding-top: var(--ht-space-8);
  border-top: 1px solid var(--ht-border-light);
}

/* Breadcrumbs */
.ht-breadcrumbs {
  background: var(--ht-surface);
  border-bottom: 1px solid var(--ht-border-light);
  padding: var(--ht-space-3) 0;
  margin-bottom: var(--ht-space-6);
}

.ht-breadcrumbs-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: var(--ht-space-1);
}

.ht-breadcrumb-item {
  display: flex;
  align-items: center;
}

.ht-breadcrumb-link {
  color: var(--ht-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: var(--ht-transition);
}

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

.ht-breadcrumb-current {
  color: var(--ht-text);
  font-weight: 500;
  font-size: 0.875rem;
}

.ht-breadcrumb-separator {
  margin: 0 var(--ht-space-2);
  color: var(--ht-text-muted);
  font-size: 0.875rem;
}

/* Tool Page Placeholder Styles */
.ht-tool-header {
  text-align: center;
  padding: var(--ht-space-12) 0 var(--ht-space-8);
  background: linear-gradient(135deg, var(--ht-surface) 0%, var(--ht-background) 100%);
  border-radius: var(--ht-radius-lg);
  margin-bottom: var(--ht-space-8);
}

.ht-tool-hero {
  max-width: 600px;
  margin: 0 auto;
}

.ht-tool-icon {
  font-size: 4rem;
  margin-bottom: var(--ht-space-4);
  display: block;
}

.ht-tool-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
  line-height: 1.2;
}

.ht-tool-description {
  font-size: 1.125rem;
  color: var(--ht-text-secondary);
  margin-bottom: var(--ht-space-6);
  line-height: 1.6;
}

.ht-tool-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--ht-space-4);
  flex-wrap: wrap;
}

.ht-tool-category,
.ht-tool-rating {
  padding: var(--ht-space-1) var(--ht-space-3);
  background: var(--ht-surface);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius);
  font-size: 0.875rem;
  color: var(--ht-text-secondary);
}

.ht-tool-placeholder {
  text-align: center;
  padding: var(--ht-space-16) var(--ht-space-6);
  background: var(--ht-surface);
  border-radius: var(--ht-radius-lg);
  margin: var(--ht-space-8) 0;
}

.ht-placeholder-content {
  max-width: 600px;
  margin: 0 auto;
}

.ht-placeholder-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
}

.ht-placeholder-description {
  font-size: 1.125rem;
  color: var(--ht-text-secondary);
  margin-bottom: var(--ht-space-8);
  line-height: 1.6;
}

.ht-placeholder-features {
  margin-bottom: var(--ht-space-8);
}

.ht-placeholder-features h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
}

.ht-placeholder-features ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ht-placeholder-features li {
  padding: var(--ht-space-2) 0;
  color: var(--ht-text-secondary);
  position: relative;
  padding-left: var(--ht-space-6);
}

.ht-placeholder-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--ht-success);
  font-weight: 600;
}

.ht-placeholder-actions {
  display: flex;
  justify-content: center;
  gap: var(--ht-space-4);
  flex-wrap: wrap;
}

/* 404 Page Styles */
.ht-404-page {
  text-align: center;
  padding: var(--ht-space-16) var(--ht-space-4);
}

.ht-404-hero {
  margin-bottom: var(--ht-space-12);
}

.ht-404-icon {
  font-size: 4rem;
  margin-bottom: var(--ht-space-4);
}

.ht-404-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
}

.ht-404-description {
  font-size: 1.125rem;
  color: var(--ht-text-secondary);
  margin-bottom: var(--ht-space-8);
}

.ht-404-suggestions {
  margin-bottom: var(--ht-space-12);
}

.ht-404-actions {
  display: flex;
  justify-content: center;
  gap: var(--ht-space-4);
  flex-wrap: wrap;
}

/* Related Tools Section */
.ht-related-tools-section {
  margin-top: var(--ht-space-12);
  padding-top: var(--ht-space-8);
  border-top: 1px solid var(--ht-border-light);
}

/* Responsive Design for Category Pages */
@media (max-width: 768px) {
  .ht-category-title {
    font-size: 2rem;
  }
  
  .ht-category-icon {
    font-size: 3rem;
  }
  
  .ht-tools-grid--large {
    grid-template-columns: 1fr;
  }
  
  .ht-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .ht-category-stats {
    flex-direction: column;
    gap: var(--ht-space-4);
  }
  
  .ht-filters-grid {
    justify-content: center;
  }
  
  .ht-breadcrumbs-list {
    font-size: 0.75rem;
  }
  
  .ht-tool-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --ht-border: #000000;
    --ht-text-muted: #404040;
  }
  
  .theme-dark {
    --ht-border: #ffffff;
    --ht-text-muted: #cccccc;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .ht-tool-card:hover,
  .ht-category-card:hover {
    transform: none;
  }
}

/* ================================
   TEXT CASE CONVERTER STYLES
   ================================ */

/* Input Section Specific Styles */
.ht-input-section {
  margin-bottom: var(--ht-space-8);
}

.ht-input-container {
  margin-bottom: var(--ht-space-4);
}

.ht-input-label {
  display: block;
  font-weight: 600;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-2);
  font-size: 0.875rem;
}

.ht-textarea {
  width: 100%;
  min-height: 120px;
  padding: var(--ht-space-4);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-lg);
  font-size: 0.875rem;
  font-family: var(--ht-font-family);
  background: var(--ht-input-bg);
  color: var(--ht-text);
  resize: vertical;
  transition: var(--ht-transition);
  outline: none;
}

.ht-textarea:focus {
  border-color: var(--ht-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.ht-textarea::placeholder {
  color: var(--ht-text-muted);
}

.ht-text-stats {
  display: flex;
  gap: var(--ht-space-4);
  margin-top: var(--ht-space-2);
  font-size: 0.75rem;
}

.ht-stat {
  display: flex;
  align-items: center;
  gap: var(--ht-space-1);
}

.ht-stat__label {
  color: var(--ht-text-muted);
  font-weight: 500;
}

.ht-stat__value {
  color: var(--ht-primary);
  font-weight: 600;
  min-width: 20px;
}

.ht-actions {
  display: flex;
  justify-content: flex-end;
}

/* Conversion Section */
.ht-conversion-section {
  margin-bottom: var(--ht-space-8);
}

.ht-conversion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--ht-space-3);
  max-width: 800px;
  margin: 0 auto;
}

.ht-btn--conversion {
  background: var(--ht-surface-elevated);
  color: var(--ht-text);
  border: 1px solid var(--ht-border);
  padding: var(--ht-space-3) var(--ht-space-4);
  font-size: 0.75rem;
  font-weight: 600;
  min-height: 48px;
  transition: var(--ht-transition);
}

.ht-btn--conversion:hover {
  border-color: var(--ht-primary);
  background: var(--ht-primary);
  color: var(--ht-white);
  transform: translateY(-1px);
}

.ht-btn--conversion:active {
  transform: translateY(0);
}

/* Results Section */
.ht-results-section {
  margin-bottom: var(--ht-space-8);
}

.ht-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--ht-space-4);
  margin-top: var(--ht-space-6);
}

.ht-result-item {
  background: var(--ht-surface-elevated);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-lg);
  padding: var(--ht-space-4);
  transition: var(--ht-transition);
}

.ht-result-item:hover {
  border-color: var(--ht-primary);
  box-shadow: var(--ht-shadow-md);
}

.ht-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--ht-space-3);
  padding-bottom: var(--ht-space-2);
  border-bottom: 1px solid var(--ht-border);
}

.ht-result-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ht-text);
  margin: 0;
}

.ht-btn--copy {
  background: rgba(37, 99, 235, 0.1);
  color: var(--ht-primary);
  border: 1px solid transparent;
  padding: var(--ht-space-1) var(--ht-space-2);
  font-size: 0.625rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--ht-space-1);
  min-height: 28px;
  transition: var(--ht-transition);
}

.ht-btn--copy:hover {
  background: var(--ht-primary);
  color: var(--ht-white);
}

.ht-btn--copy.copied {
  background: var(--ht-success);
  color: var(--ht-white);
}

.ht-copy-text {
  font-size: 0.625rem;
}

.ht-result-content {
  min-height: 60px;
  padding: var(--ht-space-3);
  background: var(--ht-background);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius);
  font-family: var(--ht-font-family-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--ht-text);
  word-break: break-word;
  white-space: pre-wrap;
}

/* Footer Specific Styles */
.ht-footer {
  background: var(--ht-surface);
  border-top: 1px solid var(--ht-border);
  padding: var(--ht-space-8) 0;
  margin-top: var(--ht-space-8);
}

.ht-footer-content {
  text-align: center;
}

.ht-footer-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ht-text);
  margin-bottom: var(--ht-space-4);
}

.ht-related-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ht-space-4);
  margin-bottom: var(--ht-space-6);
}

.ht-related-tool {
  color: var(--ht-primary);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  padding: var(--ht-space-1) var(--ht-space-3);
  border-radius: var(--ht-radius);
  transition: var(--ht-transition);
}

.ht-related-tool:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--ht-primary-dark);
}

.ht-footer-text {
  color: var(--ht-text-muted);
  font-size: 0.75rem;
  margin: 0;
}

/* Copy Notification */
.ht-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--ht-success);
  color: var(--ht-white);
  padding: var(--ht-space-3) var(--ht-space-4);
  border-radius: var(--ht-radius);
  display: flex;
  align-items: center;
  gap: var(--ht-space-2);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--ht-shadow-lg);
  transform: translateX(calc(100% + 40px));
  transition: transform var(--ht-transition-slow);
  z-index: var(--ht-z-tooltip);
}

.ht-notification.show {
  transform: translateX(0);
}

/* Responsive adjustments for text converter */
@media (max-width: 768px) {
  .ht-conversion-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--ht-space-2);
  }

  .ht-results-grid {
    grid-template-columns: 1fr;
    gap: var(--ht-space-3);
  }

  .ht-related-tools {
    flex-direction: column;
    align-items: center;
    gap: var(--ht-space-2);
  }

  .ht-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    transform: translateY(-100px);
  }

  .ht-notification.show {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .ht-textarea {
    min-height: 100px;
    padding: var(--ht-space-3);
  }

  .ht-conversion-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ht-text-stats {
    justify-content: center;
  }

  .ht-actions {
    justify-content: center;
  }
}

/* Critical fix for scrolling issues on category pages */
.ht-categories-grid,
.ht-tools-grid,
.ht-tools-grid--large,
.ht-results-grid,
.ht-quick-tools {
  contain: layout;
  overflow: visible;
}

/* Ensure all grid containers allow natural document flow */
.ht-categories-grid *,
.ht-tools-grid *,
.ht-tools-grid--large *,
.ht-results-grid * {
  position: relative;
}

/* Override any problematic positioning */
.ht-tool-card--detailed,
.ht-tool-card,
.ht-category-card {
  position: relative !important;
  transform: none;
  transition: transform var(--ht-transition), box-shadow var(--ht-transition), border-color var(--ht-transition);
}

.ht-tool-card--detailed:hover,
.ht-tool-card:hover,
.ht-category-card:hover {
  transform: translateY(-2px);
}

/* Ensure main content area never restricts scroll */
.ht-main {
  overflow: visible;
  contain: none;
}
