/*
Theme Name: Babiato Tools
Theme URI: https://babiato.pro
Author: Babiato
Author URI: https://babiato.pro
Description: Modern SaaS Tool Hub Theme for babiato.pro
Version: 1.0.0
License: GPL v2 or later
Text Domain: babiato-tools
Tags: tools, utility, saas, dark-mode, responsive
*/

/* === DESIGN TOKENS === */
:root {
  --color-bg: #ffffff;
  --color-bg-secondary: #f8fafc;
  --color-bg-card: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-accent: #22c55e;
  --color-accent-hover: #16a34a;
  --color-accent-light: #dcfce7;
  --color-border: #e2e8f0;
  --color-shadow: rgba(0,0,0,0.06);
  --color-shadow-md: rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --transition: 0.2s ease;
  --max-width: 1280px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-bg-secondary: #1e293b;
  --color-bg-card: #1e293b;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-accent: #22c55e;
  --color-accent-hover: #4ade80;
  --color-accent-light: rgba(34,197,94,0.15);
  --color-border: #334155;
  --color-shadow: rgba(0,0,0,0.3);
  --color-shadow-md: rgba(0,0,0,0.4);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
}

a { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent-hover); }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* === TYPOGRAPHY === */
h1,h2,h3,h4,h5,h6 { line-height: 1.3; font-weight: 700; color: var(--color-text); }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
p { color: var(--color-text-muted); }

/* === LAYOUT === */
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-header p { font-size: 1.125rem; margin-top: 0.75rem; }

/* === HEADER === */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  height: var(--header-height);
  transition: background var(--transition);
}

[data-theme="dark"] .site-header {
  background: rgba(15,23,42,0.85);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height); gap: 2rem;
}

.site-logo { display: flex; align-items: center; gap: 0.5rem; }
.site-logo img { height: 36px; width: auto; }
.site-logo span { font-size: 1.25rem; font-weight: 800; color: var(--color-text); }
.site-logo span em { color: var(--color-accent); font-style: normal; }

.main-nav ul { display: flex; align-items: center; gap: 0.5rem; }
.main-nav a {
  padding: 0.4rem 0.875rem; border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-weight: 500; font-size: 0.9375rem;
  transition: all var(--transition);
}
.main-nav a:hover, .main-nav a.active { background: var(--color-accent-light); color: var(--color-accent); }

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

.btn-dark-toggle {
  background: none; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); padding: 0.4rem; cursor: pointer;
  color: var(--color-text-muted); transition: all var(--transition);
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px;
}
.btn-dark-toggle:hover { border-color: var(--color-accent); color: var(--color-accent); }

.btn-mobile-menu {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--color-text); padding: 0.25rem;
}

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.5rem; border-radius: var(--radius-md); font-weight: 600;
  font-size: 0.9375rem; cursor: pointer; border: 2px solid transparent;
  transition: all var(--transition); text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: var(--color-accent); color: #fff; border-color: var(--color-accent);
}
.btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); color: #fff; }
.btn-outline {
  background: transparent; color: var(--color-text); border-color: var(--color-border);
}
.btn-outline:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn-ghost { background: transparent; color: var(--color-text-muted); border-color: transparent; }
.btn-ghost:hover { background: var(--color-bg-secondary); color: var(--color-text); }
.btn-lg { padding: 0.875rem 2rem; font-size: 1.0625rem; }
.btn-sm { padding: 0.375rem 1rem; font-size: 0.875rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* === CARDS === */
.card {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  box-shadow: 0 1px 3px var(--color-shadow);
  transition: all var(--transition);
}
.card:hover { box-shadow: 0 8px 24px var(--color-shadow-md); transform: translateY(-2px); }

/* === HERO SECTION === */
.hero {
  background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-bg-secondary) 100%);
  padding: 5rem 0 4rem; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(34,197,94,0.12), transparent);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--color-accent-light); color: var(--color-accent);
  border-radius: 99px; padding: 0.375rem 1rem; font-size: 0.875rem; font-weight: 600;
  margin-bottom: 1.5rem;
}
.hero h1 { max-width: 800px; margin: 0 auto 1.25rem; }
.hero p { font-size: 1.1875rem; max-width: 580px; margin: 0 auto 2.5rem; }

/* === SEARCH BAR === */
.search-wrapper {
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; gap: 0; position: relative;
}
.search-wrapper input {
  flex: 1; padding: 1rem 1.25rem; font-size: 1rem; border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  border: 2px solid var(--color-border); border-right: none;
  background: var(--color-bg-card); color: var(--color-text);
  outline: none; transition: border-color var(--transition);
}
.search-wrapper input:focus { border-color: var(--color-accent); }
.search-wrapper input::placeholder { color: var(--color-text-muted); }
.search-wrapper button {
  padding: 1rem 1.75rem; background: var(--color-accent); color: #fff;
  border: none; border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  cursor: pointer; font-weight: 600; font-size: 1rem; transition: background var(--transition);
}
.search-wrapper button:hover { background: var(--color-accent-hover); }
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); box-shadow: 0 16px 40px var(--color-shadow-md);
  display: none; z-index: 100; max-height: 400px; overflow-y: auto;
}
.search-results.active { display: block; }
.search-result-item {
  display: flex; align-items: center; gap: 1rem; padding: 0.875rem 1.25rem;
  cursor: pointer; transition: background var(--transition); border-bottom: 1px solid var(--color-border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--color-bg-secondary); }
.search-result-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.125rem; }
.search-result-info strong { display: block; font-size: 0.9375rem; color: var(--color-text); }
.search-result-info span { font-size: 0.8125rem; color: var(--color-text-muted); }

/* === TOOLS GRID === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.25rem;
  transition: all var(--transition); cursor: pointer; text-decoration: none;
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem;
}
.tool-card:hover {
  border-color: var(--color-accent); box-shadow: 0 8px 24px var(--color-shadow-md);
  transform: translateY(-2px);
}
.tool-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; background: var(--color-accent-light);
}
.tool-card h3 { font-size: 0.9375rem; font-weight: 600; color: var(--color-text); }
.tool-card p { font-size: 0.8125rem; color: var(--color-text-muted); line-height: 1.4; }
.tool-badge {
  font-size: 0.6875rem; padding: 0.2rem 0.5rem; border-radius: 99px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.tool-badge-new { background: #dbeafe; color: #1d4ed8; }
.tool-badge-hot { background: #fee2e2; color: #dc2626; }
.tool-badge-ai { background: #ede9fe; color: #7c3aed; }

/* === CATEGORY CARDS === */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.category-card {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: 1.5rem; text-align: center;
  transition: all var(--transition); cursor: pointer; text-decoration: none; display: block;
}
.category-card:hover { border-color: var(--color-accent); box-shadow: 0 8px 24px var(--color-shadow-md); transform: translateY(-2px); }
.category-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.category-card h3 { font-size: 1rem; font-weight: 600; color: var(--color-text); margin-bottom: 0.25rem; }
.category-card p { font-size: 0.8125rem; color: var(--color-text-muted); }

/* === TOOL PAGE === */
.tool-page { padding: 2rem 0 4rem; }
.tool-header { margin-bottom: 2rem; }
.tool-header h1 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
.tool-header p { font-size: 1rem; margin-top: 0.5rem; }

.tool-workspace {
  background: var(--color-bg-card); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: 2rem;
  box-shadow: 0 4px 16px var(--color-shadow);
}

/* === UPLOAD ZONE === */
.upload-zone {
  border: 2px dashed var(--color-border); border-radius: var(--radius-lg);
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--color-bg-secondary);
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--color-accent); background: var(--color-accent-light);
}
.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.upload-icon { font-size: 3rem; margin-bottom: 1rem; color: var(--color-text-muted); }
.upload-zone h3 { font-size: 1.0625rem; font-weight: 600; margin-bottom: 0.5rem; }
.upload-zone p { font-size: 0.875rem; }
.upload-zone .btn { position: relative; z-index: 1; pointer-events: none; margin-top: 1rem; }

/* === PROGRESS === */
.progress-wrapper { margin: 1.5rem 0; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; color: var(--color-text); }
.progress-bar-track { height: 8px; background: var(--color-border); border-radius: 99px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--color-accent); border-radius: 99px; width: 0%; transition: width 0.3s ease; }

/* === PROCESSING SPINNER === */
.processing-state { text-align: center; padding: 3rem; }
.spinner {
  width: 52px; height: 52px; border: 4px solid var(--color-border);
  border-top-color: var(--color-accent); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === SUCCESS STATE === */
.success-state { text-align: center; padding: 2rem; }
.success-icon { font-size: 3rem; color: var(--color-accent); margin-bottom: 1rem; }
.success-state h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.download-btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  margin-top: 1.5rem; padding: 0.875rem 2rem;
  background: var(--color-accent); color: #fff; border-radius: var(--radius-md);
  font-weight: 600; font-size: 1rem; transition: all var(--transition);
}
.download-btn:hover { background: var(--color-accent-hover); color: #fff; }

/* === ERROR STATE === */
.error-state { background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-md); padding: 1.25rem; margin: 1rem 0; }
[data-theme="dark"] .error-state { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.3); }
.error-state p { color: #dc2626; font-size: 0.9375rem; margin: 0; }

/* === FILE LIST === */
.file-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.file-item {
  display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1rem;
  background: var(--color-bg-secondary); border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.file-item-icon { color: var(--color-accent); font-size: 1.25rem; }
.file-item-info { flex: 1; }
.file-item-name { font-size: 0.9375rem; font-weight: 500; color: var(--color-text); }
.file-item-size { font-size: 0.8125rem; color: var(--color-text-muted); }
.file-item-remove { background: none; border: none; cursor: pointer; color: var(--color-text-muted); padding: 0.25rem; transition: color var(--transition); }
.file-item-remove:hover { color: #dc2626; }

/* === TOOL OPTIONS === */
.tool-options { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1.5rem 0; }
.option-group { display: flex; flex-direction: column; gap: 0.375rem; flex: 1; min-width: 180px; }
.option-group label { font-size: 0.875rem; font-weight: 500; color: var(--color-text); }
.option-group select, .option-group input[type="range"], .option-group input[type="number"] {
  padding: 0.5rem 0.875rem; border-radius: var(--radius-sm);
  border: 1px solid var(--color-border); background: var(--color-bg);
  color: var(--color-text); font-size: 0.9375rem; outline: none;
  transition: border-color var(--transition);
}
.option-group select:focus, .option-group input:focus { border-color: var(--color-accent); }

/* === ADSENSE SLOTS === */
.ad-slot {
  min-height: 90px; background: var(--color-bg-secondary);
  border: 1px dashed var(--color-border); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted); font-size: 0.8125rem;
}
.ad-slot-top { margin-bottom: 2rem; }
.ad-slot-bottom { margin-top: 2rem; }
.ad-slot-mid { margin: 2rem 0; }

/* === FAQ SECTION === */
.faq-section { padding: 3rem 0; }
.faq-list { max-width: 720px; }
.faq-item { border-bottom: 1px solid var(--color-border); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 0; cursor: pointer; font-weight: 600; font-size: 1rem; color: var(--color-text);
  gap: 1rem; background: none; border: none; width: 100%; text-align: left;
}
.faq-chevron { color: var(--color-text-muted); transition: transform var(--transition); font-size: 1.25rem; flex-shrink: 0; }
.faq-item.active .faq-chevron { transform: rotate(180deg); }
.faq-answer { padding: 0 0 1.25rem; font-size: 0.9375rem; line-height: 1.7; color: var(--color-text-muted); display: none; }
.faq-item.active .faq-answer { display: block; }

/* === RELATED TOOLS === */
.related-tools { padding: 2rem 0; }
.related-tools h2 { margin-bottom: 1.25rem; font-size: 1.25rem; }

/* === BREADCRUMB === */
.breadcrumb { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb-sep { color: var(--color-border); }

/* === STATS BAR === */
.stats-bar {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 2.5rem; padding: 2.5rem 0; border-top: 1px solid var(--color-border); margin-top: 3rem;
}
.stat-item { text-align: center; }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--color-accent); display: block; }
.stat-label { font-size: 0.875rem; color: var(--color-text-muted); }

/* === FOOTER === */
.site-footer { background: var(--color-bg-secondary); border-top: 1px solid var(--color-border); padding: 4rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { font-size: 0.9375rem; margin-top: 0.75rem; max-width: 280px; }
.footer-col h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 1rem; color: var(--color-text); }
.footer-col ul li a { color: var(--color-text-muted); font-size: 0.9375rem; transition: color var(--transition); display: block; padding: 0.2rem 0; }
.footer-col ul li a:hover { color: var(--color-accent); }
.footer-bottom { border-top: 1px solid var(--color-border); padding-top: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-bottom p { font-size: 0.875rem; color: var(--color-text-muted); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.open { display: flex; position: absolute; top: var(--header-height); left: 0; right: 0; background: var(--color-bg-card); border-bottom: 1px solid var(--color-border); padding: 1rem; }
  .main-nav.open ul { flex-direction: column; width: 100%; }
  .btn-mobile-menu { display: flex; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .stats-bar { gap: 1.5rem; }
  .tool-workspace { padding: 1.25rem; }
  .section { padding: 3rem 0; }
}
@media (max-width: 480px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}

/* === UTILITY CLASSES === */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

#page-wrapper { min-height: 60vh; }
main { padding-bottom: 4rem; }
