/* ==========================================================================
   ImageResizerAI - Master SaaS CSS System v4.0
   ========================================================================== */

:root {
  /* Legacy Color Compatibility */
  --navy: #0f172a;
  --blue: #2563eb;
  --blue-h: #1d4ed8;
  --blue-l: #eff6ff;
  --green: #10b981;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #475569;
  --muted2: #94a3b8;
  --font: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
  --r: 16px;
  --rs: 10px;

  /* Modern SaaS Design Tokens */
  --primary-blue: #2563eb;
  --primary-violet: #7c3aed;
  --primary-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --primary-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
  --accent-glow: rgba(37, 99, 235, 0.25);

  --bg-slate-900: #0f172a;
  --bg-slate-800: #1e293b;
  --bg-slate-50: #f8fafc;
  --bg-card-hover: #f1f5f9;

  --shadow-saas-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
  --shadow-saas-md: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
  --shadow-saas-lg: 0 20px 45px -10px rgba(15, 23, 42, 0.12);
  --shadow-cta-glow: 0 8px 24px -4px rgba(37, 99, 235, 0.35);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ==========================================================================
   1. ACCESSIBILITY & GLOBAL RESET
   ========================================================================== */
*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

html, body { 
  font-size: 16px; 
  scroll-behavior: smooth; 
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; 
}

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

/* Accessibility Focus Ring */
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.site-header, .site-footer, .hero {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  left: 0;
  right: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color 0.2s ease, opacity 0.2s ease; }
a:hover { color: var(--blue-h); }
.container { max-width: 1140px; width: 100%; margin: 0 auto; padding: 0 24px; }

/* Gradient Typography Highlight */
.text-gradient {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline;
}

/* Layout Stability Helpers (Protect CLS) */
.hero, .converter-tool-card, .tools-grid, .features-grid {
  contain: layout style;
}

/* ==========================================================================
   2. STICKY SAAS HEADER & NAVBAR
   ========================================================================== */
.site-header { 
  background: #0f172a; /* Solid fallback */
  padding: 10px 0; 
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); 
  position: sticky; 
  top: 0; 
  z-index: 1000; 
  width: 100%; 
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .site-header {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: 20px; 
  height: 64px;
}

/* Logo Treatment */
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none !important; flex-shrink: 0; }
.logo-box { width: 38px; height: 38px; background: #ffffff; border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.logo-box span { border-radius: 3px; }
.logo-box .b1, .logo-box .b2, .logo-box .b3 { background: var(--blue); }
.logo-box .b4 { background: #8b5cf6; }
.logo-text { font-size: 1.15rem; font-weight: 800; color: #ffffff; letter-spacing: -0.01em; white-space: nowrap; }

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}

/* Desktop Navigation & Usability Hover Bridge */
.header-nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.nav-item { position: relative; list-style: none; }
.nav-item.has-dropdown {
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.nav-link { 
  color: rgba(255, 255, 255, 0.85); text-decoration: none !important; 
  font-size: 0.92rem; font-weight: 700; padding: 9px 16px; 
  border-radius: 8px; transition: all 0.2s ease; white-space: nowrap; 
  background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-link:hover, .nav-link:focus-visible { color: #ffffff; background: rgba(255, 255, 255, 0.12); }
.nav-link.active { background: rgba(255, 255, 255, 0.18); color: #ffffff; }

/* Desktop Dropdowns & Hit Bridge */
.dropdown-menu, .submenu {
  display: none; position: absolute; top: 100%; left: 0;
  background: #ffffff; min-width: 240px; box-shadow: var(--shadow-saas-lg);
  border-radius: var(--radius-md); padding: 10px; z-index: 1100; border: 1px solid var(--border);
  margin-top: 0;
  animation: saasDropdownFade 0.2s ease-out;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  width: 100%;
  height: 16px;
  background: transparent;
}

@keyframes saasDropdownFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu a, .submenu a {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: #1e293b !important;
  text-decoration: none !important; font-size: 14px; font-weight: 600; border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.dropdown-menu a:hover, .submenu a:hover { background: var(--blue-l); color: var(--blue) !important; transform: translateX(3px); }

.submenu-parent { position: relative; }
.submenu-parent::after {
  content: '';
  position: absolute;
  right: -14px;
  top: 0;
  width: 16px;
  height: 100%;
  background: transparent;
}

.dropdown-submenu {
  display: none; position: absolute; left: 100%; top: -6px; margin-left: 0;
  background-color: #ffffff; box-shadow: var(--shadow-saas-lg); min-width: 220px;
  border-radius: var(--radius-md); padding: 10px; border: 1px solid var(--border);
  z-index: 1200;
}

.dropdown-submenu::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 0;
  width: 16px;
  height: 100%;
  background: transparent;
}

@media (min-width: 992px) {
  .nav-item:hover > .dropdown-menu,
  .nav-item:focus-within > .dropdown-menu,
  .dropdown-menu:hover {
    display: block !important;
  }

  .submenu-parent:hover > .dropdown-submenu,
  .submenu-parent:focus-within > .dropdown-submenu,
  .dropdown-submenu:hover {
    display: block !important;
  }

  .mobile-menu-drawer, .menu-toggle { display: none !important; }
}

/* SaaS Gradient CTA Button */
.btn-cta-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary-gradient);
  color: #ffffff !important;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow-cta-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-cta-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.45);
  filter: brightness(1.08);
}

/* Language Switcher UI */
.lang-wrap { position: relative; margin-left: 12px; }
.lang-btn {
  display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 10px; padding: 7px 12px;
  cursor: pointer; transition: all .2s ease; font-family: inherit;
  font-size: 13px; font-weight: 700; color: #ffffff;
}
.lang-btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.35); }
.lang-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; width: 230px;
  background: #ffffff; border-radius: var(--radius-md); border: 1px solid var(--border);
  box-shadow: var(--shadow-saas-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: all .2s ease; z-index: 9999;
}
.lang-dropdown.show { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-option {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; text-decoration: none; color: #1e293b;
  transition: background .18s ease; font-size: 13px; font-weight: 600;
}
.lang-option:hover { background: #f1f5f9; }

@media(max-width: 768px){
  .lang-current { display: none; }
  .lang-btn { padding: 8px 10px; }
}

/* ==========================================================================
   3. SAAS HERO & UPLOADER WRAPPER
   ========================================================================== */
.hero { 
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); 
  padding: 56px 0 48px; 
  text-align: center; 
  color: #ffffff; 
  min-height: 220px;
  position: relative;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

.hero-title { 
  font-size: clamp(1.75rem, 4.5vw, 2.75rem); 
  font-weight: 800; 
  margin-bottom: 14px; 
  line-height: 1.2; 
  letter-spacing: -0.02em;
  color: #ffffff;
}

.hero-sub { 
  font-size: clamp(1rem, 2vw, 1.15rem); 
  color: #94a3b8; 
  font-weight: 500; 
  max-width: 720px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Micro Trust Strip */
.trust-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.trust-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
}
.trust-badge-item svg {
  color: #10b981;
}

/* ==========================================================================
   4. FEATURE CARDS GRID & STATS
   ========================================================================== */
.main-content { flex: 1; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 40px; }

.features-section { margin: 24px 0; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.feature-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-saas-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-saas-md);
  border-color: #cbd5e1;
}

.feature-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-icon-wrapper svg { width: 24px; height: 24px; }

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}
.feature-card p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

/* Stats Strip (Real Placeholders without fake numbers) */
.stats-strip {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
  box-shadow: var(--shadow-saas-sm);
}
.stat-item { display: flex; flex-direction: column; gap: 6px; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: #0f172a; letter-spacing: -0.02em; }
.stat-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ==========================================================================
   5. SEO STEP CARDS & PRESENTATION
   ========================================================================== */
.seo-steps-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 32px 0;
}

.step-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-saas-sm);
  transition: border-color 0.2s ease;
}
.step-card:hover { border-color: #cbd5e1; }

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-gradient);
  color: #ffffff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-info h3 { font-size: 1.1rem; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.step-info p { font-size: 0.93rem; color: var(--muted); line-height: 1.6; }

/* Callout Box */
.callout-box {
  background: #eff6ff;
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 24px 0;
  color: #1e3a8a;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.callout-box svg { flex-shrink: 0; color: var(--blue); }

/* ==========================================================================
   6. FAQ ACCORDION UI
   ========================================================================== */
.converter-faq-section, .faq-section {
  margin: 40px 0;
}
.converter-faq-list, .faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.converter-faq-item, .faq-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.converter-faq-item:hover, .faq-item:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-saas-sm);
}

.converter-faq-q, .faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 18px 24px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}
.converter-faq-q:hover, .faq-q:hover { color: var(--blue); }

.converter-faq-icon, .faq-icon {
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform 0.3s ease;
  color: #64748b;
  flex-shrink: 0;
  margin-left: 12px;
}
.converter-faq-item.active .converter-faq-icon, .faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: var(--blue);
}

.converter-faq-a, .faq-a {
  display: none;
  padding: 0 24px 20px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
  border-top: 1px solid #f1f5f9;
}
.converter-faq-item.active .converter-faq-a, .faq-item.open .faq-a {
  display: block;
}

/* ==========================================================================
   7. MULTI-COLUMN SAAS FOOTER
   ========================================================================== */
.site-footer { 
  background: #0f172a; 
  padding: 56px 0 28px 0; 
  margin-top: auto; 
  color: #ffffff; 
  width: 100%; 
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.footer-inner { 
  max-width: 1140px; 
  width: 100%; 
  margin: 0 auto; 
  padding: 0 24px; 
  display: flex; 
  flex-direction: column; 
  gap: 40px; 
}
.footer-columns {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 991px) {
  .footer-columns { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-columns { grid-template-columns: 1fr; }
}

.footer-brand { display: flex; flex-direction: column; gap: 16px; }
.footer-brand-logo { display: flex; align-items: center; gap: 12px; font-size: 1.2rem; font-weight: 800; color: #ffffff; }
.footer-brand-desc { font-size: 0.9rem; color: #94a3b8; line-height: 1.6; max-width: 320px; }

.footer-col-title { font-size: 0.95rem; font-weight: 700; color: #ffffff; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.footer-links-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links-list a { color: #94a3b8; font-size: 0.9rem; font-weight: 500; transition: color 0.2s ease; }
.footer-links-list a:hover { color: #ffffff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { font-size: 0.88rem; color: #64748b; }

.social-icons { display: flex; align-items: center; gap: 10px; }
.social-icons a { 
  display: flex; align-items: center; justify-content: center; color: #cbd5e1; 
  width: 38px; height: 38px; background: rgba(255, 255, 255, 0.06); border-radius: 10px; 
  transition: all 0.2s ease; 
}
.social-icons a:hover { background: var(--blue); color: #ffffff; transform: translateY(-3px); }

/* ==========================================================================
   8. MOBILE DRAWER NAVIGATION
   ========================================================================== */
@media (max-width: 991px) {
  .header-nav, .lang-btn .lang-label { display: none !important; }
  .header-inner { display: flex !important; align-items: center !important; justify-content: space-between !important; height: 64px; }

  .menu-toggle {
    display: flex !important; flex-direction: column !important; justify-content: center !important;
    align-items: center !important; gap: 5px !important; width: 42px !important; height: 42px !important;
    background: rgba(255, 255, 255, 0.08) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important; cursor: pointer !important; z-index: 99999 !important;
  }
  .menu-toggle span {
    width: 20px !important; height: 2px !important; background-color: #ffffff !important;
    border-radius: 4px !important; transition: all 0.25s ease !important;
  }

  .mobile-menu-drawer {
    display: block !important; position: absolute !important; top: 100% !important; left: 0 !important;
    width: 100% !important; background: #ffffff !important; max-height: 0; overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.15) !important; z-index: 9999 !important;
    border-top: 1px solid #f1f5f9 !important; opacity: 0; visibility: hidden; 
  }
  .mobile-menu-drawer.is-open {
    max-height: 88vh !important; overflow-y: auto !important; opacity: 1; visibility: visible;
  }
}