/* AllConvert - Mobile-First, 120 FPS Ultra-Clean Stylesheet */

/* Light Theme Variables (Default & Sole Theme) */
:root,
html {
  color-scheme: light;
  
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  
  --border-light: rgba(226, 232, 240, 0.9);
  --border-focus: #2563eb;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-tertiary: #94a3b8;
  
  --brand-blue: #2563eb;
  --brand-blue-hover: #1d4ed8;
  --brand-blue-subtle: rgba(37, 99, 235, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.08);

  --body-bg: radial-gradient(circle at 50% 0%, #ebf3ff 0%, #f8fafc 65%);
}

:root {
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Reset & 120 FPS Motion Optimizations */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--body-bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Typography */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-main);
  word-break: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

input, textarea {
  font-family: inherit;
  color: inherit;
}

/* Container */
.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Sticky Header & Responsive Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.site-logo-img {
  height: 40px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-blue);
}

/* Category Dropdown Menu */
.nav-item-dropdown {
  position: relative;
}

.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.dropdown-arrow-icon {
  transition: transform 0.2s ease;
}

.nav-item-dropdown:hover .dropdown-arrow-icon,
.nav-item-dropdown:focus-within .dropdown-arrow-icon {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 370px;
  background-color: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.16), 0 8px 18px -4px rgba(15, 23, 42, 0.08);
  padding: 0;
  display: none;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(10px) scale(1);
  }
}

/* Maintain hover bridge so dropdown doesn't close prematurely */
.nav-item-dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 16px;
}

.nav-item-dropdown:hover .nav-dropdown-menu,
.nav-item-dropdown:focus-within .nav-dropdown-menu {
  display: flex;
}

.dropdown-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-light);
}

.dropdown-header-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dropdown-header-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--brand-blue);
  border-radius: var(--radius-full);
}

.dropdown-items-grid {
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.16s ease;
  position: relative;
}

.dropdown-item:hover {
  background-color: #f1f5f9;
  transform: translateX(2px);
}

.dropdown-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.16s ease;
}

.dropdown-item:hover .dropdown-icon-box {
  transform: scale(1.08);
}

.cat-icon-image {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #dbeafe;
}

.cat-icon-data {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.cat-icon-color {
  background: #fdf2f8;
  color: #db2777;
  border: 1px solid #fbcfe8;
}

.cat-icon-audio {
  background: #faf5ff;
  color: #7c3aed;
  border: 1px solid #ede9fe;
}

.cat-icon-office {
  background: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.cat-icon-archive {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.dropdown-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dropdown-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.dropdown-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.dropdown-count-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background-color: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.dropdown-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-chevron {
  color: var(--text-tertiary);
  opacity: 0;
  transform: translateX(-4px);
  transition: all 0.16s ease;
  flex-shrink: 0;
}

.dropdown-item:hover .dropdown-chevron {
  opacity: 1;
  color: var(--brand-blue);
  transform: translateX(0);
}

.dropdown-footer-bar {
  padding: 10px 14px;
  background-color: #fafafa;
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.dropdown-footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-blue);
  text-decoration: none;
  transition: gap 0.15s ease;
}

.dropdown-footer-link:hover {
  gap: 9px;
  text-decoration: underline;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile Nav Drawer Button */
.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  color: var(--text-main);
}

/* Mobile Navigation Menu Dropdown */
.mobile-menu-drawer {
  display: none;
  flex-direction: column;
  padding: 14px 20px 20px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}

.mobile-menu-drawer.open {
  display: flex;
}

.mobile-nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 8px 0;
  text-decoration: none;
}

.mobile-nav-link:hover {
  color: var(--brand-blue);
}

.mobile-nav-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 6px 0;
}

.mobile-category-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 4px;
}

.mobile-category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.mobile-category-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.mobile-category-chip:hover,
.mobile-category-chip:active {
  border-color: var(--brand-blue);
  background-color: var(--brand-blue-subtle);
  color: var(--brand-blue);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 44px 0 28px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  background: var(--brand-blue-subtle);
  border: 1px solid var(--border-light);
  color: var(--brand-blue);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 12px;
  color: var(--text-main);
}

.hero-title-highlight {
  display: block;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 auto 32px;
  padding: 0 8px;
}

/* Search Box Container */
.search-container {
  max-width: 600px;
  margin: 0 auto 40px;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 5px 6px 5px 18px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-box:focus-within {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-lg), 0 0 0 3px var(--brand-blue-subtle);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 8px;
  font-size: 1rem;
  color: var(--text-main);
  outline: none;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background-color: var(--brand-blue);
  color: #ffffff;
  flex-shrink: 0;
  transition: background-color 0.15s, transform 0.15s;
}

.search-btn:hover {
  background-color: var(--brand-blue-hover);
}

.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.1s;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--bg-hover);
}

.search-result-title {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
}

.search-result-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

/* Category Grid & Tool Cards (Screenshots 1 & 2 clean style) */
.section-title-wrap {
  text-align: center;
  margin-bottom: 28px;
}

.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
}

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

.popular-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-width: 0;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-blue);
}

.tool-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.tool-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #ffffff;
  flex-shrink: 0;
}

.icon-image { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.icon-archive { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.icon-audio { background: linear-gradient(135deg, #a855f7, #7e22ce); }
.icon-video { background: linear-gradient(135deg, #10b981, #059669); }
.icon-data { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.icon-color { background: linear-gradient(135deg, #ec4899, #db2777); }
.icon-office { background: linear-gradient(135deg, #f59e0b, #d97706); }

.tool-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.tool-card:hover .tool-card-arrow {
  color: var(--brand-blue);
  transform: translateX(3px);
}

/* Feature Highlights Bar */
.features-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 56px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.feature-icon-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--brand-blue-subtle);
  color: var(--brand-blue);
  margin-bottom: 4px;
}

.feature-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.feature-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tool Converter Workspace */
.tool-page-wrap {
  padding: 28px 0 56px;
  width: 100%;
}

.tool-header {
  text-align: center;
  margin-bottom: 24px;
  padding: 0 8px;
}

.tool-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  color: #ffffff;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}

.tool-page-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin-bottom: 8px;
}

.tool-page-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Interactive Dropzone Box */
.dropzone-card {
  max-width: 680px;
  width: 100%;
  margin: 0 auto 28px;
  background-color: var(--bg-surface);
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-xl);
  padding: 44px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.dropzone-card.drag-over {
  border-color: var(--brand-blue);
  background-color: var(--brand-blue-subtle);
  transform: scale(1.01);
}

.dropzone-icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--brand-blue-subtle);
  color: var(--brand-blue);
  margin-bottom: 16px;
}

.dropzone-prompt {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.dropzone-hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 30px;
  border-radius: var(--radius-full);
  background-color: var(--brand-blue);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background-color: var(--brand-blue-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border-light);
  transition: background-color 0.15s;
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
}

/* File Processing & Result Card */
.processing-card {
  max-width: 680px;
  width: 100%;
  margin: 0 auto 28px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  display: none;
}

.file-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
  gap: 12px;
}

.file-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.file-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  overflow: hidden;
  margin-bottom: 16px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dual Editor for Code & Data */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto 20px;
}

.editor-box {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.editor-toolbar {
  padding: 10px 14px;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.code-textarea {
  width: 100%;
  height: 300px;
  padding: 14px;
  border: none;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-main);
  resize: vertical;
  outline: none;
}

/* Interactive Color Studio (Matches Top-Ranking convertingcolors.com UI) */
.color-studio-card {
  max-width: 860px;
  margin: 0 auto 28px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
}

.color-studio-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

.color-input-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.color-input-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.color-text-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: ui-monospace, monospace;
}

.color-stepper-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stepper-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stepper-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stepper-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background-color 0.15s;
}

.stepper-btn:hover {
  background-color: var(--bg-hover);
}

.stepper-val-input {
  width: 80px;
  height: 36px;
  text-align: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
}

.color-swap-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 24px;
  transition: transform 0.2s, color 0.15s;
}

.color-swap-btn:hover {
  transform: rotate(180deg);
  color: var(--brand-blue);
}

.color-output-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.color-result-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  font-family: ui-monospace, monospace;
}

.copy-mini-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.copy-mini-btn:hover {
  color: var(--brand-blue);
}

.color-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.color-details-list strong {
  color: var(--text-main);
}

/* Bottom Swatch & Visual Picker */
.color-studio-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.color-swatch-box {
  width: 170px;
  height: 170px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.2);
  transition: background-color 0.15s ease;
  position: relative;
}

.color-swatch-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
}

.color-wheel-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  cursor: crosshair;
}

.color-wheel-canvas {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.color-wheel-cursor {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #000000;
  box-shadow: 0 0 0 2px #ffffff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
}

/* Interactive QR & Barcode Studio */
.qr-studio-card, .sec-studio-card {
  max-width: 860px;
  margin: 0 auto 28px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
}

.qr-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
}

.qr-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.qr-render-area {
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.qr-render-area canvas, .qr-render-area svg {
  max-width: 100%;
  height: auto;
  display: block;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  color: var(--text-main);
  font-size: 0.95rem;
}

/* Security & Hash Studio */
.sec-studio-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sec-hash-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sec-result-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  color: var(--brand-blue);
  word-break: break-all;
}

.sec-controls-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Text Workbench & Live Stats Bar */
.text-stats-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.text-stat-item strong {
  color: var(--brand-blue);
  font-size: 0.95rem;
}

.transform-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.action-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.action-chip:hover {
  background-color: var(--brand-blue-subtle);
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

/* SEO Content & FAQ Section */
.content-section {
  max-width: 780px;
  margin: 40px auto;
  line-height: 1.7;
  color: var(--text-muted);
  padding: 0 4px;
}

.content-section h2 {
  font-size: 1.5rem;
  margin: 28px 0 12px;
  color: var(--text-main);
}

.content-section p {
  margin-bottom: 16px;
}

.content-section ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.content-section li {
  margin-bottom: 6px;
}

.faq-accordion {
  margin-top: 24px;
}

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

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

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

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

/* Ad Placement Containers (Strict Responsive CLS Prevention & Safe Accidental-Click Prevention) */
.ad-slot-leaderboard {
  min-height: 90px;
  max-width: 728px;
  width: 100%;
  margin: 32px auto;
  background-color: var(--bg-subtle);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  contain: layout size;
}

/* Extra safe margins to prevent any accidental misclicks near file dropzones/buttons */
.ad-slot-top {
  margin-top: 12px;
  margin-bottom: 36px;
}

.ad-slot-mid {
  margin-top: 36px;
  margin-bottom: 40px;
}

/* Temporarily disabled ad containers (kept in DOM for future activation & GA4/GTM hooks) */
.ad-slot-disabled {
  display: none !important;
}

/* Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  background-color: var(--bg-surface);
  padding: 32px 0 24px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  transition: color 0.15s;
}

.footer-link:hover {
  color: var(--brand-blue);
}

.footer-copyright {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-tertiary);
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* Enhanced Mobile Optimization */
@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .tool-page-wrap { padding: 18px 0 44px; }
  .nav-links { display: none; }
  .mobile-nav-toggle { display: flex; }
  .hero-section { padding: 24px 0 18px; }
  .hero-title { font-size: 2.1rem; }
  .search-container { margin-bottom: 24px; }
  .popular-grid { grid-template-columns: 1fr; gap: 10px; }
  .features-bar { grid-template-columns: 1fr; gap: 16px; padding: 20px 16px; }
  .editor-grid { grid-template-columns: 1fr; }
  .dropzone-card { padding: 36px 16px; border-radius: var(--radius-lg); margin-bottom: 24px; }
  .color-studio-card { padding: 24px 16px; }
  .color-studio-top { grid-template-columns: 1fr; gap: 18px; }
  .color-swap-btn { margin: 0 auto; }
  .color-studio-bottom { gap: 20px; }
  .color-swatch-box { width: 140px; height: 140px; }
  .color-wheel-wrap, .color-wheel-canvas { width: 140px; height: 140px; }
  .ad-slot-leaderboard { min-height: 60px; font-size: 0.68rem; margin: 28px auto; }
  .ad-slot-top { margin-top: 10px; margin-bottom: 30px; }
  .ad-slot-mid { margin-top: 30px; margin-bottom: 34px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
  .file-name { max-width: 180px; }
  .content-section { padding: 0 4px; }
}
