/*
Theme Name: FAppsTheme Pro
Theme URI: https://fapps.com/
Author: Antigravity
Description: A professional, clean, and high-performance PDF tools theme.
Version: 3.0.0
*/

:root {
    /* Core Palette */
    --primary: #2563eb;
    /* Royal Blue */
    --primary-dark: #1d4ed8;
    --secondary: #0f172a;
    /* Slate 900 */
    --accent: #f59e0b;
    /* Amber 500 */

    /* Neutrals */
    --bg-body: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-dark: #0f172a;

    --text-main: #0f172a;
    --text-body: #475569;
    --text-light: #64748b;

    /* UI */
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 6px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Layout */
    --container: 1280px;
    --header-height: 72px;
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-body);
    color: var(--text-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.2s;
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.5rem;
}

/* Components */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: white;
    border-color: var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Header */
.site-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ================= HEADER & NAVIGATION ================= */
.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1002;
    /* Ensure logo stays above mobile menu */
    position: relative;
}

.site-logo span {
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 2rem;
    height: 100%;
    align-items: center;

    /* Center on desktop */
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links>a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-body);
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
}

.nav-links>a:hover {
    color: var(--primary);
}

/* ===============================================
   DROPDOWN MENU - DESKTOP CONFIGURATION
   =============================================== */

.nav-item-dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-trigger {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: 100%;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
}

.dropdown-trigger:hover {
    color: var(--primary);
}

/* Desktop Dropdown Panel */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;

    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 2rem;

    width: 850px;
    max-width: 92vw;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1000;
}

/* Desktop Hover State */
@media (min-width: 993px) {
    .nav-item-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-top: 8px;
    }
}

/* Dropdown Column Styles */
.dropdown-col {
    display: flex;
    flex-direction: column;
}

.dropdown-col h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 1rem 0;
    letter-spacing: 0.08em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.dropdown-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-col ul li {
    margin: 0;
    padding: 0;
}

.dropdown-col ul a {
    display: block;
    font-size: 0.9rem;
    color: #334155;
    padding: 0.5rem 0;
    text-decoration: none;
    transition: all 0.15s ease;
}

.dropdown-col ul a:hover {
    color: var(--primary);
    padding-left: 0.5rem;
}

.dropdown-col .view-all {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
}

.dropdown-col .view-all:hover {
    padding-left: 0.75rem;
}

/* ================= HERO & SECTIONS ================= */
.hero {
    padding: 8rem 0;
    text-align: center;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.05) 0%, transparent 70%);
}

.hero h1 {
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-body);
    max-width: 600px;
    margin: 0 auto 3rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    text-align: center;
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid var(--border);
}

.stat-val {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    display: block;
    margin-bottom: 0.5rem;
}

.stat-lbl {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-light);
}

/* Tools */
.tools-wrapper {
    background: var(--bg-subtle);
    padding: 6rem 0;
    border-top: 1px solid var(--border);
}

.category-block {
    margin-bottom: 5rem;
}

.cat-heading {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.cat-icon {
    width: 32px;
    height: 32px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.2s;
    position: relative;
    top: 0;
    text-decoration: none;
}

.tool-item:hover {
    top: -4px;
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.t-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-subtle);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.t-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.t-desc {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: 4.5em;
}

.t-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Footer */
.main-footer {
    background: var(--bg-dark);
    color: white;
    padding: 5rem 0 2rem;
}

.footer-cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.f-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* ================= MOBILE & RESPONSIVE ================= */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1003;
    /* Highest priority */
}

.mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: 0.3s;
}

.mobile-action {
    display: none;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .header-actions {
        display: none;
    }

    /* Off-Canvas Menu Container */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        /* Top padding for close button/logo area */
        gap: 0;

        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        z-index: 1001;
    }

    .nav-links.active {
        transform: translateX(0);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    }

    /* Disable body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }

    .nav-links>a {
        font-size: 1.25rem;
        width: 100%;
        display: block;
        padding: 1.25rem 0;
        height: auto;
        border-bottom: 1px solid var(--border);
        color: var(--text-main);
    }

    /* ===============================================
       MOBILE DROPDOWN - ACCORDION STYLE
       =============================================== */

    .nav-item-dropdown {
        width: 100%;
        display: block;
        height: auto;
        position: static;
        border-bottom: 1px solid var(--border);
    }

    .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 1.25rem 0;
        font-size: 1.25rem;
        font-weight: 600;
        display: flex;
        height: auto;
    }

    /* Reset all desktop styles for mobile */
    .dropdown-menu {
        position: static;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        min-width: auto;
        max-width: none;

        background: #f8fafc;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 1rem 0 1rem 1rem;
        margin: 0;

        /* Layout: Simple vertical stack */
        display: none;
        grid-template-columns: 1fr;
        gap: 1.5rem;

        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        z-index: auto;
    }

    /* Show dropdown when parent is active */
    .nav-item-dropdown.active .dropdown-menu {
        display: flex;
        flex-direction: column;
    }

    /* Mobile column styling */
    .dropdown-col {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .dropdown-col h4 {
        color: var(--primary);
        border-bottom: 2px solid #cbd5e1;
        margin-bottom: 0.75rem;
        font-size: 0.85rem;
    }

    .dropdown-col ul {
        padding: 0;
        margin: 0;
    }

    .dropdown-col ul li {
        margin: 0;
    }

    .dropdown-col ul a {
        padding: 0.875rem 0.5rem;
        font-size: 1rem;
        border-bottom: 1px solid #f1f5f9;
        color: var(--text-main);
    }

    .dropdown-col ul a:hover {
        background: rgba(59, 130, 246, 0.05);
        color: var(--primary);
        padding-left: 1rem;
    }

    .dropdown-col ul li:last-child a {
        border-bottom: none;
    }

    .mobile-action {
        display: block;
        width: 100%;
        margin-top: 2rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
        padding-top: 2rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .footer-cols {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-logo img {
        height: 35px !important;
    }
}

/* ... (existing styles) ... */

/* Fix Dropdown Contrast */
.dropdown-menu {
    /* ... */
    color: #0f172a;
    /* Force dark text base */
}

.dropdown-col h4 {
    color: #64748b;
    /* Slate 500 */
}

.dropdown-col ul a {
    color: #334155 !important;
    /* Force dark slate */
}

.dropdown-col ul a:hover {
    color: var(--primary) !important;
}

/* Fix Content List Alignment (Step-by-Step) */
.content-body ol,
.content-body ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
    /* Ensure numbers are inside */
}

.content-body li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

/* Workspace */
.tool-workspace {
    margin: 4rem auto;
    text-align: center;
}

.dropzone-area {
    background: var(--bg-subtle);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    margin-bottom: 2rem;
    cursor: pointer;
}



.dropzone-area:hover {
    border-color: var(--primary);
    background: #eff6ff;
}