/* ============================================
   UTILITY HUB - Main Stylesheet
   Modern, responsive, monetization-ready
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --dark-lighter: #334155;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* ---- Layout ---- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 900px; margin: 0 auto; padding: 0 24px; }

/* ---- Header ---- */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 800;
  color: var(--primary);
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.1rem;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav-link {
  padding: 8px 14px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; color: var(--gray-600);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  background: var(--gray-100); color: var(--primary);
}
.nav-cta {
  padding: 8px 18px; margin-left: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.85rem;
  transition: var(--transition);
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 50%, var(--gray-800) 100%);
  color: white; padding: 80px 0 100px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%236366f1' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: 3rem; font-weight: 800; line-height: 1.1;
  margin-bottom: 16px;
  background: linear-gradient(135deg, white, var(--primary-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { font-size: 1.15rem; color: var(--gray-400); max-width: 560px; margin: 0 auto 32px; }
.hero-search {
  max-width: 520px; margin: 0 auto;
  display: flex; gap: 0;
  background: var(--dark-lighter); border: 1px solid var(--gray-600);
  border-radius: var(--radius-xl); padding: 6px;
}
.hero-search input {
  flex: 1; padding: 12px 20px;
  background: transparent; border: none; color: white; outline: none;
}
.hero-search input::placeholder { color: var(--gray-500); }
.hero-search-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border-radius: var(--radius-lg);
  font-weight: 600; white-space: nowrap;
  transition: var(--transition);
}
.hero-search-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ---- Section Headers ---- */
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.section-header p { color: var(--gray-500); font-size: 1.05rem; }

/* ---- Tool Cards Grid ---- */
.tools-section { padding: 64px 0; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.tool-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 28px; border: 1px solid var(--gray-200);
  transition: var(--transition); position: relative; overflow: hidden;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0); transition: var(--transition);
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: var(--primary-light); }
.tool-card:hover::before { transform: scaleX(1); }
.tool-icon {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.tool-icon.purple { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white; }
.tool-icon.cyan { background: linear-gradient(135deg, #06b6d4, #22d3ee); color: white; }
.tool-icon.green { background: linear-gradient(135deg, #10b981, #34d399); color: white; }
.tool-icon.amber { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: white; }
.tool-icon.rose { background: linear-gradient(135deg, #f43f5e, #fb7185); color: white; }
.tool-icon.blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); color: white; }
.tool-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.tool-card p { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 16px; line-height: 1.5; }
.tool-card-footer { display: flex; align-items: center; justify-content: space-between; }
.tool-tag {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: 20px; background: var(--gray-100); color: var(--gray-500);
}
.tool-tag.popular { background: #fef3c7; color: #d97706; }
.tool-tag.new { background: #d1fae5; color: #059669; }
.tool-arrow { color: var(--primary); font-size: 1.1rem; transition: var(--transition); }
.tool-card:hover .tool-arrow { transform: translateX(4px); }

/* ---- Ad Zones ---- */
.ad-zone {
  background: var(--white); border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg); padding: 40px;
  text-align: center; margin: 32px 0;
}
.ad-zone-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--gray-400); margin-bottom: 8px;
}
.ad-zone-placeholder {
  background: var(--gray-100); border-radius: var(--radius-sm);
  padding: 24px; color: var(--gray-400); font-size: 0.9rem;
}
.ad-zone-sidebar {
  min-height: 600px; padding: 20px 12px;
}

/* ---- Premium Banner ---- */
.premium-banner {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  border-radius: var(--radius-xl); padding: 48px; color: white;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  margin: 48px 0; position: relative; overflow: hidden;
}
.premium-banner::before {
  content: ''; position: absolute; top: -50%; right: -10%; width: 400px; height: 400px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  opacity: 0.3;
}
.premium-content { position: relative; z-index: 1; flex: 1; }
.premium-banner h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.premium-banner p { color: var(--gray-400); margin-bottom: 20px; }
.premium-features { display: flex; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.premium-feature { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.premium-feature .check { color: var(--success); font-weight: bold; }
.premium-btn {
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white; border-radius: var(--radius-md);
  font-weight: 700; font-size: 1rem;
  transition: var(--transition); display: inline-block;
}
.premium-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.premium-price { text-align: center; position: relative; z-index: 1; }
.premium-price .amount { font-size: 3rem; font-weight: 800; }
.premium-price .period { color: var(--gray-400); font-size: 0.9rem; }

/* ---- Newsletter ---- */
.newsletter {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-xl); padding: 48px; color: white;
  text-align: center; margin: 48px 0;
}
.newsletter h3 { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.newsletter p { opacity: 0.9; margin-bottom: 24px; max-width: 480px; margin-left: auto; margin-right: auto; }
.newsletter-form {
  display: flex; gap: 12px; max-width: 440px; margin: 0 auto;
}
.newsletter-form input {
  flex: 1; padding: 12px 20px; border-radius: var(--radius-md);
  border: none; outline: none; font-size: 0.95rem;
}
.newsletter-form button {
  padding: 12px 28px; background: var(--dark); color: white;
  border-radius: var(--radius-md); font-weight: 600;
  transition: var(--transition);
}
.newsletter-form button:hover { background: var(--dark-light); }

/* ---- Tool Pages Layout ---- */
.tool-page { padding: 40px 0; }
.tool-page-header { margin-bottom: 32px; }
.tool-page-header h1 { font-size: 1.8rem; font-weight: 700; color: var(--gray-900); margin-bottom: 6px; }
.tool-page-header p { color: var(--gray-500); }

/* ---- Cards & Panels ---- */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 16px; }

/* ---- Form Elements ---- */
.input, .textarea, .select {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--gray-300); border-radius: var(--radius-md);
  background: var(--white); color: var(--gray-800);
  outline: none; transition: var(--transition);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.textarea { min-height: 160px; resize: vertical; }
.btn {
  padding: 12px 24px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.95rem;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: white; }
.btn-danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: white; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; }

/* ---- Dropzone ---- */
.dropzone {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-lg);
  padding: 48px 24px; text-align: center;
  transition: var(--transition); cursor: pointer;
  background: var(--gray-50);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary); background: rgba(99,102,241,0.03);
}
.dropzone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.dropzone-text { color: var(--gray-600); font-weight: 500; }
.dropzone-hint { color: var(--gray-400); font-size: 0.85rem; margin-top: 4px; }

/* ---- Range Slider ---- */
.range-wrap { margin: 16px 0; }
.range-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--gray-500); margin-bottom: 8px; }
input[type="range"] {
  width: 100%; -webkit-appearance: none; height: 6px;
  border-radius: 3px; background: var(--gray-200); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: var(--primary); cursor: pointer;
  box-shadow: var(--shadow-sm); border: 3px solid white;
}

/* ---- Result Box ---- */
.result-box {
  background: var(--gray-900); color: #e2e8f0;
  border-radius: var(--radius-md); padding: 16px;
  font-family: 'Consolas', 'Monaco', monospace; font-size: 0.85rem;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
  min-height: 100px;
}

/* ---- Stats ---- */
.stats-bar {
  display: flex; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--gray-200);
  margin-bottom: 24px; flex-wrap: wrap;
}
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 1.3rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.8rem; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- Footer ---- */
.footer {
  background: var(--dark); color: var(--gray-400); padding: 48px 0 24px;
  margin-top: 64px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; margin-bottom: 32px;
}
.footer-brand .logo { margin-bottom: 12px; color: white; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }
.footer-col h4 { color: white; font-size: 0.9rem; font-weight: 600; margin-bottom: 16px; }
.footer-col a { display: block; padding: 6px 0; font-size: 0.9rem; transition: var(--transition); }
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom {
  border-top: 1px solid var(--gray-700); padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 0.85rem; }

/* ---- Toast ---- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 14px 20px; border-radius: var(--radius-md);
  color: white; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  max-width: 360px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; transform: translateX(100%); } }

/* ---- QR Canvas ---- */
#qrCanvas { display: block; margin: 0 auto; }

/* ---- Two Column Tool Layout ---- */
.tool-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--gray-200); margin-bottom: 24px; }
.tab {
  padding: 10px 20px; font-weight: 600; color: var(--gray-500);
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- Progress Bar ---- */
.progress-bar {
  width: 100%; height: 8px; background: var(--gray-200);
  border-radius: 4px; overflow: hidden; margin: 16px 0;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px; transition: width 0.3s ease;
}

/* ---- File List ---- */
.file-list { margin-top: 16px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--gray-50);
  border-radius: var(--radius-sm); margin-bottom: 8px;
}
.file-item-info { display: flex; align-items: center; gap: 10px; }
.file-item-name { font-weight: 500; font-size: 0.9rem; }
.file-item-size { color: var(--gray-400); font-size: 0.8rem; }
.file-item-remove { color: var(--danger); cursor: pointer; font-size: 1.1rem; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero-search { flex-direction: column; border-radius: var(--radius-lg); }
  .tools-grid { grid-template-columns: 1fr; }
  .premium-banner { flex-direction: column; text-align: center; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav { display: none; }
  .newsletter-form { flex-direction: column; }
}

/* ---- Animations ---- */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.pulse { animation: pulse 2s infinite; }
