/* ===== FILEFLUX GLOBAL STYLES ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* PRIMARY = GREEN throughout */
  --red: #1f7a3e;
  --red-dark: #165c2e;
  --red-light: #e8f5ee;
  /* keep other accent colours */
  --blue-light: #E6F1FB;
  --blue: #185FA5;
  --green-light: #EAF3DE;
  --green: #3B6D11;
  --amber-light: #FAEEDA;
  --amber: #854F0B;
  --teal-light: #E1F5EE;
  --teal: #0F6E56;
  --purple-light: #EEEDFE;
  --purple: #534AB7;
  --bg: #f5f5f3;
  --surface: #ffffff;
  --border: rgba(0,0,0,0.1);
  --border-md: rgba(0,0,0,0.18);
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --text-faint: #9b9b9b;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
}

body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select { font-family: inherit; }

/* ===== NAVBAR ===== */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  height: 60px;
  display: flex; align-items: center;
  padding: 0 32px;
}
.navbar-inner { max-width: 1400px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; color: var(--text); flex-shrink: 0; margin-right: 2rem; }
.logo img { height: 22px; width: auto; display: block; }
.logo-mark { width: 30px; height: 30px; background: var(--red); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.logo-mark svg { width: 16px; height: 16px; fill: #fff; }
.nav-links { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-muted); padding: 8px 13px; border-radius: 8px; transition: background 0.15s, color 0.15s; white-space: nowrap; }
.nav-links a:hover { background: var(--bg); color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; padding-left: 16px; border-left: 1px solid var(--border); }
.nav-usage { font-size: 12px; color: var(--text-muted); background: var(--bg); padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border); white-space: nowrap; }
.nav-usage:empty { display: none; }
.nav-usage span { font-weight: 600; color: var(--red); }
.nav-signin-link { font-size: 14px; font-weight: 500; color: var(--text-muted); padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.nav-signin-link:hover { background: var(--bg); color: var(--text); }

/* Tools dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--text-muted); padding: 7px 12px; border-radius: 8px; cursor: pointer; transition: background 0.15s, color 0.15s; }
.nav-dropdown-trigger:hover, .nav-dropdown.open .nav-dropdown-trigger { background: var(--bg); color: var(--text); }
.nav-dropdown-trigger svg { transition: transform 0.15s; }
.nav-dropdown.open .nav-dropdown-trigger svg { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.1); padding: 6px; min-width: 180px;
  display: none; flex-direction: column; gap: 2px; z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a { font-size: 14px; padding: 9px 12px; border-radius: 8px; color: var(--text); white-space: nowrap; }
.nav-dropdown-menu a:hover { background: var(--bg); }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; border: none; transition: all 0.15s; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-md); }
.btn-outline:hover { background: var(--bg); }
.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 10px; }
.btn-xl { padding: 14px 36px; font-size: 16px; border-radius: 11px; }

/* ===== ADS ===== */
.ad-banner {
  background: var(--surface);
  border: 1px dashed var(--border-md);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.ad-leaderboard { width: 100%; height: 90px; }
.ad-rectangle { width: 300px; height: 250px; }
.ad-sidebar { width: 160px; height: 600px; }

/* ===== HERO ===== */
.hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 2rem 1.5rem 1.5rem; text-align: center; }
.hero h1 { font-size: 38px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; margin-bottom: 10px; }
.hero h1 span { color: var(--red); }
.hero p { font-size: 17px; color: var(--text-muted); max-width: 500px; margin: 0 auto 2rem; }

/* ===== TOOLS GRID ===== */
.tools-section { max-width: 1100px; margin: 0 auto; padding: 2.5rem 1.5rem; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 1rem; display: flex; align-items: center; gap: 8px; }
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; margin-bottom: 2rem; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.1rem 1rem;
  cursor: pointer; transition: all 0.15s;
  display: flex; flex-direction: column; gap: 10px;
  text-decoration: none; color: var(--text);
}
.tool-card:hover { border-color: var(--red); box-shadow: 0 0 0 3px rgba(31,122,62,0.1); transform: translateY(-1px); }
.tool-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.tool-icon svg { width: 20px; height: 20px; }
.icon-red { background: var(--red-light); color: var(--red); }
.icon-blue { background: var(--blue-light); color: var(--blue); }
.icon-green { background: var(--green-light); color: var(--green); }
.icon-amber { background: var(--amber-light); color: var(--amber); }
.icon-teal { background: var(--teal-light); color: var(--teal); }
.icon-purple { background: var(--purple-light); color: var(--purple); }
.tool-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.tool-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ===== TOOL PAGE ===== */
.tool-page { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.tool-layout { max-width: 1000px; margin: 0 auto; padding: 2rem 1.5rem; display: grid; grid-template-columns: 1fr 190px; gap: 2rem; align-items: start; }
.tool-page-header { margin-bottom: 2rem; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 0.75rem; }
.breadcrumb a { color: var(--red); }
.tool-page-header h1 { font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.tool-page-header p { color: var(--text-muted); }

/* ===== UPLOAD ZONE ===== */
.upload-zone {
  background: var(--surface); border: 2px dashed var(--border-md);
  border-radius: var(--radius-lg); padding: 3.5rem 2rem;
  text-align: center; cursor: pointer; transition: all 0.2s;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--red); background: #f0faf4; }
.upload-zone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-icon { width: 56px; height: 56px; background: var(--red-light); border-radius: 14px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.upload-icon svg { width: 28px; height: 28px; color: var(--red); }
.upload-zone h3 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.upload-zone p { color: var(--text-muted); font-size: 14px; }
.upload-zone .formats { font-size: 12px; color: var(--text-faint); margin-top: 8px; }

/* ===== FILE LIST ===== */
.file-list { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
}
.file-item-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--red-light); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-item-info { flex: 1; min-width: 0; }
.file-item-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-size { font-size: 12px; color: var(--text-muted); }
.file-item-status { font-size: 12px; font-weight: 500; }
.status-ready { color: var(--text-muted); }
.status-processing { color: #185FA5; }
.status-done { color: #3B6D11; }
.status-error { color: var(--red); }
.file-item-remove { background: none; border: none; color: var(--text-faint); font-size: 18px; padding: 4px; line-height: 1; }
.file-item-remove:hover { color: var(--red); }

/* ===== OPTIONS PANEL ===== */
.options-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  margin-top: 1.5rem;
}
.options-panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 1rem; }
.option-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.option-row:last-child { border-bottom: none; padding-bottom: 0; }
.option-label { font-size: 14px; color: var(--text-muted); }
.option-control select, .option-control input[type=range] { border: 1px solid var(--border-md); border-radius: 6px; padding: 5px 8px; font-size: 13px; background: var(--surface); }

/* ===== PROGRESS ===== */
.progress-bar-wrap { background: var(--bg); border-radius: 100px; height: 6px; overflow: hidden; margin-top: 8px; }
.progress-bar { height: 100%; background: var(--red); border-radius: 100px; transition: width 0.3s; }

/* ===== CONVERT ACTIONS ===== */
.convert-actions { margin-top: 1.5rem; display: flex; gap: 10px; flex-wrap: wrap; }
.btn-convert { background: var(--red); color: #fff; font-size: 15px; font-weight: 600; padding: 13px 32px; border-radius: 10px; border: none; transition: all 0.15s; }
.btn-convert:hover { background: var(--red-dark); }
.btn-convert:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-download { background: #3B6D11; color: #fff; font-size: 15px; font-weight: 600; padding: 13px 32px; border-radius: 10px; border: none; transition: all 0.15s; display: none; }
.btn-download:hover { background: #2a5009; }

/* ===== LIMIT WALL ===== */
.limit-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem;
}
.limit-modal {
  background: var(--surface); border-radius: 20px;
  padding: 2.5rem 2rem; max-width: 420px; width: 100%;
  text-align: center; box-shadow: var(--shadow-md);
}
.limit-modal .emoji { font-size: 48px; margin-bottom: 1rem; }
.limit-modal h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.limit-modal p { color: var(--text-muted); margin-bottom: 1.5rem; font-size: 14px; }
.plan-card {
  background: var(--bg); border: 2px solid var(--red);
  border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1rem;
}
.plan-card .price { font-size: 32px; font-weight: 800; color: var(--red); }
.plan-card .price span { font-size: 16px; font-weight: 400; color: var(--text-muted); }
.plan-card .plan-name { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 4px; }
.plan-features { list-style: none; text-align: left; margin: 1rem 0; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.plan-features li::before { content: '✓ '; color: #3B6D11; font-weight: 700; }
.limit-modal .dismiss { font-size: 13px; color: var(--text-faint); margin-top: 1rem; cursor: pointer; }
.limit-modal .dismiss:hover { color: var(--text-muted); }

/* ===== SUBSCRIPTION PAGE ===== */
.pricing-page { max-width: 900px; margin: 0 auto; padding: 3rem 1.5rem; text-align: center; }
.pricing-page h1 { font-size: 36px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.02em; }
.pricing-page > p { color: var(--text-muted); font-size: 17px; margin-bottom: 3rem; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 640px; margin: 0 auto 3rem; }
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 2rem; text-align: left; }
.pricing-card.featured { border-color: var(--red); border-width: 2px; position: relative; }
.pricing-card.featured::before { content: 'Most Popular'; position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 14px; border-radius: 100px; }
.plan-tier { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 6px; }
.plan-price { font-size: 40px; font-weight: 800; margin: 8px 0; letter-spacing: -0.02em; }
.plan-price sub { font-size: 16px; font-weight: 400; color: var(--text-muted); }
.plan-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; }
.plan-feat-list { list-style: none; font-size: 14px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.5rem; }
.plan-feat-list li { display: flex; gap: 8px; }
.plan-feat-list li .check { color: #3B6D11; font-weight: 700; flex-shrink: 0; }
.plan-feat-list li .cross { color: var(--text-faint); flex-shrink: 0; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: #1a1a1a; color: #fff;
  padding: 12px 20px; border-radius: 10px;
  font-size: 14px; font-weight: 500;
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s; z-index: 2000;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: #3B6D11; }
.toast.error { background: #c0392b; }

/* ===== FOOTER ===== */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 1.5rem; margin-top: 3rem; }
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-inner p { font-size: 13px; color: var(--text-muted); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  .hero h1 { font-size: 28px; }
  .nav-links { display: none; }
  .nav-usage { display: none; }
  .nav-signin-link { display: none; }
  #lang-switcher-container { display: none; }
  .navbar-inner { gap: 0.5rem; }
  .nav-right { border-left: none; padding-left: 0; gap: 6px; }
  .navbar { padding: 0 10px; }
  .hamburger-btn { display: flex !important; }
  #nav-getpro-btn { display: none !important; }
  .nav-user-name { max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-layout > div:last-child { display: none; }
  .pricing-grid { grid-template-columns: 1fr; }
  .convert-actions { flex-direction: column; }
  .btn-convert, .btn-download { width: 100%; justify-content: center; }
}

/* ===== Hamburger button ===== */
.hamburger-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 34px; height: 34px;
  background: transparent; border: none; outline: none;
  color: var(--text); cursor: pointer; border-radius: 8px;
  flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:hover { background: var(--bg); }

/* ===== Mobile dropdown menu ===== */
.mobile-menu {
  display: none;
  flex-direction: column;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 8px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  box-shadow: 0 12px 28px rgba(0,0,0,0.15);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
  z-index: 99;
}
.mobile-menu.open { display: flex; }
.mobile-menu-link {
  font-size: 15px; font-weight: 500; color: var(--text);
  padding: 12px; border-radius: 10px;
  display: block; text-decoration: none;
}
.mobile-menu-link:active { background: var(--bg); }
.mobile-menu-divider { height: 1px; background: var(--border); margin: 6px 8px; }
.mobile-menu-cta {
  background: var(--red); color: #fff !important;
  text-align: center; font-weight: 700; font-size: 14px;
  padding: 13px; border-radius: 10px; margin: 6px 4px 4px;
  text-decoration: none; display: block;
}
.mobile-menu-lang { padding: 6px 8px 2px; }
.mobile-menu-lang .lang-btn { width: 100%; justify-content: center; padding: 10px; }
.mobile-menu-lang .lang-dropdown { left: 0; right: 0; width: 100%; min-width: 0; }
@media (min-width: 701px) {
  .mobile-menu { display: none !important; }
  .hamburger-btn { display: none !important; }
}

/* ===== Language Switcher ===== */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
  font-weight: 500; cursor: pointer; color: var(--text);
}
.lang-btn:hover { background: var(--surface); }
.lang-code { font-weight: 600; }
.lang-arrow { font-size: 10px; opacity: 0.6; }
.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 160px; z-index: 200; overflow: hidden;
  padding: 6px;
}
.lang-option {
  padding: 8px 12px; font-size: 13px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
}
.lang-option:hover { background: var(--surface); }
.lang-option.active { background: var(--green-light); color: var(--green); font-weight: 600; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
[dir="rtl"] .navbar-inner { direction: rtl; }
[dir="rtl"] .nav-links { direction: rtl; }

/* ===== PWA Install Banner ===== */
#pwa-install-banner {
  position: fixed; bottom: -100px; left: 16px; right: 16px;
  max-width: 420px; margin: 0 auto; z-index: 999;
  background: #fff; border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18); border: 1px solid #ebebeb;
  transition: bottom 0.35s ease;
}
#pwa-install-banner.show { bottom: 16px; }
.pwa-banner-inner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.pwa-banner-icon { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pwa-banner-text strong { font-size: 14px; color: #1a1a1a; }
.pwa-banner-text span { font-size: 12px; color: #888; }
.pwa-banner-install {
  background: #1f7a3e; color: #fff; border: none; padding: 8px 16px;
  border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pwa-banner-install:hover { background: #165c2e; }
.pwa-banner-close {
  background: none; border: none; color: #aaa; font-size: 16px;
  cursor: pointer; padding: 4px 6px; flex-shrink: 0;
}
@media (max-width: 480px) {
  .pwa-banner-text span { display: none; }
}

/* ===== Ad Slots ===== */
.ad-slot { min-height: 0; }
.ad-slot ins.adsbygoogle:empty { display: none !important; }
.ad-slot:has(ins.adsbygoogle:empty) { padding: 0 !important; margin: 0 !important; }
