/*
Theme Name: FreeImageEditor Modern Gradient
Theme URI: https://cyan-tapir-347475.hostingersite.com
Author: Saqlain Anjum
Author URI: https://cyan-tapir-347475.hostingersite.com
Description: Classic PHP WordPress theme for online image & PDF tools. Modern gradient, glassmorphism cards, responsive, AdSense-ready.
Version: 1.1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: freeimageeditor
*/

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", system-ui, -apple-system, Arial, sans-serif;
    color: #e6eef8;
    background: radial-gradient(800px 400px at 10% 10%, rgba(106,17,203,0.18), transparent 50%),
                radial-gradient(700px 350px at 90% 90%, rgba(37,117,252,0.12), transparent 50%),
                #071028;
    line-height: 1.6;
    padding-top: 76px;
    min-height: 100vh;
    overflow-x: hidden; /* Prevents horizontal scroll */
}

/* Utility */
.container {
    width: 100%;
    max-width: 1200px;
    padding: 0 20px;
    margin: 0 auto;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* -----------------------------
   HEADER - FIXED & GLASSMORPHISM
----------------------------- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 0;
    z-index: 1000;
    transition: all 0.4s ease;
}

.main-header.scrolled {
    background: rgba(10, 10, 20, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-bottom-color: rgba(159, 124, 255, 0.25);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo a {
    font-size: 28px;
    font-weight: 900;
    color: transparent;
    background: linear-gradient(135deg, #9f7cff, #6a11cb);
    -webkit-background-clip: text;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.8px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    padding: 8px 4px;
}

.mobile-menu-btn span {
    display: block;
    width: 26px;
    height: 2.5px;
    background: #fff;
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 3px;
}

/* Navigation */
.main-nav ul {
    display: flex;
    gap: 34px;
    list-style: none;
}

.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 0;
    position: relative;
    transition: all 0.3s ease;
    opacity: 0.95;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    opacity: 1;
    color: #9f7cff;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #9f7cff, #6a11cb);
    border-radius: 2px;
    transition: all 0.35s ease;
    transform: translateX(-50%);
}

.main-nav a:hover::after {
    width: 100%;
}

/* ==================== MEGA MENU (iLovePDF Style) ==================== */
.dropdown {
    position: relative;
}

.dropdown-menu.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    width: 120vw;
    max-width: 420px;
    background: rgba(18, 18, 30, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 3px solid rgba(159, 124, 255, 0.45);
    border-radius: 20px;
    padding: 28px 32px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 9999;
    overflow: hidden;
}

.dropdown:hover > .dropdown-menu.mega-menu,
.dropdown:focus-within > .dropdown-menu.mega-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateX(-50%) translateY(2px);
}

.tools-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.tool-category h3.category-title {
    font-size: 10px;
    font-weight: 800;
    color: #9f7cff;
    text-transform: uppercase;
    letter-spacing: 1.6px;
    margin-bottom: 16px;
    padding-left: 8px;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #e5e7eb;
    transition: all 0.25s ease;
    min-height: 68px;
}

.tool-item:hover,
.tool-item:focus-visible {
    background: rgba(255, 255, 255, 0.09);
    transform: translateX(6px);
    color: #fff;
}

.tool-item-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.tool-item-icon.red    { background: linear-gradient(135deg, #ff5f6d, #ffc371); }
.tool-item-icon.green  { background: linear-gradient(135deg, #11998e, #38ef7d); }
.tool-item-icon.blue   { background: linear-gradient(135deg, #2193b0, #6dd5ed); }
.tool-item-icon.purple { background: linear-gradient(135deg, #834d9b, #d04ed6); }
.tool-item-icon.yellow { background: linear-gradient(135deg, #fce38a, #f38181); }

.tool-item-label {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.tool-desc {
    font-size: 12.5px;
    color: #9ca3af;
    margin-top: 3px;
}

.tool-item:hover .tool-item-label {
    color: #9f7cff;
}

/* -----------------------------
   HERO SECTION
----------------------------- */
.hero {
    margin-top: 40px;
    padding: 90px 0 70px;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 18px;
    line-height: 1.2;
}

.hero h1 span {
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 18px;
    opacity: 0.88;
    max-width: 720px;
    margin: 0 auto 34px;
}

.btn.primary {
    display: inline-block;
    padding: 15px 32px;
    background: linear-gradient(135deg, #6a11cb, #2575fc);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 10px 30px rgba(37, 117, 252, 0.35);
    transition: all 0.3s ease;
}

.btn.primary:hover,
.btn.primary:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(37, 117, 252, 0.45);
}

/* -----------------------------
   GRID CARDS & CONTENT
----------------------------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 26px;
    padding: 50px 0;
}

.card {
    padding: 28px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    transition: all 0.4s ease;
    text-align: center;
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 60px rgba(9,12,28,0.8);
    border-color: rgba(159,124,255,0.35);
}

.card h3 {
    margin: 18px 0 12px;
    font-size: 19px;
    font-weight: 700;
}

.site-content {
    display: flex;
    gap: 34px;
    padding: 50px 0;
}

.content-main {
    flex: 1;
    background: rgba(255,255,255,0.04);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(8px);
}

.sidebar {
    width: 340px;
    flex-shrink: 0;
}

.widget {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 26px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.widget-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    border-bottom: 3px solid #9f7cff;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

/* -----------------------------
   FOOTER
----------------------------- */
.site-footer {
    background: #0a0a14;
    padding: 70px 0 30px;
    margin-top: 120px;
    border-top: 1px solid #222;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 50px;
}

.footer-col h4 {
    font-size: 17px;
    margin-bottom: 20px;
    color: #9f7cff;
    position: relative;
    padding-bottom: 12px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #9f7cff, #6a11cb);
    border-radius: 3px;
}

.footer-col ul li {
    margin-bottom: 11px;
}

.footer-col ul li a {
    color: #bbbbbb;
    text-decoration: none;
    font-size: 14.5px;
    transition: all 0.3s;
}

.footer-col ul li a:hover {
    color: #9f7cff;
    padding-left: 5px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 60px auto 0;
    padding: 30px 30px 0;
    text-align: center;
    border-top: 1px solid #222;
    color: #888;
    font-size: 14px;
}

/* -----------------------------
   RESPONSIVE – PERFECT ON ALL DEVICES
----------------------------- */
@media (max-width: 992px) {
    body {
        padding-top: 70px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 340px;
        height: 100vh;
        background: rgba(10, 10, 20, 0.98);
        backdrop-filter: blur(24px);
        padding: 100px 30px 60px;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 999;
        overflow-y: auto;
    }

    .main-nav.active {
        right: 0;
        box-shadow: -15px 0 50px rgba(0,0,0,0.7);
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .main-nav a {
        display: block;
        padding: 20px 0;
        font-size: 17px;
    }

    .main-nav a::after {
        display: none;
    }

    /* Mobile Mega Menu → Accordion */
    .dropdown-menu.mega-menu {
        position: static;
        width: 100%;
        max-width: none;
        transform: none;
        background: rgba(20,20,35,0.92);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 12px;
        padding: 0;
        box-shadow: none;
        margin: 12px 0;
        opacity: 1;
        visibility: visible;
        pointer-events: all;
        display: none;
    }

    .dropdown.open > .dropdown-menu.mega-menu {
        display: block;
    }

    .tools-categories {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 20px;
    }

    .hero h1 { font-size: 40px; }
    .site-content { flex-direction: column; }
    .sidebar { width: 100%; }
}

@media (max-width: 576px) {
    .header-inner { padding: 0 20px; }
    .logo a { font-size: 24px; }
    .hero { padding: 70px 0 50px; }
    .hero h1 { font-size: 34px; }
    .hero p { font-size: 16.5px; }
    .grid { grid-template-columns: 1fr; }
    .footer-container { grid-template-columns: 1fr; gap: 40px; }
    .card, .content-main, .widget { padding: 24px; }
}

/* Overlay when mobile menu open */
body.menu-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 998;
    backdrop-filter: blur(8px);
}

/* Hamburger → X Animation */
.main-nav.active ~ .mobile-menu-btn span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.main-nav.active ~ .mobile-menu-btn span:nth-child(2) {
    opacity: 0;
}

.main-nav.active ~ .mobile-menu-btn span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}