/* 
 * Design System & CSS Styling
 * Theme: Clean Light Mode with Blue Accents and Smooth Micro-Animations
 */

/* Google Fonts loaded via <link> in HTML head for better performance */

@font-face {
  font-family: 'Kruti Dev 010';
  src: url('fonts/KrutiDev010.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Accessibility utilities */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:root {
  /* Color Palette - Clean Light: White / Blue Accent */
  --bg-primary: hsl(0, 0%, 100%);
  --bg-secondary: hsl(220, 14%, 96%);
  --bg-card: hsla(0, 0%, 100%, 0.8);
  --border-color: hsla(220, 13%, 85%, 0.6);
  --border-hover: hsla(217, 55%, 50%, 0.3);

  --text-primary: hsl(220, 20%, 16%);
  --text-secondary: hsl(215, 16%, 45%);
  --text-muted: hsl(215, 14%, 60%);

  --accent-primary: hsl(217, 55%, 50%);
  --accent-secondary: hsl(213, 55%, 42%);
  --accent-glow: hsla(217, 55%, 50%, 0.15);
  --success: hsl(142, 60%, 42%);
  --accent-warm: hsl(35, 88%, 52%);
  --accent-warm-hover: hsl(35, 80%, 44%);
  --accent-warm-glow: hsla(35, 88%, 52%, 0.2);
  --accent-warm-bg: hsla(35, 88%, 52%, 0.1);

  /* Shadows */
  --shadow-dropdown: rgba(0, 0, 0, 0.4);
  --shadow-card: rgba(0, 0, 0, 0.2);
  --shadow-tooltip: rgba(0, 0, 0, 0.1);
  --shadow-toast: rgba(0, 0, 0, 0.4);
  --shadow-mobile-nav: rgba(0, 0, 0, 0.2);

  /* Component-specific colors */
  --text-on-accent: hsl(0, 0%, 100%);
  --tooltip-bg: hsl(0, 0%, 100%);
  --drop-overlay-bg: hsla(0, 0%, 100%, 0.9);
  --hero-subtitle-color: hsl(215, 16%, 32%);
  --tag-bg: hsla(220, 20%, 30%, 0.4);
  --accent-bg-008: hsla(217, 55%, 50%, 0.08);
  --accent-bg-004: hsla(213, 55%, 42%, 0.04);
  --accent-bg-010: hsla(217, 55%, 50%, 0.1);
  --accent-bg-006: hsla(213, 55%, 42%, 0.06);
  --accent-bg-012: hsla(217, 55%, 50%, 0.12);
  --accent-bg-015: hsla(217, 55%, 50%, 0.15);
  --accent-border-025: hsla(217, 55%, 50%, 0.25);

  /* Layout Constants */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: hsl(222, 15%, 10%);
  --bg-secondary: hsl(222, 14%, 16%);
  --bg-card: hsla(222, 14%, 20%, 0.85);
  --border-color: hsla(222, 10%, 28%, 0.6);
  --border-hover: hsla(217, 55%, 50%, 0.5);

  --text-primary: hsl(220, 15%, 90%);
  --text-secondary: hsl(215, 12%, 60%);
  --text-muted: hsl(215, 10%, 45%);

  --accent-primary: hsl(217, 70%, 62%);
  --accent-secondary: hsl(213, 65%, 52%);
  --accent-glow: hsla(217, 70%, 62%, 0.2);
  --success: hsl(142, 60%, 50%);
  --accent-warm: hsl(35, 80%, 60%);
  --accent-warm-hover: hsl(35, 76%, 52%);
  --accent-warm-glow: hsla(35, 80%, 60%, 0.2);
  --accent-warm-bg: hsla(35, 80%, 60%, 0.12);

  --shadow-dropdown: rgba(0, 0, 0, 0.6);
  --shadow-card: rgba(0, 0, 0, 0.4);
  --shadow-tooltip: rgba(0, 0, 0, 0.3);
  --shadow-toast: rgba(0, 0, 0, 0.6);
  --shadow-mobile-nav: rgba(0, 0, 0, 0.5);

  --text-on-accent: hsl(0, 0%, 100%);
  --tooltip-bg: hsl(222, 14%, 28%);
  --drop-overlay-bg: hsla(0, 0%, 0%, 0.8);
  --hero-subtitle-color: hsl(215, 12%, 65%);
  --tag-bg: hsla(220, 20%, 70%, 0.15);
  --accent-bg-008: hsla(217, 70%, 62%, 0.08);
  --accent-bg-004: hsla(213, 65%, 52%, 0.04);
  --accent-bg-010: hsla(217, 70%, 62%, 0.1);
  --accent-bg-006: hsla(213, 65%, 52%, 0.06);
  --accent-bg-012: hsla(217, 55%, 50%, 0.12);
  --accent-bg-015: hsla(217, 70%, 62%, 0.15);
  --accent-border-025: hsla(217, 70%, 62%, 0.25);
}

/* Base Styles & Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Sora', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  position: relative;
}

/* Background Glowing Blurs */
body::before,
body::after {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  filter: blur(150px);
  opacity: 0.12;
  transition: var(--transition-smooth);
}

body::before {
  top: -10%;
  left: 20%;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 80%);
}

body::after {
  bottom: 10%;
  right: 10%;
  background: radial-gradient(circle, var(--accent-secondary) 0%, transparent 80%);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Mukta', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Main Layout Shell */
#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100vh;
  position: relative;
}

/* Top Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
}

.header-inner .brand-name {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.header-inner .brand-name .brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.header-nav .nav-link {
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

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

.header-nav .nav-link.active {
  background: linear-gradient(135deg, var(--accent-bg-012), var(--accent-bg-004-light));
  color: var(--text-primary);
}

/* Header Search */
.header-search {
  position: relative;
  margin-left: auto;
  max-width: 220px;
  flex-shrink: 0;
}

.header-search input {
  width: 100%;
  padding: 0.45rem 0.85rem 0.45rem 2rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-smooth);
}

.header-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

.header-search svg {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  pointer-events: none;
}

/* Search Suggestions Dropdown */
.search-suggestions {
  display: none;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 24px var(--shadow-dropdown);
}

.search-suggestions.active {
  display: block;
}

.search-suggestions .suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-decoration: none;
  color: var(--text-primary);
}

.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item.focused {
  background: var(--bg-card);
}

.search-suggestions .suggestion-item svg {
  position: static;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.search-suggestions .suggestion-item .suggestion-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.search-suggestions .suggestion-item .suggestion-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-suggestions .suggestion-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Suggestions scrollbar */
.search-suggestions::-webkit-scrollbar {
  width: 4px;
}

.search-suggestions::-webkit-scrollbar-track {
  background: transparent;
}

.search-suggestions::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.footer-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Page Footer */
.page-footer {
  padding: 1.5rem 2.5rem;
  border-top: 1px solid var(--border-color);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

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

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

.page-footer .footer-info {
  display: block;
  text-align: center;
  margin-top: 1rem;
}

/* Main Content Panel */
main.main-content {
  flex: 1;
  min-height: calc(100vh - 60px);
  padding: 2.5rem;
}

/* Header & Page Info */
header.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.page-title h1,
.page-title h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.page-title p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Hamburger menu for mobile */
.menu-toggle {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.menu-toggle:hover {
  border-color: var(--accent-primary);
  background-color: var(--bg-primary);
}

/* Theme Toggle Button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--accent-primary);
  background: var(--accent-bg-008);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-icon-sun {
  display: none;
}

.theme-icon-moon {
  display: block;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Dynamic Tool Views */
.view-container {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-container.active {
  display: block;
}

/* Dashboard Home Layout */
/* Category Filter Bar */
.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.category-filter {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.category-filter:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-bg-008);
}

.category-filter.active {
  background: var(--accent-primary);
  color: var(--text-on-accent);
  border-color: var(--accent-primary);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
  margin-top: 1.5rem;
}

/* Glassmorphism Tool Cards */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-bounce);
}

.tool-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-bg-010), var(--accent-bg-006));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: var(--transition-smooth);
}

.tool-card:hover .tool-card-icon {
  background: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

.tool-card-info h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.tool-card-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.tool-card-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  background: var(--accent-bg-008);
  color: var(--accent-primary);
  align-self: flex-start;
}

/* Converter Workspace Layout */
.converter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Converter description for SEO */
.converter-description {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.converter-description strong {
  color: var(--accent-primary);
}

/* FAQ Section */
.faq-section {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 1rem;
}

.faq-heading {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-item:hover {
  border-color: var(--accent-primary);
}

.faq-item details {
  padding: 1rem 1.25rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--accent-primary);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item details[open] summary::after {
  content: '−';
}

.faq-item details p {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Controls Panel */
.converter-controls {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--text-muted);
  border-radius: 100px;
  transition: var(--transition-smooth);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--text-primary);
  top: 3px;
  left: 3px;
  transition: var(--transition-smooth);
}

.toggle-checkbox {
  display: none;
}

.toggle-checkbox:checked+.toggle-switch {
  background-color: var(--accent-primary);
}

.toggle-checkbox:checked+.toggle-switch::after {
  left: 23px;
}

/* Case Converter Action Buttons */
.case-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: var(--text-on-accent);
  padding: 0.7rem 1.5rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1 1 auto;
  min-width: 120px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--accent-glow);
}

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

/* Word Counter Stats Grid */
.counter-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Frequency Analysis */
.frequency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.frequency-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 50px;
}

.frequency-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.freq-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.freq-word {
  min-width: 80px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.freq-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
}

.freq-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px;
  transition: width 0.2s ease;
}

.freq-count {
  min-width: 30px;
  text-align: right;
  color: var(--text-muted);
  font-weight: 600;
}

/* Swap Direction Button */
.btn-swap {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border: none;
  color: var(--text-on-accent);
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--accent-glow);
  transition: var(--transition-smooth);
}

.btn-swap:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-swap svg {
  width: 18px;
  height: 18px;
  transition: var(--transition-smooth);
}

.btn-swap:hover svg {
  transform: rotate(180deg);
}

/* Text Areas Workspace Grid */
.converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.textarea-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem;
  position: relative;
  transition: var(--transition-smooth);
}

.textarea-container:focus-within {
  border-color: var(--border-hover);
  box-shadow: 0 0 15px var(--accent-glow);
}

.container-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
}

.container-header h3 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.container-header .font-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
}

.textarea-wrapper {
  position: relative;
  flex: 1;
  min-height: 280px;
}

.textarea-wrapper textarea {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.6rem;
}

.textarea-wrapper textarea.font-krutidev {
  font-family: 'Kruti Dev 010', 'Kruti Dev 010 Regular', sans-serif;
  font-size: 1.25rem;
}

.font-krutidev::placeholder {
  font-family: sans-serif;
}

.textarea-wrapper textarea.font-unicode {
  font-family: 'Sora', sans-serif;
}

/* Text Area Toolbar (Action Buttons) */
.textarea-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stats-group span {
  margin-right: 1rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-icon {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Tooltip */
.btn-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  background-color: var(--tooltip-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

.btn-icon:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* File Input wrapper */
.file-upload-input {
  display: none;
}

/* Toast Notification Overlay */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-card);
  border-left: 4px solid var(--accent-primary);
  border-right: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 0 10px 10px 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: slideIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast.success {
  border-left-color: var(--success);
}

.toast svg {
  width: 18px;
  height: 18px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .converter-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .header-inner {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .header-search {
    max-width: 160px;
  }

  .menu-toggle {
    display: block;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.25rem;
    box-shadow: 0 8px 24px var(--shadow-mobile-nav);
  }

  .header-nav.open {
    display: flex;
  }

  main.main-content {
    padding: 1.5rem;
  }

  header.content-header {
    margin-bottom: 2rem;
  }

  .page-title h1,
  .page-title h2 {
    font-size: 1.8rem;
  }

  .converter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    justify-content: space-between;
  }
}

/* Drag and Drop Hover State Overlay */
.textarea-container.drag-over {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 20px var(--accent-glow) !important;
}

.textarea-container.drag-over::after {
  content: 'Drop text file here';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--drop-overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 2px dashed var(--accent-primary);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-family: 'Mukta', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  pointer-events: none;
  z-index: 10;
  animation: fadeIn 0.2s ease-out;
}

/* Homepage Hero Section */
.hero-section {
  position: relative;
  text-align: center;
  padding: 3rem 1rem 4rem;
  max-width: 720px;
  margin: 0 auto;
  overflow: hidden;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--hero-subtitle-color);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.hero-search {
  position: relative;
  max-width: 480px;
  margin: 0 auto 2rem;
}

.hero-search input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: var(--transition-smooth);
  box-sizing: border-box;
}

.hero-search input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 10px var(--accent-glow);
}

.hero-search svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.hero-search .search-suggestions {
  top: calc(100% + 0.35rem);
}

/* Devanagari motif */
.hero-deva-motif {
  position: absolute;
  font-family: 'Mukta', sans-serif;
  font-size: 16rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent-bg-004);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  top: -3rem;
  right: -4rem;
  transform: rotate(-8deg);
  opacity: 0.5;
}

[data-theme="dark"] .hero-deva-motif {
  color: var(--accent-bg-008);
}

/* Custom category icon styles */
.tool-card[data-category="fonts"] .tool-card-icon svg,
.tool-card[data-category="typing"] .tool-card-icon svg,
.tool-card[data-category="image"] .tool-card-icon svg,
.tool-card[data-category="pdf"] .tool-card-icon svg,
.tool-card[data-category="converter"] .tool-card-icon svg,
.tool-card[data-category="text"] .tool-card-icon svg,
.tool-card[data-category="generator"] .tool-card-icon svg,
.tool-card[data-category="encoder"] .tool-card-icon svg,
.tool-card[data-category="calculator"] .tool-card-icon svg,
.tool-card[data-category="timer"] .tool-card-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 1.8;
}

.tool-card:hover .tool-card-icon {
  background: linear-gradient(135deg, var(--accent-warm), var(--accent-warm-hover));
  color: var(--text-on-accent);
  box-shadow: 0 0 15px var(--accent-warm-glow);
}

/* Warm accent for featured tool */
.featured-tool-card .featured-tool-tag {
  background: linear-gradient(135deg, var(--accent-warm-bg), var(--accent-warm-bg));
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

.featured-tool-card:hover .featured-tool-preview {
  background: var(--accent-warm);
  color: var(--text-on-accent);
  box-shadow: 0 0 15px var(--accent-warm-glow);
}

/* Warm accent for category filter */
.category-filter:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: var(--accent-warm-bg);
}

/* Hero warm accent */
.hero-title .highlight-warm {
  color: var(--accent-warm);
}

/* Features Section */
.features-section {
  padding: 2rem 1rem 3rem;
}

.features-heading {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: 2.5rem;
  color: var(--text-primary);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition-bounce);
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-bg-010), var(--accent-bg-006));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  transition: var(--transition-smooth);
}

.feature-card:hover .feature-icon {
  background: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 15px var(--accent-glow);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tools-grid-section {
  padding: 3rem 0 2rem;
  max-width: 1080px;
  margin: 0 auto;
}

.tools-grid-heading {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.featured-tool-section {
  padding: 0.5rem 0 3rem;
  max-width: 860px;
  margin: 0 auto;
}

.featured-tool-card {
  background: linear-gradient(135deg, var(--bg-card), var(--accent-bg-004));
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  transition: var(--transition-smooth);
}

.featured-tool-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.featured-tool-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.3rem 1rem;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent-bg-015), var(--accent-bg-010));
  border: 1px solid var(--accent-border-025);
  color: var(--accent-primary);
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.featured-tool-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.featured-tool-info p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.featured-tool-btn-name {
  text-decoration: none;
  color: var(--text-primary);
}

.featured-tool-btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-on-accent);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.featured-tool-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

.featured-tool-preview {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-bg-010), var(--accent-bg-006));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 0.5rem 3rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .static-page {
    padding: 1.5rem;
  }

  .featured-tool-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  .featured-tool-preview {
    width: 48px;
    height: 48px;
  }
}

/* Static Pages (About, Contact, Privacy, Terms) */
.static-page {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 2.5rem;
  max-width: 800px;
}

.static-page h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.static-page h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

.static-page p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.static-page a {
  color: var(--accent-primary);
  text-decoration: none;
}

.static-page a:hover {
  text-decoration: underline;
}

.static-page em {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.contact-link {
  font-size: 1.1rem;
  font-weight: 600;
}

/* Error Pages (404, 500) */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 2rem;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.error-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 480px;
}

.error-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-on-accent);
  font-family: 'Mukta', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.error-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}