﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

/* Root Variables */
:root {
    --bg-color: #0f1116;
    --text-color: #fff;
    --accent-color: #4bd3ff;
    --card-bg: rgba(255,255,255,0.06);
    --card-border: rgba(255,255,255,0.1);
    --header-link: #cfcfcf;
}

body.light-mode {
    --bg-color: #f4f4f4;
    --text-color: #111;
    --accent-color: #1a73e8;
    --card-bg: rgba(255,255,255,0.85);
    --card-border: rgba(0,0,0,0.15);
    --header-link: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    transition: background 0.3s, color 0.3s;
    scroll-behavior: smooth;
}

/* HEADER */
header {
    position: sticky;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    backdrop-filter: blur(12px);
    background: rgba(15,17,22,0.6);
    border-bottom: 1px solid var(--card-border);
    z-index: 100;
}

.logo {
    font-size: 28px;
    font-weight: 700;
}

    .logo span {
        color: var(--accent-color);
    }

nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

    nav a {
        color: var(--header-link);
        text-decoration: none;
        font-weight: 500;
        transition: 0.3s;
    }

        nav a:hover {
            color: var(--accent-color);
        }

/* Theme Toggle Button */
#theme-toggle {
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    margin-left: 15px;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px;
    min-width: 200px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

    .dropdown-content a {
        display: block;
        text-decoration: none;
        color: var(--text-color);
        padding: 6px 0;
        transition: color 0.2s;
    }

        .dropdown-content a:hover {
            color: var(--accent-color);
        }

.dropdown:hover .dropdown-content {
    display: block;
}

/* HERO SECTION */
.hero {
    text-align: center;
    padding: 120px 20px;
}

    .hero h1 {
        font-size: 54px;
        font-weight: 700;
        background: linear-gradient(90deg, var(--accent-color), #5f8dff);
        -webkit-background-clip: text;
        color: transparent;
        animation: shine 3s ease-in-out infinite alternate;
    }

    .hero p {
        margin-top: 15px;
        font-size: 18px;
        opacity: 0.85;
    }

.primary-btn {
    margin-top: 30px;
    padding: 18px 40px;
    background: var(--accent-color);
    border: none;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

    .primary-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(75,211,255,0.4);
    }

/* TOOLS SECTION */
.tools {
    padding: 80px 5%;
}

    .tools h2 {
        text-align: center;
        margin-bottom: 50px;
        font-size: 32px;
        color: var(--accent-color);
        letter-spacing: 1px;
        font-weight: 600;
    }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.tool-card {
    background: var(--card-bg);
    padding: 30px 20px;
    border-radius: 16px;
    text-align: center;
    font-size: 18px;
    backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

    .tool-card:hover {
        transform: translateY(-5px) scale(1.03);
        border-color: var(--accent-color);
        box-shadow: 0 0 35px rgba(75,211,255,0.35);
    }

/* Animations */
@keyframes shine {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px;
    background: var(--card-bg);
    border-radius: 16px;
    text-align: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

    .tool-card img.tool-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 15px;
        padding: 10px;
        border-radius: 50%;
        background: linear-gradient(135deg, #4bd3ff, #5f8dff);
        box-shadow: 0 4px 15px rgba(75, 211, 255, 0.3);
        transition: transform 0.3s, box-shadow 0.3s;
    }

    .tool-card:hover img.tool-icon {
        transform: scale(1.2);
        box-shadow: 0 8px 25px rgba(75, 211, 255, 0.6);
    }

    .tool-card p {
        margin-top: 5px;
        font-weight: 500;
        color: var(--text-color);
        text-align: center;
    }

.logo {
    display: flex;
    align-items: center;
    gap: 10px; /* space between icon and text */
}

.logo-icon {
    width: 40px; /* desired display width in header */
    height: 40px; /* desired display height */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* keeps original aspect ratio */
    margin-right: 4px;
}

.pdf-preview-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.pdf-thumbnail {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
}

    .pdf-thumbnail img {
        width: 60px;
        height: 60px;
        margin-bottom: 5px;
    }

    .pdf-thumbnail p {
        font-size: 12px;
        text-align: center;
        word-break: break-all;
    }
/* ---------- Merge Panel ---------- */
.pdf-merge-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.panel-content {
    background: #fff;
    padding: 25px;
    width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.2);
    animation: pop 0.2s ease-out;
}

@keyframes pop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.close-btn {
    
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
}

/* ---------- PDF Thumb ---------- */
.pdf-preview-container {
    margin-top: 15px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.pdf-thumb {
    text-align: center;
}

.thumb-img {
    width: 100%;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.file-name {
    font-size: 12px;
    margin-top: 5px;
}

.pdf-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.pdf-thumbnail {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    width: fit-content;
}

.thumb-img-large {
    width: 300px; /* bigger preview */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}
/* FULLSCREEN OVERLAY PANEL */
#pdf-merge-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none; /* hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    /* CENTERED MODAL BOX */
    #pdf-merge-panel .panel-content {
        width: 70vw;
        max-width: 900px;
        height: 80vh;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-shadow: 0 0 30px rgba(0,0,0,0.35);
    }

/* CLOSE BUTTON */
#close-merge-panel {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-color);
    margin-bottom: 10px;
}

/* TITLE */
#pdf-merge-panel h2 {
    text-align: center;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    #pdf-merge-panel .panel-content {
        width: 95vw;
        height: 95vh;
        padding: 15px;
    }
}


/* PREVIEW CONTAINER */
.pdf-preview-container {
    margin-top: 20px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    padding-bottom: 20px;
}

.pdf-thumbnail {
    position: relative;
    display: inline-block;
    margin: 10px;
    text-align: center;
}

.pdf-close-tab {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    font-weight: bold;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.thumb-img-large {
    display: block;
    margin: 5px auto;
    border: 1px solid #ccc;
}

#add-more-pdfs {
    display: inline-block; /* keep it inline with other elements */
    padding: 10px 20px; /* make it taller and wider */
    margin: 10px 5px 0 0; /* spacing around button */
    font-size: 16px; /* readable text */
    border: none; /* clean look */
    border-radius: 5px; /* rounded corners */
    background-color: #007bff; /* primary color */
    color: white; /* text color */
    cursor: pointer;
    transition: background 0.3s;
}

/* SPLIT PANEL */
#pdf-split-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    /* Make sure panel content is relative for absolute close button */
    #pdf-split-panel .panel-content {
        position: relative; /* ADD THIS */
        width: 80vw; /* make panel wider */
        max-width: 1200px;
        height: 90vh; /* almost full height */
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px 25px 80px 25px; /* bottom padding for buttons */
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* Close button */
#close-split-panel {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    z-index: 10;
}
/* Scrollable thumbnails area */
#pdf-split-preview {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}


/* Each page */
.split-page {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    width: 200px; /* fixed size, adjust as needed */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border 0.2s;
}

    .split-page.selected {
        border: 6px solid #007bff; /* highlight selected pages */
    }

    .split-page canvas {
        width: 100%;
        height: auto;
        border-radius: 5px;
    }

#split-add-more {
    display: inline-block; /* keep it inline with other elements */
    padding: 10px 20px; /* make it taller and wider */
    margin: 10px 5px 0 0; /* spacing around button */
    font-size: 19px; /* readable text */
    border: none; /* clean look */
    border-radius: 4px; /* rounded corners */
    background-color: #007bff; /* primary color */
    color: white; /* text color */
    cursor: pointer;
    transition: background 0.3s;
}

    #split-add-more:hover {
        background-color: #0056b3; /* darker on hover */
    }

#pdf-split-preview .page-div {
    cursor: pointer;
    position: relative;
    display: inline-block;
    margin: 5px;
    border: 2px solid transparent;
    border-radius: 5px;
    transition: border 0.2s;
}
/*
    #pdf-split-preview .page-div.selected {
        border: 3px solid #007bff;
        box-shadow: 0 0 10px rgba(0,123,255,0.4);
    }*/

    #pdf-split-preview .page-div.selected {
        border: 6px solid var(--accent-color);
        box-shadow: 0 0 10px rgba(75,211,255,0.6);
    }

/*#pdf-split-preview .page-div.selected {
    border-color: #ff3b30;*/ /* bold red */
    /*box-shadow: 0 0 15px rgba(255, 59, 48, 0.8);
    transform: scale(1.07);
}

    #pdf-split-preview .page-div.selected::before {
        background: #ff3b30;
    }*/
/* ============================
   SPLIT PDF BUTTON LARGER STYLE
============================ */
#split-selected-pages {
    padding: 15px 30px; /* bigger size */
    font-size: 24px; /* bigger text */
    font-weight: 700; /* bold text */
    background-color: #007bff; /* primary blue */
    color: white; /* white text */
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 15px;
    width: 100%; /* full width of container */
    text-align: center;
}
/* Split buttons – base (desktop & mobile) */
#split-add-more,
#split-selected-pages,
#fixed-ranges button,
#apply-range {
    padding: 8px 12px;
    font-size: 15px;
    border-radius: 8px;
    min-height: 40px;
}

    #split-selected-pages:hover {
        background-color: #0056b3;
        transform: translateY(-3px);
    }


.pdf-info {
    font-size: 16px;
    color: var(--text-color);
    text-align: center;
    margin: 15px 0;
}

footer.footer-section {
    text-align: center;
    padding: 15px;
    background: var(--card-bg); /* ✅ dark/light aware */
    color: var(--text-color); /* ✅ dark/light aware */
    font-size: 16px;
    border-top: 1px solid var(--card-border);
    margin-top: 180px;
    font-weight: bold;
}


    footer.footer-section a {
        color: var(--accent-color);
        text-decoration: none;
    }

        footer.footer-section a:hover {
            text-decoration: underline;
        }

@media (max-width: 768px) {
    footer.footer-section {
        font-size: 13px;
        white-space: nowrap; /* ⛔ no line break */
        overflow-x: auto; /* allow scroll if needed */
        padding: 10px 8px;
    }

        footer.footer-section p {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 6px;
            flex-wrap: nowrap; /* ⛔ stay one line */
        }

        footer.footer-section a {
            white-space: nowrap;
        }
}


.page-div {
    cursor: grab;
}

    .page-div.dragging {
        opacity: 0.4;
        transform: scale(0.95);
    }

    .page-div.drag-over {
        outline: 3px dashed var(--accent-color);
    }

@media (max-width: 768px) {

    #pdf-split-panel .panel-content {
        width: 96vw;
        height: 96vh;
        padding: 10px;
    }

    label {
        font-size: 12px;
        margin-bottom: 2px;
    }
}



@media (max-width: 768px) {

    /* ===============================
       CUSTOM RANGE – LABEL + INPUT ROW
    =============================== */
    #pdf-split-panel #range-selection {
        display: grid !important;
        grid-template-columns: auto 1fr;
        gap: 6px 8px;           /* tight spacing */
        align-items: center;
        margin-top: 6px;
    }

    #pdf-split-panel #range-selection label {
        font-size: 12px;
        white-space: nowrap;
        margin: 0;
    }

    #custom-range {
        width: 100%;
        padding: 6px 8px;
        font-size: 13px;
    }

    /* Apply button below, full width */
    #apply-range {
        grid-column: 1 / -1;
        width: 91% !important;
        min-width: unset !important;
        padding: 8px !important;
        font-size: 14px !important;
        margin-top: 2px;
    }

    /* ===============================
       FIXED RANGE BUTTONS – 2 PER ROW
    =============================== */
    #fixed-ranges {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;               /* reduced row gap */
        margin-top: 6px;
    }

    #fixed-ranges button {
        min-width: unset !important;
        padding: 0 !important;
        font-size: 13px !important;
    }

    /* ===============================
       FOOTER BUTTONS – 2 PER ROW
    =============================== */
    .split-footer {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        gap: 0;
        margin-top: 0;
    }

    #split-add-more,
    #split-selected-pages {
        min-width: unset !important;
        padding: 10px !important;
        font-size: 14px !important;
    }
}


/* ============================
   REARRANGE PANEL
============================ */
#pdf-rearrange-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    /* Panel content */
    #pdf-rearrange-panel .panel-content {
        position: relative;
        width: 80vw;
        max-width: 1200px;
        height: 90vh;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px 25px 80px 25px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* Close button */
#close-rearrange-panel {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    z-index: 10;
}

/* ============================
   REARRANGE PREVIEW AREA
============================ */
#rearrange-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}

    /* Each draggable page */
    #rearrange-preview .page-div {
        cursor: grab;
        position: relative;
        display: inline-block;
        margin: 5px;
        border: 2px solid transparent;
        border-radius: 8px;
        width: 200px;
        flex-shrink: 0;
        transition: border 0.2s, transform 0.2s, box-shadow 0.2s;
        background: rgba(255,255,255,0.05);
    }

        /* Canvas inside page */
        #rearrange-preview .page-div canvas {
            width: 100%;
            height: auto;
            border-radius: 5px;
        }

        /* Dragging state */
        #rearrange-preview .page-div.dragging {
            opacity: 0.4;
            transform: scale(0.95);
            cursor: grabbing;
        }

        /* Drag over target */
        #rearrange-preview .page-div.drag-over {
            border: 3px dashed var(--accent-color);
            box-shadow: 0 0 12px rgba(75,211,255,0.6);
        }

/* ============================
   REARRANGE EXPORT BUTTON
============================ */
#export-rearranged {
    padding: 15px 30px;
    font-size: 24px;
    font-weight: 700;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 15px;
    width: 100%;
    text-align: center;
}

    #export-rearranged:hover {
        background-color: #0056b3;
        transform: translateY(-3px);
    }
/* ============================
   REARRANGE PAGE OVERLAYS
============================ */

/* Page number badge */
#rearrange-preview .page-number {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
    pointer-events: none;
}

/* Delete (X) button */
#rearrange-preview .delete-page {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    z-index: 6;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s;
}

/* Show delete button on hover */
#rearrange-preview .page-div:hover .delete-page {
    opacity: 1;
    transform: scale(1);
}

/* CENTER pages in Rearrange preview */
#rearrange-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* ✅ center horizontally */
    align-items: flex-start;
    gap: 15px;
}


@media (max-width: 768px) {
    #pdf-rearrange-panel .panel-content {
        width: 95vw;
        height: 95vh;
        padding: 15px;
    }
}

/* ============================
   PDF TO IMAGES PANEL
============================ */
#pdf-to-images-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    /* Panel content */
    #pdf-to-images-panel .panel-content {
        position: relative;
        width: 80vw;
        max-width: 1200px;
        height: 90vh;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px 25px 80px 25px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* Close button */
#close-pdf-to-images-panel {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    z-index: 10;
}

/* ============================
   PDF TO IMAGES PREVIEW
============================ */
#pdf-to-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}

    /* Image thumbnails */
    #pdf-to-images-preview img {
        width: 200px;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        transition: transform 0.2s, box-shadow 0.2s;
    }

        #pdf-to-images-preview img:hover {
            transform: scale(1.05);
            box-shadow: 0 8px 20px rgba(0,0,0,0.4);
        }

/* ============================
   DOWNLOAD BUTTON
============================ */
#download-images {
    padding: 15px 30px;
    font-size: 24px;
    font-weight: 700;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    margin-top: 15px;
    width: 100%;
    text-align: center;
}

    #download-images:hover {
        background-color: #0056b3;
        transform: translateY(-3px);
    }
/* ============================
   PDF TO IMAGES OVERLAYS
============================ */

#pdf-to-images-preview .image-wrapper {
    position: relative;
}

#pdf-to-images-preview .page-number {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.75);
    color: white;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    z-index: 5;
}

#pdf-to-images-preview .delete-page {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    font-size: 18px;
    font-weight: bold;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    z-index: 6;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.2s;
}

#pdf-to-images-preview .image-wrapper:hover .delete-page {
    opacity: 1;
    transform: scale(1);
}

/* CENTER pages in PDF → Images preview */
#pdf-to-images-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* center thumbnails */
    align-items: flex-start;
    gap: 15px;
}


@media (max-width: 768px) {
    #pdf-to-images-panel .panel-content {
        width: 95vw;
        height: 95vh;
        padding: 15px;
    }
}

/* ============================
   IMAGES TO PDF PANEL
============================ */

#images-to-pdf-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    #images-to-pdf-panel .panel-content {
        position: relative;
        width: 80vw;
        max-width: 1200px;
        height: 90vh;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px 25px 80px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

#close-images-to-pdf-panel {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

/* Preview area */
#images-to-pdf-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    overflow-y: auto;
    flex: 1;
    padding: 10px;
}

    /* Image wrapper */
    #images-to-pdf-preview .image-wrapper {
        position: relative;
        cursor: grab;
        border-radius: 8px;
    }

    /* Image */
    #images-to-pdf-preview img {
        width: 200px;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

    /* Page number */
    #images-to-pdf-preview .page-number {
        position: absolute;
        top: 6px;
        left: 6px;
        background: rgba(0,0,0,0.75);
        color: white;
        font-size: 14px;
        font-weight: 700;
        padding: 4px 8px;
        border-radius: 6px;
        z-index: 5;
    }

    /* Delete button */
    #images-to-pdf-preview .delete-page {
        position: absolute;
        top: 6px;
        right: 6px;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        background: rgba(255,59,48,0.9);
        color: white;
        font-size: 18px;
        font-weight: bold;
        line-height: 26px;
        text-align: center;
        cursor: pointer;
        opacity: 0;
        transition: opacity 0.2s;
    }

    #images-to-pdf-preview .image-wrapper:hover .delete-page {
        opacity: 1;
    }

/* CENTER images in Images → PDF preview */
#images-to-pdf-preview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* center thumbnails */
    align-items: flex-start;
    gap: 15px;
}


@media (max-width: 768px) {
    #images-to-pdf-panel .panel-content {
        width: 95vw;
        height: 95vh;
        padding: 15px;
    }
}

/* ============================
   CODE TO PDF PANEL
============================ */

#code-to-pdf-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    #code-to-pdf-panel .panel-content {
        position: relative;
        width: 80vw;
        max-width: 1100px;
        height: 90vh;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px 25px 90px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* Close button */
#close-code-panel {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

/* Header */
#code-to-pdf-panel h2 {
    margin-bottom: 15px;
}

/* Language selector */
#code-language {
    width: 220px;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
}

/* Code input area */
#code-input {
    flex: 1;
    width: 100%;
    resize: none;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: #0f172a; /* Dark editor background */
    color: #e5e7eb; /* Code text color */
    padding: 18px;
    font-family: "Fira Code", Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

    /* Scrollbar styling */
    #code-input::-webkit-scrollbar {
        width: 8px;
    }

    #code-input::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 6px;
    }

/* Export button */
#export-code-pdf {
    position: static;
    bottom: 25px;
    left: 25px;
    padding: 14px 34px;
    border-radius: 14px;
    border: none;
    background: #38bdf8;
    color: #020617;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(56,189,248,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    #export-code-pdf:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 35px rgba(56,189,248,0.5);
    }

@media (max-width: 768px) {
    #code-to-pdf-panel .panel-content {
        width: 95vw;
        height: 95vh;
        padding: 15px;
    }
}


/* ============================
   OCR PANEL – EXTRACT TEXT
============================ */

#ocr-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

    #ocr-panel .panel-content {
        position: relative;
        width: 80vw;
        max-width: 1100px;
        height: 90vh;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        border-radius: 18px;
        padding: 25px 25px 90px;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

/* Close button */
#close-ocr-panel {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

/* Header */
#ocr-panel h2 {
    margin-bottom: 15px;
}

/* Select Image button */
#ocr-select-image {
    width: 200px;
    padding: 12px 20px;
    border-radius: 14px;
    border: none;
    background: #38bdf8;
    color: #020617;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(56,189,248,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    #ocr-select-image:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 35px rgba(56,189,248,0.5);
    }

/* Preview container */
#ocr-preview {
    flex: 1;
    width: 100%;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: #0f172a;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Extract Text button */
#ocr-extract-text {
    width: 200px;
    padding: 12px 20px;
    border-radius: 14px;
    border: none;
    background: #22c55e; /* Green for action */
    color: #020617;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 10px 25px rgba(34,197,94,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    #ocr-extract-text:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 35px rgba(34,197,94,0.5);
    }

/* Extracted text area */
#ocr-result {
    width: 100%;
    height: 200px;
    margin-top: 10px;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    background: #0f172a;
    color: #e5e7eb;
    padding: 18px;
    font-family: "Fira Code", Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    overflow-y: auto;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
}

    /* Scrollbar styling for OCR textarea */
    #ocr-result::-webkit-scrollbar {
        width: 8px;
    }

    #ocr-result::-webkit-scrollbar-thumb {
        background: rgba(255,255,255,0.2);
        border-radius: 6px;
    }

@media (max-width: 768px) {

    /* OCR panel size */
    #ocr-panel .panel-content {
        width: 95vw;
        height: 95vh;
        padding: 15px;
    }

    /* Preview container – full width */
    #ocr-preview {
        width: 100%;
        min-height: 180px;
    }

    /* Extracted text area – full width */
    #ocr-result {
        width: 100%;
        height: 160px;
    }

    /* BUTTON ROW (Select Image + Extract Text) */
    #ocr-select-image,
    #ocr-extract-text {
        width: 50%;
        padding: 10px;
        font-size: 14px;
        background-color: #007bff; /* blue */
        color: #fff;
        border-radius: 10px;
    }

        #ocr-select-image:hover,
        #ocr-extract-text:hover {
            background-color: #0056b3;
        }

    /* Wrap buttons side-by-side */
    #ocr-select-image,
    #ocr-extract-text {
        display: inline-block;
    }

    /* Button container spacing fix */
    #ocr-panel .panel-content > button {
        margin: 4px 0;
    }
}
@media (max-width: 768px) {

    /* Extracted text area – green border on focus */
    #ocr-result:focus {
        border: 2px solid #22c55e; /* green */
        outline: none;
        box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    }
}



.editor-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    flex-direction: column;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: center;
    justify-content: flex-start;
    overflow: auto;
}

.editor-toolbar {
    width: 100%;
    display: flex;
    gap: 10px;
    padding: 10px;
    background: #fff;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

    .editor-toolbar button {
        padding: 8px 12px;
        cursor: pointer;
        font-size: 14px;
    }

.editor-preview {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    width: 100%;
    max-width: 1200px;
}

    .editor-preview canvas {
        border: 1px solid #ccc;
        cursor: crosshair;
    }

.editor-panel {
    display: none;
    flex-direction: column;
    background: #f0f0f0;
    padding: 10px;
}

.editor-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
}

.browser-style {
    background: #e0e0e0;
    padding: 5px;
    align-items: center;
}

.tools-style {
    background: #f8f8f8;
    padding: 5px;
    align-items: center;
}

.preview-container {
    overflow: auto;
    background: #fff;
    border: 1px solid #ccc;
    flex-grow: 1;
    padding: 5px;
}

canvas {
    display: block;
    margin: 10px auto;
    border: 1px solid #ccc;
}
/* ==============================
   PDF Editor Panel
============================== */

.editor-panel {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
}

/* Close button */
#close-pdf-editor-panel {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #007bff; /* blue */
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0,0,0,0.3);
    transition: 0.2s;
    z-index: 20;
    display: flex; /* added */
    align-items: center; /* center vertically */
    justify-content: center; /* center horizontally */
}

    #close-pdf-editor-panel:hover {
        background: #0056b3; /* darker blue */
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    }


/* Toolbar */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 15px;
    background: #1e1e2f;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    align-items: center;
}

    .editor-toolbar button {
        background: #007bff; /* blue */
        color: #fff;
        border: none;
        border-radius: 8px;
        padding: 8px 14px;
        font-size: 14px;
        cursor: pointer;
        transition: 0.2s;
    }

        .editor-toolbar button:hover {
            background: #0056b3; /* darker blue on hover */
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.3);
        }

    .editor-toolbar input[type="color"],
    .editor-toolbar input[type="number"] {
        border: none;
        border-radius: 8px;
        padding: 6px 8px;
        cursor: pointer;
        font-size: 14px;
    }

/* Preview container */
.preview-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 75vh;
    background: #fdfdfd;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    margin-top: 20px;
    overflow: auto;
    padding: 10px;
}

    .preview-container canvas {
        display: block;
        margin: 15px auto;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        cursor: crosshair;
    }

/* Apply button */
#apply-changes-btn {
    margin-top: 15px;
    padding: 12px 28px;
    border: none;
    border-radius: 10px;
    background: #007bff; /* blue */
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0,123,255,0.4);
    transition: 0.2s;
}

    #apply-changes-btn:hover {
        background: #0056b3; /* darker blue */
        transform: translateY(-2px);
        box-shadow: 0 12px 28px rgba(0,123,255,0.5);
    }
/* ===== Header ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #1e1e2f;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    position: relative;
    gap: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 26px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing:-0.5px;
}

    .logo span {
        color: #38bdf8; /* Highlight part of logo */
    }

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

    /* Simple links */
    nav a {
        color: #fff;
        text-decoration: none;
        font-weight: 500;
        transition: 0.2s;
    }

        nav a:hover {
            color: #38bdf8;
        }

/* Dropdown container */
.dropdown {
    position: relative;
    display: inline-block;
}

/* Dropdown button */
.dropbtn {
    background: #3b3b5f;
    color: white;
    padding: 8px 14px;
    font-size: 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

    .dropbtn:hover {
        background: #5c5ca3;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }

/* Dropdown content */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2a2a4a;
    min-width: 180px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
    padding: 8px 0;
    z-index: 10;
    top: 40px;
}

    .dropdown-content button {
        width: 100%;
        padding: 8px 14px;
        background: none;
        border: none;
        text-align: left;
        color: #fff;
        font-size: 14px;
        cursor: pointer;
        transition: 0.2s;
    }

        .dropdown-content button:hover {
            background: #38bdf8;
            color: #020617;
        }

/* Show dropdown on hover (optional, can be JS controlled) */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Theme toggle */
#theme-toggle {
    background: beige;
    color: #020617;
    border: none;
    padding: 4px 8px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s;
}

    #theme-toggle:hover {
        background: beige;
    }

/* ==============================
   GLOBAL BUTTON STYLES
============================== */

button,
button.primary-btn,
button.secondary-btn {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    transition: background 0.3s, color 0.2s, transform 0.15s;
    outline: none;
    text-align: center;
    font-weight: 600;
}

    /* Primary buttons (big actions) */
    button.primary-btn,
    #merge-selected-pdfs,
    #split-selected-pages,
    #apply-range {
        background-color: #007bff;
        color: #fff;
        padding: 14px 28px;
        font-size: 18px;
        min-width: 180px;
    }

        button.primary-btn:hover,
        #merge-selected-pdfs:hover,
        #split-selected-pages:hover,
        #apply-range:hover {
            background-color: #005bb5;
            transform: translateY(-2px);
        }

    /* Secondary buttons */
    button.secondary-btn,
    #add-more-pdfs,
    #split-add-more {
        background-color: #6c757d;
        color: #fff;
        padding: 12px 24px;
        font-size: 17px;
        min-width: 160px;
    }

        button.secondary-btn:hover,
        #add-more-pdfs:hover,
        #split-add-more:hover {
            background-color: #5a6268;
            transform: translateY(-2px);
        }

/* Small range / fixed buttons */
#fixed-ranges button,
#apply-range {
    background-color: #17a2b8; /* teal accent */
    color: white;
    padding: 10px 18px;
    font-size: 15px;
}

    #fixed-ranges button:hover,
    #apply-range:hover {
        background-color: #138496;
    }

/* Disabled state */
button:disabled,
button.primary-btn:disabled,
button.secondary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ---------------- MOBILE MENU ---------------- */

.mobile-only {
    display: none;
}

/* Hamburger */
#mobile-menu-btn {
    background: black;
    color: #fff;
    border: none;
    font-size: 29px;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}
/* Slide menu from left */
#mobile-menu {
    position: fixed;
    top: 0;
    left: -280px; /* Start off-screen on the left */
    width: 280px;
    height: 100vh;
    background: #1e1e2f;
    color: #fff;
    padding: 20px;
    z-index: 2000;
    transition: left 0.3s ease; /* animate left instead of right */
    display: flex;
    flex-direction: column;
    gap: 12px;
}

    /* Headings inside menu */
    #mobile-menu h4 {
        margin-top: 15px;
        margin-bottom: 5px;
        color: #38bdf8;
    }

    /* Links and buttons inside menu */
    #mobile-menu a,
    #mobile-menu button {
        background: none;
        border: none;
        color: #fff;
        text-align: left;
        font-size: 16px;
        cursor: pointer;
    }

        #mobile-menu button:hover,
        #mobile-menu a:hover {
            color: #38bdf8;
        }

/* Close button */
#close-mobile-menu {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 22px;
    color: #fff;
    cursor: pointer;
}

/* Active class to slide in */
#mobile-menu.active {
    left: 0; /* Slide into view */
}


/* ---------- RESPONSIVE RULE ---------- */
@media (max-width: 767px) {
    .main-nav {
        display: none;
    }

    .mobile-only {
        display: block;
    }
}
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mobile-theme-toggle {
    display: none; /* hidden on desktop */
}

@media (max-width: 768px) {

    header {
        position: relative;
        min-height: 56px; /* ensures consistent vertical centering */
    }

    #mobile-theme-toggle {
        position: absolute;
        top: 50%;
        right: 14px;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        height: 40px;
        width: 40px;
        font-size: 30px;
        line-height: 1;
        padding: 0;
        z-index: 2000;
    }
}



/* HEADER FLEX FOR MOBILE ONLY */
@media (max-width: 768px) {
    header {
        display: flex;
        align-items: center;
        justify-content: flex-start; /* stick everything to left */
        gap: 0px; /* spacing between burger, logo, and toggle */
        padding: 10px 15px;
    }

    #mobile-menu-btn {
        font-size: 28px;
        padding: 6px 12px;
        border-radius: 5px;
        
    }

    .logo {
        display: flex;
        align-items: center;
    }

        .logo img {
            margin-right: 5px;
            margin-left: 5px;
        }

    .mobile-theme-toggle {
        display: block; /* ensure it's visible */
        margin-left: 8px; /* spacing after logo */
        font-size: 20px;
        background: none;
        border: none;
        cursor: pointer;
    }
}


/* TOOL CARDS */
.tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px; /* smaller gap */
    text-align: center;
}

    .tool-card img.tool-icon {
        width: 60px;
        height: 60px;
        object-fit: contain;
    }

    .tool-card p {
        margin: 0;
        font-weight: 600;
        font-size: 16px; /* keep title readable */
        color: inherit; /* keep original color */
    }

    .tool-card .tool-desc {
        font-weight: 100;
        font-size: 10px; /* very small */
        color: #9ca3af; /* subtle gray for description */
        line-height: 1.3;
    }

/* GRID LAYOUT */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .tool-card img.tool-icon {
        width: 50px;
        height: 50px;
    }

    .tool-card p {
        font-size: 16px;
    }

    .tool-card .tool-desc {
        font-size: 11px;
    }
}

/* ==============================
   WHY ULTRAPDF SECTION
============================== */

.why-ultrapdf {
    padding: 90px 6%;
    background: radial-gradient( circle at top, rgba(75,211,255,0.06), transparent 60% ), var(--bg-color);
    text-align: center;
}

    .why-ultrapdf h2 {
        font-size: 40px;
        font-weight: 800;
        margin-bottom: 60px;
        letter-spacing: -0.5px;
    }

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 36px;
}

/* Card */
.why-card {
    background: linear-gradient( 180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02) );
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 36px 32px;
    text-align: left;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

    /* Accent glow strip */
    .why-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: linear-gradient( 90deg, var(--accent-color), transparent );
        opacity: 0.8;
    }

    /* Hover effect */
    .why-card:hover {
        transform: translateY(-10px);
        border-color: rgba(75,211,255,0.6);
        box-shadow: 0 20px 55px rgba(75,211,255,0.35);
    }

/* Icon */
.why-icon {
    font-size: 40px;
    margin-bottom: 18px;
}

/* Title */
.why-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 700;
}

/* Description */
.why-card p {
    font-size: 15.5px;
    line-height: 1.7;
    opacity: 0.9;
}


/* ==============================
   TRUST SECTION
============================== */

.trust-section {
    padding: 80px 8%;
    background: linear-gradient( 180deg, var(--bg-color), rgba(75,211,255,0.08) );
    text-align: center;
}

    .trust-section h2 {
        font-size: 42px;
        font-weight: 800;
        margin-bottom: 22px;
        letter-spacing: -0.6px;
    }

    .trust-section p {
        max-width: 900px;
        margin: 0 auto;
        font-size: 19px;
        line-height: 1.8;
        opacity: 0.9;
    }


/* ==============================
   MOBILE TUNING
============================== */

@media (max-width: 768px) {

    .why-ultrapdf {
        padding: 60px 16px;
    }

        .why-ultrapdf h2 {
            font-size: 28px;
            margin-bottom: 40px;
        }

    .why-card {
        padding: 26px 22px;
    }

    .why-icon {
        font-size: 32px;
    }

    .why-card h3 {
        font-size: 19px;
    }

    .why-card p {
        font-size: 14.5px;
    }

    .trust-section {
        padding: 50px 16px;
    }

        .trust-section h2 {
            font-size: 28px;
        }

        .trust-section p {
            font-size: 15px;
        }
}

/* ===============================
   MOBILE MENU – FINAL FIXED
=============================== */

#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: #1e1e2f;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 9999; /* ABOVE everything */
    display: flex;
    flex-direction: column;
    padding: 16px;
    pointer-events: auto;
}

    #mobile-menu.active {
        transform: translateX(0);
    }

/* Close button */
#close-mobile-menu {
    align-self: flex-end;
    font-size: 26px;
    background: none;
    border: none;
    color: #fff;
    margin-bottom: 12px;
    cursor: pointer;
}

/* Navigation */
.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    /* Section headings */
    .mobile-nav h4 {
        margin-top: 16px;
        margin-bottom: 6px;
        font-size: 13px;
        font-weight: 700;
        color: #38bdf8;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Links & buttons */
    .mobile-nav a,
    .mobile-nav button {
        background: none;
        border: none;
        text-align: left;
        color: #fff;
        font-size: 16px;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: background 0.2s ease;
        pointer-events: auto;
    }

        /* Hover / tap feedback */
        .mobile-nav a:hover,
        .mobile-nav button:hover {
            background: rgba(255,255,255,0.08);
        }

/* Home highlight */
.mobile-home {
    font-weight: 700;
    text-decoration: underline;
}

/* ===============================
   HAMBURGER BUTTON
=============================== */

#mobile-menu-btn {
    position: relative;
    z-index: 10000; /* above header */
    pointer-events: auto;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #fff;
}

/* ===============================
   MOBILE VISIBILITY RULES
=============================== */

.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .main-nav {
        display: none;
    }
}


/* ===== MOBILE MENU CLICK FIX ===== */

#mobile-menu,
#mobile-menu * {
    pointer-events: auto !important;
}

#mobile-menu {
    z-index: 99999 !important;
}

.mobile-nav a {
    position: relative;
    z-index: 99999;
}
    .mobile-nav a:active {
        background: rgba(56,189,248,0.3);
    }
.mobile-link-btn {
    background: none;
    border: none;
    color: #fff;
    text-align: left;
    font-size: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.mobile-link-btn:hover {
    background: rgba(255,255,255,0.08);
} 

/*HOVER DROPDOWN*/

.dropdown-content {
    pointer-events: auto;
}

.dropbtn {
    cursor: pointer;
}
.dropdown-content {
    pointer-events: auto;
}

.dropbtn {
    cursor: pointer;
}
/* =====================================================
   HEADER DROPDOWNS – CLEAN, SEPARATED, LINK-STYLE
===================================================== */

/* ---------- DROPDOWN TRIGGER (TEXT ONLY) ---------- */
header .dropbtn {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

    header .dropbtn:hover {
        color: var(--accent-color);
    }

/* ---------- DROPDOWN WRAPPER ---------- */
header .dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* ---------- DROPDOWN PANEL ---------- */
header .dropdown-content {
    position: absolute;
    top: calc(100% + 10px); /* 👈 vertical spacing */
    min-width: 240px;
    background: #2b2e4a;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.35);
    display: none;
    z-index: 1000;
}

/* SHOW ONLY THE HOVERED DROPDOWN */
header .dropdown:hover > .dropdown-content {
    display: block;
}

/* ---------- TOOLS DROPDOWN ---------- */
header .dropdown.tools-dd > .dropdown-content {
    left: 0;
}

/* ---------- RESOURCES DROPDOWN (OFFSET TO SEPARATE) ---------- */
header .dropdown.resources-dd > .dropdown-content {
    left: 0;
    margin-left: 14px; /* 👈 REAL visual separation */
}

/* ---------- TOOL ITEMS ---------- */
header .dropdown-content .tool-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

    header .dropdown-content .tool-btn:hover {
        background: rgba(255,255,255,0.08);
        color: var(--accent-color);
    }

/* ---------- RESOURCES ITEM (LOGO ROW) ---------- */
header .resource-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #ffffff;
    text-decoration: none;
}

    header .resource-item:hover {
        background: rgba(255,255,255,0.08);
        color: var(--accent-color);
    }

/* LOGO */
header .resource-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}


/* =====================================
   RESOURCES DROPDOWN – PREVENT OVERLAP
===================================== */

/* Default dropdown panel */
header .dropdown-content {
    position: absolute;
    top: calc(100% + 10px);
}

/* Tools dropdown → open to the left (normal) */
header .dropdown.tools-dd > .dropdown-content {
    left: 0;
    right: auto;
}

/* Resources dropdown → open inward (LEFT), not outward */
header .dropdown.resources-dd > .dropdown-content {
    right: 0; /* 👈 anchor to right edge */
    left: auto; /* 👈 prevents overlap with avatar */
}

/* =========================================
   HEADER DROPDOWNS – ABSOLUTE NO BACKGROUND
========================================= */

/* Kill background on dropdown wrapper */
header .dropdown,
header .dropdown:hover {
    background: transparent !important;
}

    /* Kill background on any child hover */
    header .dropdown *,
    header .dropdown *:hover {
        background-color: transparent !important;
        box-shadow: none !important;
    }

/* Restore hover ONLY for dropdown menu items */
header .dropdown-content .tool-btn:hover,
header .dropdown-content .resource-item:hover {
    background: rgba(255,255,255,0.08) !important;
}

/* ==============================
   FOOTER – MOBILE FIX
============================== */

@media (max-width: 768px) {

    footer.footer-section {
        white-space: normal; /* ✅ allow wrapping */
        padding: 12px 10px;
    }

        footer.footer-section p {
            display: flex;
            flex-wrap: wrap; /* ✅ wrap instead of overlap */
            justify-content: center;
            gap: 6px 10px; /* row / column spacing */
            text-align: center;
            line-height: 1.6;
        }

        footer.footer-section a {
            white-space: nowrap; /* ✅ keep links intact */
        }
}

.footer-section p {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 10px;
}

.footer-copy {
    width: 100%;
    text-align: center;
    opacity: 0.8;
    font-size: 14px;
}
/* ===============================
   POLICY / LEGAL PAGES
=============================== */

.policy-container {
    max-width: 900px;
    margin: 80px auto;
    padding: 0 20px;
    line-height: 1.75;
}

    .policy-container h1 {
        font-size: 38px;
        font-weight: 800;
        margin-bottom: 10px;
    }

    .policy-container .updated {
        font-size: 14px;
        opacity: 0.7;
        margin-bottom: 30px;
    }

    .policy-container h2 {
        font-size: 22px;
        font-weight: 700;
        margin-top: 36px;
        margin-bottom: 10px;
    }

    .policy-container p {
        font-size: 16px;
        opacity: 0.9;
        margin-bottom: 12px;
    }

    .policy-container ul {
        padding-left: 20px;
        margin: 10px 0 15px;
    }

    .policy-container li {
        margin-bottom: 6px;
    }

    .policy-container a {
        color: var(--accent-color);
        text-decoration: none;
    }

        .policy-container a:hover {
            text-decoration: underline;
        }

    .policy-container footer {
        margin-top: 50px;
        text-align: center;
        font-size: 14px;
        opacity: 0.7;
    }

/* Mobile tuning */
@media (max-width: 768px) {
    .policy-container {
        margin: 50px auto;
    }

        .policy-container h1 {
            font-size: 28px;
        }

        .policy-container h2 {
            font-size: 20px;
        }
}
