/* ═══════════════════════════════════════════════════════════════════
   convertofile.com — Main Stylesheet
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design Tokens ────────────────────────────────────────────────── */
:root {
  --primary:        #1565C0;
  --primary-dark:   #0D3B7A;
  --primary-light:  #E3EEF9;
  --primary-hover:  #1976D2;
  --accent:         #00897B;
  --accent-light:   #E0F2F1;
  --text:           #1A1A2E;
  --text-muted:     #5A6472;
  --text-light:     #8A95A0;
  --border:         #DEE3EA;
  --border-light:   #EEF1F5;
  --bg:             #F8FAFC;
  --bg-card:        #FFFFFF;
  --ad-bg:          #EEF2F7;
  --ad-border:      #C8D3E0;
  --success:        #2E7D32;
  --success-light:  #E8F5E9;
  --error:          #C62828;
  --error-light:    #FFEBEE;
  --warning:        #E65100;
  --warning-light:  #FFF3E0;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:      0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:      0 8px 28px rgba(0,0,0,0.13);
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      16px;
  --transition:     0.2s ease;
  --font:           'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --header-h:       64px;
  --max-w:          1200px;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img { max-width: 100%; height: auto; display: block; }

ul, ol { list-style: none; }

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: var(--font);
  outline: none;
}

/* ── Ad Slots ─────────────────────────────────────────────────────── */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-light);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  gap: 4px;
  position: relative;
  overflow: hidden;
}

.ad-slot::before {
  content: 'Advertisement';
  font-size: 0.65rem;
  color: var(--text-light);
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.ad-slot-leaderboard {
  width: 100%;
  height: 90px;
  max-width: 728px;
  margin: 0 auto;
}

.ad-slot-banner {
  width: 100%;
  height: 90px;
}

.ad-slot-rectangle {
  width: 300px;
  height: 250px;
  flex-shrink: 0;
}

.ad-slot-skyscraper {
  width: 160px;
  height: 600px;
  flex-shrink: 0;
}

/* ── Top Ad Bar ───────────────────────────────────────────────────── */
.top-ad-bar {
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 16px;
  display: flex;
  justify-content: center;
}

/* ── Header ───────────────────────────────────────────────────────── */
.site-header {
  background: var(--primary-dark);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
}

.logo-text span { color: #90CAF9; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
}

.header-search {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 5px 14px;
  gap: 8px;
  transition: background var(--transition);
}

.header-search:focus-within {
  background: rgba(255,255,255,0.18);
}

.header-search input {
  background: none;
  border: none;
  color: #fff;
  font-size: 0.875rem;
  width: 180px;
}

.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search i { color: rgba(255,255,255,0.5); font-size: 0.875rem; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  padding: 48px 20px 52px;
  text-align: center;
  color: #fff;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero h1 span { color: #90CAF9; }

.hero p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  max-width: 560px;
  margin: 0 auto 24px;
}

.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.9);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-badge i { font-size: 0.75rem; color: #90CAF9; }

/* ── Main Layout ──────────────────────────────────────────────────── */
.main-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 20px;
  width: 100%;
  flex: 1;
}

/* ── Tool Categories & Grid ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.section-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.section-icon.blue  { background: var(--primary-light); color: var(--primary); }
.section-icon.teal  { background: var(--accent-light);  color: var(--accent); }
.section-icon.gold  { background: #FFF8E1; color: #F57F17; }

.category-block { margin-bottom: 36px; }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

/* ── Tool Card ────────────────────────────────────────────────────── */
.tool-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  opacity: 0;
  transition: opacity var(--transition);
  background: var(--primary-light);
}

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

.tool-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.15), var(--shadow-md);
}

.tool-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.tool-card-icon.blue  { background: var(--primary-light); color: var(--primary); }
.tool-card-icon.teal  { background: var(--accent-light);  color: var(--accent); }
.tool-card-icon.gold  { background: #FFF8E1; color: #F57F17; }
.tool-card-icon.purple{ background: #EDE7F6; color: #6A1B9A; }

.tool-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.tool-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-card-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--accent-light);
  color: var(--accent);
  margin-top: 2px;
  width: fit-content;
}

.tool-card-badge.hot   { background: #FFEBEE; color: #C62828; }
.tool-card-badge.new   { background: var(--accent-light); color: var(--accent); }
.tool-card-badge.free  { background: var(--primary-light); color: var(--primary); }

/* ── Tool Panel ───────────────────────────────────────────────────── */
.tool-panel-wrapper {
  display: none;
  margin-bottom: 32px;
}

.tool-panel-wrapper.visible {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.tool-panel {
  flex: 1;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-width: 0;
}

.tool-panel-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.tool-panel-header-icon {
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tool-panel-header-text h2 {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.tool-panel-header-text p {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  margin-top: 2px;
}

.tool-panel-close {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
  font-size: 0.85rem;
}

.tool-panel-close:hover { background: rgba(255,255,255,0.25); }

.tool-panel-body {
  padding: 24px;
}

/* ── Sidebar Ads ──────────────────────────────────────────────────── */
.tool-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  width: 300px;
}

/* ── Drop Zone ────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.drop-zone-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.drop-zone h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

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

.drop-zone p span {
  color: var(--primary);
  font-weight: 600;
}

/* ── Form Elements ────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color var(--transition);
}

.form-control:focus { border-color: var(--primary); }

textarea.form-control {
  resize: vertical;
  min-height: 120px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235A6472' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* Range Slider */
.range-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-group input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
}

.range-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.range-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
  text-align: right;
}

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }
.btn-primary:active { background: var(--primary-dark); }

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-secondary:hover { background: #c8dcf5; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover { background: #1b5e20; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Status / Results ─────────────────────────────────────────────── */
.result-box {
  display: none;
  margin-top: 20px;
  padding: 18px;
  border-radius: var(--radius);
  animation: fadeIn 0.3s ease;
}

.result-box.visible { display: block; }

.result-box.success {
  background: var(--success-light);
  border: 1.5px solid #A5D6A7;
}

.result-box.error {
  background: var(--error-light);
  border: 1.5px solid #EF9A9A;
}

.result-box.info {
  background: var(--primary-light);
  border: 1.5px solid #90CAF9;
}

.result-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.result-box.success .result-box-header { color: var(--success); }
.result-box.error   .result-box-header { color: var(--error); }
.result-box.info    .result-box-header { color: var(--primary); }

.result-output {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text);
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* ── Preview Image ────────────────────────────────────────────────── */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.preview-box {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.preview-box-label {
  padding: 6px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-box img {
  width: 100%;
  height: 160px;
  object-fit: contain;
  display: block;
  padding: 8px;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}

.preview-box-meta {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

/* ── Color Converter ──────────────────────────────────────────────── */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  margin-bottom: 16px;
  transition: background-color 0.3s ease;
}

.color-inputs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.color-swatch-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.color-swatch-picker input[type="color"] {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  background: none;
}

/* ── Steganography ────────────────────────────────────────────────── */
.steg-tabs {
  display: flex;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.steg-tab {
  flex: 1;
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.steg-tab.active {
  background: var(--primary);
  color: #fff;
}

.steg-panel { display: none; }
.steg-panel.active { display: block; }

/* ── Image File Info ──────────────────────────────────────────────── */
.file-info-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.file-info-icon {
  font-size: 1.3rem;
  color: var(--primary);
  flex-shrink: 0;
}

.file-info-details { flex: 1; min-width: 0; }

.file-info-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.file-info-change {
  font-size: 0.78rem;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.file-info-change:hover { text-decoration: underline; }

/* ── Progress Bar ─────────────────────────────────────────────────── */
.progress-wrap {
  display: none;
  margin-top: 16px;
}

.progress-wrap.visible { display: block; }

.progress-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ── Copy Button ──────────────────────────────────────────────────── */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: none;
  border-radius: var(--radius-sm);
  padding: 5px 12px;
  cursor: pointer;
  transition: background var(--transition);
}

.copy-btn:hover { background: #c8dcf5; }
.copy-btn.copied { color: var(--success); background: var(--success-light); }

/* ── Divider ──────────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 20px 0;
}

/* ── Info Panel ───────────────────────────────────────────────────── */
.info-panel {
  background: var(--primary-light);
  border: 1px solid #90CAF9;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--primary-dark);
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.info-panel i { margin-top: 2px; flex-shrink: 0; }

/* ── Footer ───────────────────────────────────────────────────────── */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 32px 20px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}

.footer-brand .logo-text { font-size: 1.1rem; }
.footer-brand p {
  font-size: 0.82rem;
  margin-top: 8px;
  line-height: 1.6;
  color: rgba(255,255,255,0.55);
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 12px;
}

.footer-col ul li {
  margin-bottom: 7px;
}

.footer-col ul li a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color var(--transition);
}

.footer-col ul li a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-bottom {
  max-width: var(--max-w);
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
}

.footer-bottom a:hover { color: rgba(255,255,255,0.8); }

.privacy-links { display: flex; gap: 16px; }

/* ── Bottom ad ────────────────────────────────────────────────────── */
.bottom-ad-wrap {
  background: #fff;
  border-top: 1px solid var(--border-light);
  padding: 12px 20px;
  display: flex;
  justify-content: center;
}

/* ── Animations ───────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.spin { animation: spin 0.8s linear infinite; }

/* ── Spinner ──────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .tool-panel-wrapper.visible {
    flex-direction: column;
  }
  .tool-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ad-slot-skyscraper { display: none; }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .preview-grid { grid-template-columns: 1fr; }
  .color-inputs-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .footer-col:nth-child(n+3) { display: none; }
  .main-content { padding: 20px 14px; }
  .tool-panel-body { padding: 16px; }
}

/* ── Search Filter ────────────────────────────────────────────────── */
.category-block.hidden { display: none; }
.tool-card.hidden { display: none; }

/* ── Tooltip ──────────────────────────────────────────────────────── */
[data-tip] {
  position: relative;
}
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}
