/* ============================
       1. CORE VARIABLES
       ============================ */
    :root {
      --bg-body: #f8fafc;
      --bg-card: #ffffff;
      --text-main: #1f2937;
      --text-muted: #64748b;
      --primary: #FF6534;
      --primary-hover: #e55520;
      --border: #e2e8f0;
      --radius-lg: 16px;
      --radius-sm: 8px;
      --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
      --ease: cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Base Reset */
    * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Poppins', sans-serif; }
    
    html, body { width: 100%; overflow-x: hidden; position: relative; }
    body { background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; display: flex; flex-direction: column; min-height: 100vh; }
    a { text-decoration: none; color: inherit; }

    /* ============================
       2. ANNOUNCEMENT BAR & NAV
       ============================ */
    .announcement-bar {
      position: fixed; top: 0; left: 0; width: 100%; height: 30px;
      background: linear-gradient(90deg, var(--primary) 0%, #ff8c66 100%);
      color: #ffffff; display: flex; justify-content: center; align-items: center;
      padding: 0 5%; z-index: 1002; font-size: 12px; font-weight: 500;
      box-shadow: 0 2px 10px rgba(255, 101, 52, 0.2); transition: transform 0.3s ease;
    }
    .announcement-bar .badge { background: rgba(255, 255, 255, 0.25); padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; margin-right: 10px; letter-spacing: 0.5px; }
    .announcement-bar p { margin: 0; display: flex; align-items: center; }

    nav {
      position: fixed; top: 30px; width: 100%; background: rgba(255, 255, 255, 0.9);
      backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
      padding: 15px 5%; display: flex; justify-content: space-between; align-items: center;
      z-index: 1000; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); transition: top 0.3s ease;
    }
    .logo { font-size: 24px; font-weight: 700; color: var(--text-main); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -0.5px; }
    .logo img { height: 38px; }

    .nav-links { display: flex; align-items: center; margin-left: auto; }
    .nav-links a { text-decoration: none; color: var(--text-main); font-weight: 500; margin-left: 30px; transition: all 0.3s; display: flex; align-items: center; gap: 8px; }
    .nav-links a:hover { color: var(--primary); }
    .nav-links .close-btn, .nav-links .menu-header { display: none; }

    .hamburger { display: none; background: none; border: none; font-size: 24px; color: var(--text-main); cursor: pointer; transition: color 0.3s; margin-left: 20px; }
    .hamburger:hover { color: var(--primary); }
    .menu-overlay { display: none; }

    /* ============================
       3. HERO & PAGE HEADER
       ============================ */
    .hero-tool {
      display: grid;
      align-items: center;
      gap: 20px;
      max-width: 1200px;
      margin: 0 auto;
      padding: 130px 5% 40px;
    }

    .hero-title { grid-area: title; }
    .hero-desc { grid-area: desc; }
    .hero-img { grid-area: img; width: 100%; max-width: 480px; justify-self: center; }
    .hero-img img { width: 100%; height: auto; border-radius: 24px;  display: block; object-fit: cover; }

    .hero-title h1 {
      font-size: clamp(34px, 4.5vw, 46px);
      font-weight: 800;
      margin: 0;
      color: var(--text-main);
      line-height: 1.3;
    }
    
    .hero-desc p {
      font-size: 18px; 
      color: var(--text-muted); 
      line-height: 1.6;
      margin: 0;
    }

    .heading-underline {
      position: absolute;
      bottom: -6px;
      left: 0;
      width: 100%;
      height: 14px;
      z-index: -1;
    }

    @media (min-width: 769px) {
      .hero-tool {
        grid-template-columns: 1.2fr 1fr;
        grid-template-areas: "title img" "desc img";
        text-align: left;
        align-content: center;
        row-gap: 15px;
      }
      .hero-desc { align-self: start; max-width: 550px; }
      .hero-title { align-self: end; }
    }

    @media (max-width: 768px) {
      .hero-tool {
        grid-template-columns: 1fr;
        grid-template-areas: "title" "desc" "img";
        text-align: center;
        gap: 30px;
        padding-top: 120px;
      }
      .hero-desc p { max-width: 100%; margin: 0 auto; }
    }

    /* ============================
       4. TOOL BUILDER LAYOUT
       ============================ */
    .content-section { padding: 20px 5% 80px; max-width: 1300px; margin: 0 auto; }

    .builder-wrapper {
      display: grid; grid-template-columns: 1fr 1.5fr; gap: 30px; align-items: start; width: 100%;
    }

    .editor-pane { display: flex; flex-direction: column; gap: 20px; order: 1; min-width: 0; }
    .preview-pane { position: sticky; top: 100px; order: 2; min-width: 0; }

    .tool-card {
      background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
      padding: 25px; transition: 0.3s; box-shadow: 0 4px 15px rgba(0,0,0,0.02);
    }
    .tool-card h3 { 
      margin-bottom: 20px; color: var(--text-main); font-size: 18px; font-weight: 600;
      display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 15px;
    }
    .tool-card h3 i { color: var(--primary); }

    .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
    .input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 5px; min-width: 0; }
    .input-group.full-width { grid-column: span 2; }

    label { font-size: 14px; font-weight: 600; color: var(--text-main); }

    input[type="text"] {
      width: 100%; padding: 16px; background: var(--bg-body); border: 1px solid var(--border);
      border-radius: var(--radius-sm); color: var(--text-main); font-size: 15px; transition: all 0.3s ease; outline: none;
    }
    input:focus { border-color: var(--primary); box-shadow: 0 4px 15px rgba(255, 101, 52, 0.1); background: var(--bg-card); }

    .btn-action {
      background: var(--primary); color: white; padding: 14px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 16px;
      cursor: pointer; transition: 0.3s; display: block; width: 100%; text-align: center; border: none; margin-top: 10px;
    }
    .btn-action:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 15px rgba(255, 101, 52, 0.3); }

    /* ============================
       5. THUMBNAIL OUTPUT STYLES
       ============================ */
    .error-msg {
      color: #e11d48; font-size: 14px; font-weight: 500; margin-top: 10px; display: none;
      background: #ffe4e6; padding: 10px; border-radius: var(--radius-sm); border: 1px solid #fda4af;
    }

    .preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
    .preview-header h2 { font-size: 22px; color: var(--text-main); font-weight: 700; }

    .result-container {
      display: none; /* hidden until fetched */
      flex-direction: column;
      gap: 20px;
    }

    .thumb-card {
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
      box-shadow: 0 4px 15px rgba(0,0,0,0.02);
      display: flex;
      flex-direction: column;
      gap: 15px;
    }
    
    .thumb-card h4 {
      font-size: 16px; font-weight: 700; color: var(--text-main); margin: 0;
      display: flex; justify-content: space-between; align-items: center;
    }

    .thumb-card h4 span {
      font-size: 12px; font-weight: 500; color: white; background: var(--primary);
      padding: 4px 10px; border-radius: 20px;
    }

    .thumb-card img {
      width: 100%;
      height: auto;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: #000;
    }

    .dl-btn {
      background: linear-gradient(135deg, var(--primary) 0%, #ff8c66 100%);
      color: white; padding: 12px 20px; border-radius: var(--radius-sm); 
      font-weight: 600; cursor: pointer; transition: 0.3s; display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: none;
      box-shadow: 0 4px 10px rgba(255, 101, 52, 0.25); font-size: 15px; text-decoration: none;
    }
    .dl-btn:hover { box-shadow: 0 6px 15px rgba(255, 101, 52, 0.4); transform: translateY(-2px); color: white; }

    /* ============================
       6. SHARE, SECTIONS, FOOTER 
       ============================ */
    .share-tool-container { background: #fff; border-radius: 12px; padding: 15px; margin-bottom: 20px; text-align: center; border: 1px solid #eee; }
    .share-tool-container p { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #333; }
    .share-flex { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
    .share-icon-btn { width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: transform 0.2s ease, opacity 0.2s ease; font-size: 16px; }
    .share-icon-btn:hover { transform: translateY(-3px); opacity: 0.9; }
    .fb-btn { background-color: #1877F2; }
    .tw-btn { background-color: #000000; }
    .wa-btn { background-color: #25D366; }
    .ln-btn { background-color: #0A66C2; }
    .pt-btn { background-color: #E60023; }

    .section-header { text-align: center; margin-bottom: 50px; }
    .section-header h2 { font-size: 32px; font-weight: 700; color: var(--text-main); margin-bottom: 15px; }
    .section-header p { font-size: 16px; color: var(--text-muted); max-width: 700px; margin: 0 auto; }

    .seo-split { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; margin-bottom: 40px; }
    .seo-split img { width: 100%; border-radius: var(--radius-lg); object-fit: cover; }
    .seo-content h2 { font-size: 28px; margin-bottom: 18px; color: var(--text-main); font-weight: 700; line-height: 1.3; }
    .seo-content p { font-size: 16px; color: var(--text-muted); margin-bottom: 15px; line-height: 1.7; }

    .features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-bottom: 60px; }
    .feature-box { background: var(--bg-card); padding: 35px 25px; border-radius: 20px; text-align: center; border: 1px solid var(--border); box-shadow: 0 4px 15px rgba(0,0,0,0.02); transition: transform 0.3s ease; }
    .feature-box:hover { transform: translateY(-5px); border-color: var(--primary); }
    .step-number { width: 40px; height: 40px; background: var(--primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; margin: 0 auto 20px; }
    .feature-box h3 { font-size: 18px; margin-bottom: 12px; color: var(--text-main); font-weight: 600; }
    .feature-box p { font-size: 14px; color: var(--text-muted); }

    .why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 25px; margin-bottom: 60px; }
    .why-card { background: var(--bg-card); padding: 30px; border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 4px 15px rgba(0,0,0,0.02); text-align: left; transition: all 0.3s; }
    .why-card:hover { border-color: var(--primary); box-shadow: 0 8px 25px rgba(0,0,0,0.04); transform: translateY(-2px); }
    .why-card h3 { font-size: 20px; color: var(--text-main); margin-bottom: 12px; font-weight: 700; }
    .why-card p { font-size: 15px; color: var(--text-muted); line-height: 1.6; }

    .faq-container { max-width: 800px; margin: 0 auto; }
    .faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 15px; overflow: hidden; transition: all 0.3s; }
    .faq-item:hover { border-color: var(--primary); }
    .faq-question { padding: 20px 25px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; color: var(--text-main); font-size: 16px; }
    .faq-question i { color: var(--primary); transition: transform 0.3s ease; }
    .faq-answer { padding: 0 25px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; color: var(--text-muted); font-size: 15px; line-height: 1.7; }
    .faq-item.active .faq-answer { padding: 0 25px 20px; max-height: 300px; }
    .faq-item.active .faq-question i { transform: rotate(180deg); }

    footer { background-color: #ffffff; border-top: 1px solid var(--border); padding: 60px 5% 20px; box-shadow: 0 -4px 20px rgba(0,0,0,0.02); margin-top: auto; }
    .footer-top { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr 2fr; gap: 50px; margin-bottom: 50px; }
    .footer-brand .footer-logo { font-size: 24px; font-weight: 700; color: var(--text-main); text-decoration: none; display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
    .footer-brand .footer-logo img { height: 38px; }
    .footer-desc { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin-bottom: 25px; max-width: 380px; }
    .footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
    .footer-col h4 { color: var(--text-main); font-size: 17px; font-weight: 600; margin-bottom: 20px; }
    .footer-col a { display: block; color: var(--text-muted); text-decoration: none; font-size: 15px; margin-bottom: 12px; transition: all 0.3s ease; }
    .footer-col a:hover { color: var(--primary); transform: translateX(4px); }
    .footer-bottom { max-width: 1200px; margin: 0 auto; text-align: center; color: var(--text-muted); font-size: 14px; padding-top: 25px; border-top: 1px solid var(--border); }

    @media (max-width: 900px) {
      .builder-wrapper { grid-template-columns: 1fr; gap: 30px; }
      .preview-pane { position: relative; top: 0; order: 2; margin-top: 10px; }
    }

    /* ============================
       7. TOOLS DROPDOWN — Desktop & Mobile
       ============================ */
    /* Desktop dropdown - perfect in menu line */
    .tools-dropdown {
      position: relative;
      display: inline-block;
      margin-left: 30px;
    }
    .tools-dropdown > a {
      margin-left: 0 !important;
      cursor: pointer;
    }
    .tools-dropdown > a i {
      font-size: 12px;
      margin-left: 6px;
      color: var(--text-muted);
      transition: transform 0.3s ease;
    }
    .tools-dropdown:hover > a i {
      transform: rotate(180deg);
    }
    .tools-dropdown-content {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      background: #ffffff;
      min-width: 230px;
      box-shadow: 0 12px 40px rgba(0,0,0,0.12);
      border-radius: 12px;
      border: 1px solid var(--border);
      padding: 8px 0;
      z-index: 1001;
      margin-top: 8px;
    }
    .tools-dropdown-content a {
      display: block;
      padding: 10px 20px;
      font-size: 14px;
      font-weight: 500;
      color: var(--text-main);
      margin: 0 !important;
      border-bottom: 1px solid rgba(226, 232, 240, 0.5);
      transition: all 0.2s ease;
    }
    .tools-dropdown-content a:last-child {
      border-bottom: none;
    }
    .tools-dropdown-content a:hover {
      background: rgba(255, 101, 52, 0.06);
      color: var(--primary);
      padding-left: 26px;
    }
    .tools-dropdown:hover .tools-dropdown-content {
      display: block;
    }

    /* Mobile: Tools button on menu bar (next to hamburger) */
    .mobile-tools-wrapper {
      display: none;
      align-items: center;
      margin-left: auto;
      gap: 12px;
    }

    .mobile-tools-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      background: var(--primary);
      color: #fff;
      border: none;
      padding: 8px 14px;
      border-radius: 30px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
      -webkit-tap-highlight-color: transparent;
      box-shadow: 0 4px 12px rgba(255, 101, 52, 0.25);
      letter-spacing: 0.3px;
      white-space: nowrap;
    }
    .mobile-tools-btn:active {
      transform: scale(0.94);
      background: var(--primary-hover);
    }
    .mobile-tools-btn i {
      font-size: 12px;
      transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
      pointer-events: none;
    }
    .mobile-tools-btn.open i {
      transform: rotate(180deg);
    }

    /* Mobile dropdown panel below nav */
    .mobile-tools-dropdown {
      position: fixed;
      top: 75px;
      left: 5%;
      right: 5%;
      background: #ffffff;
      border-radius: 16px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
      padding: 8px 0;
      z-index: 1006;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, transform 0.3s ease;
      opacity: 0;
      transform: translateY(-10px) scale(0.96);
      border: 1px solid var(--border);
      pointer-events: none;
    }
    .mobile-tools-dropdown.open {
      max-height: 600px;
      opacity: 1;
      transform: translateY(0) scale(1);
      pointer-events: auto;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .mobile-tools-dropdown a {
      display: block;
      padding: 14px 20px;
      font-size: 15px;
      font-weight: 500;
      color: var(--text-main);
      border-bottom: 1px solid rgba(226, 232, 240, 0.6);
      transition: all 0.2s ease;
      -webkit-tap-highlight-color: transparent;
    }
    .mobile-tools-dropdown a:last-child {
      border-bottom: none;
    }
    .mobile-tools-dropdown a:active {
      background: rgba(255, 101, 52, 0.08);
      color: var(--primary);
      padding-left: 26px;
    }

    /* Mobile styles */
    @media (max-width: 768px) {
      .announcement-bar { font-size: 11px; }
      
      .hamburger { 
        display: block;
        margin-left: 0;
      }
      
      /* Show mobile tools wrapper, hide desktop dropdown */
      .mobile-tools-wrapper {
        display: flex !important;
      }
      .tools-dropdown {
        display: none !important;
      }

      .nav-links {
        position: fixed; top: 0; left: -300px; width: 280px; height: 100vh; background-color: #ffffff;
        flex-direction: column; align-items: flex-start; padding: 25px; box-shadow: 4px 0 20px rgba(0,0,0,0.1);
        transition: left 0.4s cubic-bezier(0.175, 0.885, 0.32, 1); z-index: 1005; margin-left: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      .nav-links.active { left: 0; }
      .nav-links .menu-header { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: 20px; font-weight: 700; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
      .nav-links .close-btn { display: block; background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; padding: 5px; }
      .nav-links > a { margin: 0 0 18px 0; font-size: 18px; width: 100%; }
      .menu-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.5); backdrop-filter: blur(3px); z-index: 1004; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
      .menu-overlay.active { opacity: 1; visibility: visible; }

      .form-grid { grid-template-columns: 1fr; }
      .input-group.full-width { grid-column: span 1; }
      .footer-top { grid-template-columns: 1fr; gap: 40px; }
      .footer-nav { grid-template-columns: repeat(2, 1fr); }
      .seo-split { grid-template-columns: 1fr; gap: 30px; text-align: center; }

      .mobile-tools-dropdown {
        top: 75px;
      }
    }
    @media (max-width: 480px) {
      .footer-nav { grid-template-columns: 1fr; gap: 25px; }
      .mobile-tools-btn {
        font-size: 12px;
        padding: 6px 12px;
      }
      .mobile-tools-dropdown {
        top: 68px;
        left: 4%;
        right: 4%;
      }
    }