/* =============================================
   ConverTaTudo — Main Stylesheet
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- Variables --- */
:root {
  --primary: #DC2626;
  --primary-dark: #991B1B;
  --primary-light: #FEE2E2;
  --accent: #FF4444;
  --bg: #FFFFFF;
  --bg-secondary: #F9FAFB;
  --bg-card: #FFFFFF;
  --text: #111827;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover: 0 6px 24px rgba(220,38,38,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --max-width: 1200px;
  --nav-height: 64px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, video { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

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

/* =============================================
   NAVIGATION
   ============================================= */
.nav {
  position: sticky; top: 0; z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.4rem; font-weight: 700; color: var(--primary);
}
.nav-logo svg { width: 32px; height: 32px; }
.nav-logo span { color: var(--text); }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500; color: var(--text-secondary);
  transition: var(--transition);
}
.nav-links a:hover { color: var(--primary); background: var(--primary-light); }

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown > a { display: flex; align-items: center; gap: 4px; }
.nav-dropdown > a::after {
  content: '▾'; font-size: 0.75rem; transition: var(--transition);
}
.nav-dropdown:hover > a::after { transform: rotate(180deg); }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); left: 0;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 200px; padding: 6px;
  z-index: 100;
}
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 0.875rem; color: var(--text);
  transition: var(--transition);
}
.dropdown-menu a:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-menu a .menu-icon { font-size: 1rem; width: 20px; text-align: center; }

/* Hamburger */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center;
  gap: 5px; width: 32px; height: 32px; cursor: pointer;
}
.nav-hamburger span {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: var(--transition);
}

.nav-mobile { display: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .nav-mobile {
    position: fixed; top: var(--nav-height); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 20px; z-index: 999;
    box-shadow: var(--shadow);
  }
  .nav-mobile a {
    display: block; padding: 10px 12px;
    border-radius: var(--radius-sm); font-size: 0.95rem; color: var(--text);
    transition: var(--transition);
  }
  .nav-mobile a:hover { background: var(--primary-light); color: var(--primary); }
  .nav-mobile .mobile-section-title {
    font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.05em;
    padding: 10px 12px 4px;
  }
}

/* =============================================
   HERO
   ============================================= */
.hero {
  background: linear-gradient(135deg, #fff 0%, #FEF2F2 50%, #fff 100%);
  padding: 64px 20px 48px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 999px; padding: 4px 14px;
  font-size: 0.8rem; font-weight: 600;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700; line-height: 1.2;
  margin-bottom: 16px; color: var(--text);
}
.hero h1 span { color: var(--primary); }
.hero p {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 560px; margin: 0 auto 32px;
}
.hero-stats {
  display: flex; justify-content: center; gap: 40px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat strong { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.hero-stat span { font-size: 0.8rem; color: var(--text-secondary); }

/* =============================================
   TOOLS GRID
   ============================================= */
.section { padding: 48px 20px; }
.section-title {
  font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; color: var(--text);
}
.section-subtitle { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 28px; }

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

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.tool-card-icon {
  width: 48px; height: 48px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  background: var(--primary-light); color: var(--primary);
}
.tool-card-title { font-size: 0.95rem; font-weight: 600; }
.tool-card-desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.tool-card-tag {
  font-size: 0.7rem; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--primary-light); color: var(--primary);
  margin-top: auto;
}

/* Category label */
.category-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.category-header .cat-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600;
  transition: var(--transition); cursor: pointer; border: none;
}
.btn-primary {
  background: var(--primary); color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-secondary); color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* =============================================
   DROPZONE
   ============================================= */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-secondary);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.dropzone-icon { font-size: 2.5rem; margin-bottom: 12px; }
.dropzone h3 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.dropzone p { font-size: 0.85rem; color: var(--text-secondary); }
.dropzone input[type="file"] { display: none; }
.dropzone .btn { margin-top: 16px; }

/* =============================================
   PROGRESS
   ============================================= */
.progress-wrap {
  background: var(--border); border-radius: 999px;
  height: 8px; overflow: hidden; margin: 12px 0;
}
.progress-bar {
  height: 100%; background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 0%;
}
.progress-label { font-size: 0.8rem; color: var(--text-secondary); text-align: center; margin-top: 6px; }

/* =============================================
   TOOL PAGE LAYOUT
   ============================================= */
.tool-page { padding: 40px 20px; }
.tool-header { margin-bottom: 32px; }
.tool-header-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; color: var(--text-secondary);
  margin-bottom: 16px; transition: var(--transition);
}
.tool-header-back:hover { color: var(--primary); }
.tool-header h1 { font-size: 1.8rem; font-weight: 700; margin-bottom: 6px; }
.tool-header p { color: var(--text-secondary); }

.tool-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) { .tool-layout { grid-template-columns: 1fr; } }

.tool-main { display: flex; flex-direction: column; gap: 20px; }
.tool-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Card box */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.card-title {
  font-size: 0.95rem; font-weight: 600; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* =============================================
   FORM CONTROLS
   ============================================= */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }
.form-select, .form-input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.875rem; color: var(--text); background: var(--bg);
  transition: var(--transition); outline: none;
}
.form-select:focus, .form-input:focus { border-color: var(--primary); }

.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-value {
  font-size: 0.85rem; font-weight: 600; color: var(--primary);
  min-width: 36px; text-align: center;
}

/* =============================================
   NOTIFICATIONS / TOAST
   ============================================= */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: var(--text); color: #fff;
  font-size: 0.875rem; font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}
.toast.success { background: #16A34A; }
.toast.error { background: var(--primary-dark); }
.toast.info { background: #2563EB; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: none; opacity: 1; } }

/* =============================================
   FILE LIST
   ============================================= */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.file-item-icon { font-size: 1.2rem; }
.file-item-name { flex: 1; font-size: 0.85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { font-size: 0.75rem; color: var(--text-secondary); white-space: nowrap; }
.file-item-remove {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 0.9rem;
  transition: var(--transition); cursor: pointer;
}
.file-item-remove:hover { background: var(--primary-light); color: var(--primary); }

/* =============================================
   IMAGE PREVIEW GRID
   ============================================= */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.preview-thumb {
  position: relative; aspect-ratio: 1;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 2px solid var(--border);
  cursor: grab;
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-thumb-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; cursor: pointer;
}
.preview-thumb-num {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(0,0,0,0.6); color: #fff;
  border-radius: 4px; padding: 1px 5px; font-size: 0.7rem;
}

/* =============================================
   ADS PLACEHOLDER
   ============================================= */
.ad-unit {
  background: var(--bg-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 0.75rem;
  overflow: hidden;
}
.ad-unit-banner { height: 90px; }
.ad-unit-square { height: 250px; }
.ad-unit-responsive { min-height: 100px; }

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--text); color: #fff;
  padding: 48px 20px 24px;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; max-width: var(--max-width);
  margin: 0 auto 32px;
}
.footer-brand-name { font-size: 1.2rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.footer-brand-desc { font-size: 0.85rem; color: #9CA3AF; line-height: 1.6; }
.footer-col h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 14px; color: #D1D5DB; }
.footer-col a {
  display: block; font-size: 0.85rem; color: #9CA3AF;
  margin-bottom: 8px; transition: var(--transition);
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid #374151;
  padding-top: 20px; text-align: center;
  font-size: 0.8rem; color: #6B7280;
  max-width: var(--max-width); margin: 0 auto;
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero { padding: 40px 20px 32px; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* =============================================
   UTILITY
   ============================================= */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* Result area */
.result-area {
  border: 1px solid #BBF7D0; background: #F0FDF4;
  border-radius: var(--radius); padding: 20px;
  text-align: center;
}
.result-area h3 { color: #16A34A; font-size: 1rem; margin-bottom: 8px; }
.result-area p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 16px; }
