/* Header and Footer Styles */

/* Global Styles */

/* Header Styles */
.header {
    background-color: #1a2332;
    padding: 15px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: padding 0.3s ease;
}

.logo {
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: font-size 0.3s ease;
    display: inline-block;
    line-height: 1.2;
}

.logo span.insta {
    color: #fff;
}

.logo span.pdf {
    color: #fa1b3e;
}

.logo span.editor {
    color: #fff;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 25px;
    margin: 0;
    padding: 0;
    list-style: none;
    transition: gap 0.3s ease;
}

.nav-links a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s, font-size 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    color: #FA1B3E;
}

.pricing-link {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s, font-size 0.3s ease;
}

.pricing-link:hover {
    color: #FA1B3E;
}

.nav-links .dropdown {
    position: relative;
}

.nav-links .dropdown a i {
    font-size: 10px;
    margin-left: 5px;
}

/* Desktop Dropdown Menu */
.nav-links .dropdown .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a2332;
    min-width: 220px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

/* Megamenu Styles */

/*
 * The panel is anchored to .header (position: fixed, full viewport width)
 * instead of the narrow <li>. .nav-links .megamenu deliberately has NO
 * position: relative here, so .header becomes the containing block and
 * left:0 / width:100% span the viewport exactly.
 *
 * The previous rule combined left:50% + translateX(-50%) + margin-left:-50vw.
 * Both the transform and the negative margin compensated for the same offset,
 * so the panel was shifted twice (~100vw) and landed off-screen to the left.
 */
.nav-links .megamenu a i {
    font-size: 10px;
    margin-left: 5px;
}

.nav-links .megamenu .megamenu-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 0;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    padding: 10px 20px;
}

/*
 * Invisible hover bridge. top:100% now resolves against .header, leaving a
 * gap between the trigger's bottom edge and the panel. This pseudo-element
 * covers that gap so the pointer can travel down without dropping :hover
 * (which would close the panel mid-click).
 */
.nav-links .megamenu .megamenu-content::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 30px;
}

.nav-links .megamenu:hover .megamenu-content {
    display: block;
}

/*
 * Flow is column-first: each category stacks top-to-bottom, and the next
 * category starts only when the current one ends, then wraps to the next
 * column. CSS multi-column (column-count) does this natively, which is why
 * it was chosen over grid.
 *
 * Grid filled row-first (cats 1-6 across the top, 7-9 beneath), so the row
 * was as tall as its tallest category and every short category left a gap.
 * Multi-column packs each column independently, so there are no holes.
 *
 * break-inside: keep the section on the column it starts on - without it a
 * long category ("Others", 15 tools) splits across two columns.
 */
/*
 * Exactly six columns, guaranteed. The categories are distributed into six
 * real column elements server-side (see $headerMegamenuColumns in header.php),
 * so the column count is structural rather than content-dependent.
 *
 * Multi-column (column-count) was tried first, but it balances content across
 * whatever columns the height allows - nine categories fit into five columns
 * on a 1920px screen, which is why it rendered 5 instead of 6.
 *
 * Each column is its own flex stack, so a category runs top-to-bottom and the
 * next category starts directly beneath where the previous one ended.
 */
.megamenu-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    column-gap: 18px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

/* One vertical stack per grid track. */
.megamenu-grid > .megamenu-column {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/*
 * Block, not flex: break-inside:avoid is unreliable on a flex container in
 * multi-column. Each .megamenu-item is itself a flex row, so tool layout is
 * unchanged - they just stack as blocks now.
 */
.megamenu-category-section {
    display: block;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

.megamenu-category-title {
    font-size: 11px;
    font-weight: 700;
    color: #118AB2 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 15px 4px;
    /* Was nowrap + ellipsis, which clipped category names ("Compress & Scans")
       once the grid moved to six narrower tracks. Wrap instead of truncate. */
    white-space: normal;
    overflow-wrap: anywhere;
}

.megamenu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    margin-bottom: 6px;
    font-size: 14px;
    /* !important is required here, not cosmetic: .nav-links a { color:#fff }
       scores 0-1-1 (class + type) and beats .megamenu-item at 0-1-0, which
       left every tool label white on the white panel - i.e. invisible. */
    color: #000000 !important;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 5px;
    white-space: nowrap;
}

.megamenu-item:last-child {
    margin-bottom: 0;
}

.megamenu-item:hover {
    background: rgba(250, 27, 62, 0.1);
    color: #FA1B3E !important;
    transform: translateX(5px);
}

.megamenu-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    font-size: 12px;
}

.megamenu-item-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.nav-links .dropdown:hover .dropdown-menu {
    display: block;
}

.nav-links .dropdown .dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    font-size: 14px;
    color: #fff;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.nav-links .dropdown .dropdown-menu li a:hover {
    background: rgba(250, 27, 62, 0.15);
    color: #FA1B3E;
}

/* Mobile Dropdown Menu */
.mobile-dropdown-menu {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.05);
}

.mobile-dropdown-menu.active {
    display: block;
}

.mobile-dropdown-menu li a {
    display: block;
    padding: 12px 20px 12px 40px;
    color: #c4cbd6;
    font-size: 14px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-dropdown-menu li a:hover {
    color: #FA1B3E;
}

.mobile-dropdown-category {
    padding: 10px 20px 5px 40px;
    color: #FA1B3E;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-login {
    border: 2px solid #FA1B3E;
    background: transparent;
    color: #fff;
    padding: 8px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    font-size: 14px;
}

.btn-login:hover {
    background: #FA1B3E;
    color: #fff;
}

/* Mobile Menu Toggle */
.navbar-toggler {
    border: none;
    background: transparent;
    padding: 8px 10px;
    cursor: pointer;
    display: none;
    transition: transform 0.3s ease;
}

.navbar-toggler:hover {
    transform: scale(1.05);
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: none;
}

/* SVG Toggle Icon - Use SVG image only */
.navbar-toggler img.navbar-toggler-icon-svg {
    filter: brightness(0) invert(1) !important; /* Makes icon white */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: width 0.3s ease, height 0.3s ease;
}

/* Remove all legacy hamburger icon styles completely */
.navbar-toggler-icon {
    display: none !important;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    display: none !important;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    background-color: #1a2332;
    padding-top: 20px;
    transition: all 0.3s ease;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu .nav-links {
    flex-direction: column;
    gap: 0;
}

.mobile-menu .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu .nav-links a {
    display: block;
    padding: 15px 20px;
}

.mobile-menu .pricing-login {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border-top: none;
    margin-top: 0;
}

.mobile-menu .pricing-login .pricing-link {
    display: block;
    text-align: left;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu .btn-login {
    display: none;
}

/* Footer Styles */
.footer {
    background-color: #1a2332;
    color: #fff;
}

.footer-subtitle {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #FFFFFF;
    letter-spacing: 0.6px;
    line-height: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    color: #FFFFFFCC;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    font-weight: 400;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #FFFFFF26;
    color: #FFFFFFCC;
    font-size: 13px;
    line-height: 20px;
}

/* =====================================================
   COMPREHENSIVE RESPONSIVE DESIGN - Every 200px
   ===================================================== */

/* Extra Extra Large Desktop - 1600px and above */
@media (min-width: 1600px) {
    .header {
        padding: 20px 0;
    }
    
    .logo {
        font-size: 42px;
    }
    
    .nav-links {
        gap: 35px;
    }
    
    .nav-links a {
        font-size: 17px;
    }
    
    .pricing-link {
        font-size: 17px;
    }
    
    .btn-login {
        padding: 12px 35px;
        font-size: 16px;
    }
}

/* Extra Large Desktop - 1400px to 1599px */
@media (min-width: 1400px) and (max-width: 1599px) {
    .header {
        padding: 18px 0;
    }
    
    .logo {
        font-size: 32px;
    }
    
    .nav-links {
        gap: 30px;
    }
    
    .nav-links a {
        font-size: 16px;
    }
    
    .pricing-link {
        font-size: 16px;
    }
    
    .btn-login {
        padding: 10px 30px;
        font-size: 15px;
    }
}

/* Large Desktop - 1200px to 1399px */
@media (min-width: 1200px) and (max-width: 1399px) {
    .header {
        padding: 16px 0;
    }
    
    .logo {
        font-size: 34px;
    }
    
    .nav-links {
        gap: 15px;
    }
    
    .nav-links a {
        font-size: 15px;
    }
    
    .pricing-link {
        font-size: 15px;
    }
    
    .btn-login {
        padding: 9px 28px;
        font-size: 14px;
    }
}

/* Medium Desktop - 1000px to 1199px */
@media (min-width: 1000px) and (max-width: 1199px) {
    .header {
        padding: 15px 0;
    }
    
    .logo {
        font-size: 26px;
    }
    
    .nav-links {
        gap: 11px;
    }
    
    .nav-links a {
        font-size: 14px;
    }
    
    .pricing-link {
        font-size: 14px;
    }
    
    .btn-login {
        padding: 8px 25px;
        font-size: 13px;
    }
}

/* Small Desktop/Large Tablet - 800px to 999px */
@media (min-width: 800px) and (max-width: 999px) {
    .header {
        padding: 14px 0;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .nav-links {
        gap: 12px;
    }
    
    .nav-links a {
        font-size: 13px;
    }
    
    .pricing-link {
        font-size: 13px;
    }
    
    .btn-login {
        padding: 7px 22px;
        font-size: 12px;
    }
}

/* Tablet - 600px to 799px */
@media (min-width: 600px) and (max-width: 799px) {
    .desktop-nav,
    .desktop-pricing-login {
        display: none !important;
    }
    
    .navbar-toggler {
        display: block !important;
    }
    
    .header {
        padding: 13px 0;
    }
    
    .logo {
        font-size: 22px;
    }
    
    .btn-login {
        padding: 7px 20px;
        font-size: 12px;
    }
    
    .navbar-toggler img.navbar-toggler-icon-svg {
        width: 26px !important;
        height: 26px !important;
    }
    
    .mobile-menu {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 65px);
        overflow-y: auto;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
}

/* Large Mobile - 400px to 599px */
@media (min-width: 400px) and (max-width: 599px) {
    .desktop-nav,
    .desktop-pricing-login {
        display: none !important;
    }
    
    .navbar-toggler {
        display: block !important;
    }
    
    .header {
        padding: 12px 0;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .btn-login {
        padding: 6px 18px;
        font-size: 11px;
    }
    
    .navbar-toggler img.navbar-toggler-icon-svg {
        width: 24px !important;
        height: 24px !important;
    }
    
    .mobile-menu {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
}

/* Small Mobile - 200px to 399px */
@media (min-width: 200px) and (max-width: 399px) {
    .desktop-nav,
    .desktop-pricing-login {
        display: none !important;
    }
    
    .navbar-toggler {
        display: block !important;
    }
    
    .header {
        padding: 10px 0;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .btn-login {
        padding: 5px 15px;
        font-size: 10px;
    }
    
    .navbar-toggler img.navbar-toggler-icon-svg {
        width: 22px !important;
        height: 22px !important;
    }
    
    .mobile-menu {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 55px);
        overflow-y: auto;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
}

/* =====================================================
   LEGACY RESPONSIVE SUPPORT (Keep for compatibility)
   ===================================================== */

/* Tablet and Mobile - Below 992px */
@media (max-width: 992px) {
    .desktop-nav,
    .desktop-pricing-login {
        display: none !important;
    }
    
    .navbar-toggler {
        display: block !important;
    }
}

/* Desktop - 992px and above */
@media (min-width: 992px) {
    .navbar-toggler {
        display: none !important;
    }
    
    .mobile-menu {
        display: none !important;
    }
    
    .d-lg-none {
        display: none !important;
    }
    
    .desktop-nav,
    .desktop-pricing-login {
        display: block !important;
    }
}

/* =====================================================
   HOVER EFFECTS AND ANIMATIONS
   ===================================================== */

.header .container {
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.nav-links a {
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #FA1B3E;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::before {
    width: 100%;
}

.btn-login {
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn-login:hover::before {
    left: 100%;
}

/* User Avatar Responsive */
.user-avatar {
    transition: all 0.3s ease;
}

@media (min-width: 1400px) {
    .user-avatar {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (min-width: 1000px) and (max-width: 1199px) {
    .user-avatar {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }
}

@media (min-width: 600px) and (max-width: 999px) {
    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }
}

@media (min-width: 400px) and (max-width: 599px) {
    .user-avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }
}

@media (max-width: 399px) {
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }
}

/* Megamenu Responsive Styles */

/* Large Desktop and above - 6 columns */
@media (min-width: 1200px) {
    .megamenu-content {
        width: 100%;
        left: 0;
        margin-left: 0;
    }
    
    .megamenu-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        column-gap: 18px;
        max-width: 1600px;
        margin: 0 auto;
        padding: 0 40px;
    }
    
    .megamenu-item {
        padding: 6px 10px;
        font-size: 14px !important;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    
    .megamenu-item-icon {
        width: 22px;
        height: 22px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .megamenu-item-icon img {
        width: 22px;
        height: 22px;
    }
}

/* Medium Desktop - 4 columns */
@media (min-width: 1000px) and (max-width: 1199px) {
    .megamenu-content {
        width: 100%;
        left: 0;
        margin-left: 0;
    }
    
    .megamenu-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        column-gap: 18px;
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 40px;
    }
    
    .megamenu-item {
        padding: 11px 16px;
        font-size: 14px;
    }
}

/* Small Desktop - 3 columns */
@media (min-width: 800px) and (max-width: 999px) {
    .megamenu-content {
        width: 100%;
        left: 0;
        margin-left: 0;
    }
    
    .megamenu-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 15px;
        max-width: 1000px;
        margin: 0 auto;
        padding: 0 30px;
    }
    
    .megamenu-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .megamenu-item-icon {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }
    
    .megamenu-item-icon img {
        width: 18px;
        height: 18px;
    }
}

/* Hide megamenu on tablet and mobile (below 800px) - Use mobile dropdown instead */
@media (max-width: 799px) {
    .nav-links .megamenu .megamenu-content {
        display: none !important;
    }
}

/* Footer side columns: sections stacked one above the other, top-aligned */
.footer-side-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    align-items: start;
}

.footer-side-column {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.footer-group {
    min-width: 0;
}

@media (max-width: 1199px) {
    .footer-side-columns { gap: 25px; }
}

@media (max-width: 991px) {
    .footer-side-columns { gap: 20px; }
    .footer-side-column  { gap: 24px; }
}

@media (max-width: 575px) {
    .footer-side-columns { gap: 12px; margin-top: 0px !important; }
    .footer-side-column  { gap: 20px; }
}

/* Below md the side columns stack under the tools and go single file. */
@media (max-width: 767px) {
    .footer-side-columns {
        grid-template-columns: minmax(0, 1fr);
        margin-top: 0px;
    }
}

/* Footer PDF Tools Column Styles */
.pdf-tools-columns {
    width: 100%;
}

/*
 * Grid keeps every tool column the same width. The column count is driven by
 * the --pdf-tool-columns variable that footer.php emits, so the PHP side stays
 * the single source of truth. Breakpoints below only choose how many tracks
 * fit, always using a divisor of 4 so no orphaned column is left behind.
 */
.pdf-tools-column-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--pdf-tool-columns, 4), minmax(0, 1fr));
    gap: 30px;
    width: 100%;
    align-items: start;
}

.pdf-tools-column {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: 0;
}

.pdf-tools-column li {
    margin: 0 0 6px 0;
    padding: 0;
}

/* Use exact same styling as other footer sections with consistent sizing */
.pdf-tools-column li a {
    color: #FFFFFFCC;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: block;
    padding: 2px 0;
    min-height: 20px;
}

.pdf-tools-column li a:hover {
    color: #fff;
}

/* Footer PDF Tools Responsive - Consistent sizing across breakpoints */
@media (max-width: 1199px) {
    .pdf-tools-column-wrapper {
        gap: 25px;
    }
    
    .pdf-tools-column li a {
        font-size: 14px;
        min-height: 20px;
        padding: 2px 0;
    }
}

@media (max-width: 991px) {
    .pdf-tools-column-wrapper {
        gap: 20px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .pdf-tools-column li a {
        font-size: 14px;
        min-height: 20px;
        padding: 2px 0;
    }
}

@media (max-width: 767px) {
    .pdf-tools-column-wrapper {
        gap: 15px;
    }
    
    .pdf-tools-column li a {
               min-height: 18px;
        padding: 1px 0;
    }
}

@media (max-width: 575px) {
    .pdf-tools-column-wrapper {
        gap: 12px;
    }
    
    .pdf-tools-column li a {
      
        min-height: 17px;
        padding: 1px 0;
    }
}

@media (max-width: 479px) {
    .pdf-tools-column-wrapper {
        gap: 10px;
        grid-template-columns: minmax(0, 1fr);
    }
    
    .pdf-tools-column li a {
       
        min-height: 17px;
        padding: 1px 0;
    }
}

@media (max-width: 399px) {
    .pdf-tools-column-wrapper {
        gap: 8px;
    }
    
    .pdf-tools-column li a {
        
        min-height: 16px;
        padding: 1px 0;
    }
}

/* Ensure consistent spacing with other footer sections */
@media (max-width: 767px) {
    .pdf-tools-columns {
        margin-top: 20px;
    }
}