﻿/* =============================================================
   style.css â€” FilesConverts theme
   ============================================================= */

/* ---------------------------------------------------------------
   Root variables
--------------------------------------------------------------- */
:root {
    --brand:      #2563eb;
    --brand-dk:   #1d4ed8;
    --brand-lt:   #eff6ff;
    --primary:    #2563eb;
    --primary-dk: #1d4ed8;
    --bg:         #f8fafc;
    --card-bg:    #ffffff;
    --text:       #0f172a;
    --muted:      #64748b;
    --border:     #e2e8f0;
    --radius:     16px;
    --header-h:   64px;
    --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 25px rgba(0,0,0,0.12);
}

/* ---------------------------------------------------------------
   Base
--------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: var(--header-h);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dk); }

/* ---------------------------------------------------------------
   Site Header
--------------------------------------------------------------- */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 12px;
}

.logo-icon {
    width: 34px; height: 34px;
    background: var(--brand);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.logo-text strong { color: var(--brand); }

/* Nav groups */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}

.nav-group {
    position: relative;
}

.nav-group-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.nav-group-btn:hover,
.nav-group.open .nav-group-btn {
    background: var(--brand-lt);
    color: var(--brand);
}

.nav-group-btn .caret {
    font-size: 0.6rem;
    transition: transform 0.2s;
}

.nav-group.open .nav-group-btn .caret {
    transform: rotate(180deg);
}

/* Dropdown */
.nav-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 8px;
    min-width: 220px;
    z-index: 999;
    animation: dropIn 0.15s ease;
}

@keyframes dropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nav-group.open .nav-dropdown { display: block; }

.nav-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.12s;
}

.nav-dropdown a:hover {
    background: var(--brand-lt);
    color: var(--brand);
}

.nav-dropdown a i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Header right buttons */
.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-search,
.btn-hamburger {
    width: 36px; height: 36px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.btn-search:hover,
.btn-hamburger:hover {
    background: var(--brand-lt);
    color: var(--brand);
    border-color: var(--brand);
}

.btn-hamburger { display: none; }

/* Collapsible search */
.header-search {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 0 solid var(--border);
    background: #fff;
}

.header-search.visible {
    max-height: 80px;
    border-top-width: 1px;
}

.header-search-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 20px;
}

.header-search-inner .input-wrap {
    position: relative;
    max-width: 480px;
}

.header-search-inner .input-wrap i {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 0.95rem;
}

.header-search-inner input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 9px 16px 9px 38px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.header-search-inner input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Mobile nav overlay */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: #fff;
    z-index: 998;
    overflow-y: auto;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.mobile-nav-overlay.open { display: block; }

.mobile-nav-overlay a {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.12s;
}

.mobile-nav-overlay a:hover {
    background: var(--brand-lt);
    color: var(--brand);
}

.mobile-nav-overlay .mobile-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin: 14px 0 4px 14px;
}

/* ---------------------------------------------------------------
   Hero Section
--------------------------------------------------------------- */
.hero-section {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 56px 24px;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero-section .subtitle {
    font-size: 1.05rem;
    color: var(--muted);
    margin-bottom: 28px;
}

.hero-search-wrap {
    position: relative;
    max-width: 540px;
    margin: 0 auto;
}

.hero-search-wrap i {
    position: absolute;
    left: 18px; top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.hero-search-wrap input {
    width: 100%;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    padding: 14px 20px 14px 48px;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    box-shadow: var(--shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hero-search-wrap input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}

/* ---------------------------------------------------------------
   Tools Container
--------------------------------------------------------------- */
.tools-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

.tool-section { margin-bottom: 44px; }

/* Section label */
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.section-label h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.label-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.label-icon.pdf   { background: #fee2e2; color: #dc2626; }
.label-icon.convert { background: #dbeafe; color: #2563eb; }
.label-icon.image { background: #dcfce7; color: #16a34a; }
.label-icon.ai    { background: #f3e8ff; color: #9333ea; }
.label-icon.audio { background: #fef9c3; color: #ca8a04; }
.label-icon.video { background: #e0f2fe; color: #0284c7; }

/* Tools grid — 2 columns on desktop, 1 on mobile */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* Tool card — horizontal row: icon left, text right */
.tool-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
    min-height: 80px;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--brand);
    color: inherit;
}

.tool-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Per-category icon colors */
.tool-card-wrapper[data-category="pdf"] .tool-icon {
    background: #fee2e2;
    color: #dc2626;
}
.tool-card-wrapper[data-category="convert"] .tool-icon {
    background: #dbeafe;
    color: #2563eb;
}
.tool-card-wrapper[data-category="image"] .tool-icon {
    background: #dcfce7;
    color: #16a34a;
}

/* Text block inside card */
.tool-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* Name and desc inside card */
.tool-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------------------------------------------------------
   AI Badge
--------------------------------------------------------------- */
.ai-badge {
    background: linear-gradient(90deg, #9333ea, #6366f1);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
    vertical-align: middle;
    letter-spacing: 0.3px;
}

/* ---------------------------------------------------------------
   Trust strip
--------------------------------------------------------------- */
.trust-strip {
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 32px 24px;
}

.trust-strip .trust-items {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 28px 40px;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: #374151;
}

.trust-item i {
    font-size: 1.3rem;
}

/* ---------------------------------------------------------------
   Site Footer
--------------------------------------------------------------- */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 48px 24px 28px;
    margin-top: auto;
}

.footer-grid {
    max-width: 1280px;
    margin: 0 auto 32px;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 32px;
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    text-decoration: none;
}

.footer-brand .logo-icon {
    background: var(--brand);
}

.footer-brand .logo-text {
    color: #fff;
    font-size: 1rem;
}

.footer-brand .logo-text strong { color: #93c5fd; }

.footer-brand p {
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

.footer-col h4,
.footer-col h6 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #e2e8f0;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li { margin-bottom: 9px; }

.footer-col ul li a {
    color: #94a3b8;
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col ul li a:hover { color: #e2e8f0; }

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    border-top: 1px solid #1e293b;
    padding-top: 20px;
    font-size: 0.82rem;
    color: #64748b;
    text-align: center;
}

/* ---------------------------------------------------------------
   FilePond overrides
--------------------------------------------------------------- */
.filepond--root {
    font-family: inherit;
    font-size: 0.95rem;
}

.filepond--panel-root {
    border-radius: var(--radius) !important;
    border: 2px dashed var(--border) !important;
    background: #fafafa !important;
}

.filepond--panel-root:hover {
    border-color: var(--brand) !important;
    background: var(--brand-lt) !important;
}

.filepond--drop-label {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 30px 20px;
}

.filepond--label--browse { color: var(--brand); text-decoration: underline; cursor: pointer; }
.filepond--item-panel { border-radius: 10px !important; }

/* ---------------------------------------------------------------
   Buttons
--------------------------------------------------------------- */
.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    border-radius: 10px;
    font-weight: 600;
    padding: 12px 28px;
    transition: background 0.2s, transform 0.1s;
}

.btn-primary:hover {
    background: var(--brand-dk);
    border-color: var(--brand-dk);
    transform: translateY(-1px);
}

.btn-success { border-radius: 10px; font-weight: 600; padding: 12px 28px; }

.card { border-radius: var(--radius) !important; }

/* ---------------------------------------------------------------
   Form controls
--------------------------------------------------------------- */
.form-control, .form-select {
    border-radius: 9px;
    border-color: var(--border);
    padding: 10px 14px;
    color: var(--text);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-range::-webkit-slider-thumb { background: var(--brand); }
.form-range::-moz-range-thumb { background: var(--brand); border: none; }

/* ---------------------------------------------------------------
   Tool page misc
--------------------------------------------------------------- */
.upload-drop-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    min-height: 160px;
}

.upload-drop-area:hover, .upload-drop-area.drag-over {
    border-color: var(--brand);
    background: var(--brand-lt);
}

#signatureCanvas { border-radius: var(--radius); background: #f8f9fa; cursor: crosshair; }
.cropper-wrapper img { max-width: 100%; display: block; }
#addTextCanvas, #maskCanvas { max-width: 100%; display: block; border-radius: var(--radius); }
#resultPanel .card { border-left: 4px solid #16a34a !important; }
.alert-danger { border-radius: var(--radius); border-left: 4px solid #dc2626 !important; }

/* ---------------------------------------------------------------
   Section title (tool pages)
--------------------------------------------------------------- */
.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    border-left: 3px solid var(--brand);
    padding-left: 12px;
}

/* ---------------------------------------------------------------
   Responsive — all breakpoints
   xl  ≥ 1280px  large desktop
   lg  ≥ 1024px  small desktop / large tablet landscape
   md  ≥ 768px   tablet portrait
   sm  < 768px   mobile landscape
   xs  < 480px   mobile portrait
--------------------------------------------------------------- */

/* ── Large desktop (≥ 1280px) — full layout, nothing hidden ── */
@media (min-width: 1280px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ── Small desktop / laptop (1024 – 1279px) ── */
@media (min-width: 1024px) and (max-width: 1279px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .nav-group-btn {
        font-size: 0.83rem;
        padding: 7px 8px;
    }
    .nav-dropdown-4col {
        width: min(860px, calc(100vw - 40px));
    }
}

/* ── Tablet landscape / small desktop (900 – 1023px) ── */
@media (min-width: 900px) and (max-width: 1023px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-group-btn {
        font-size: 0.8rem;
        padding: 6px 7px;
        gap: 4px;
    }
    .nav-group-btn i:first-child { display: none; }   /* hide leading icon to save space */
    .nav-dropdown-4col {
        width: min(760px, calc(100vw - 32px));
    }
    .nav-dropdown-wide {
        width: min(540px, calc(100vw - 32px));
    }
}

/* ── Collapse nav to hamburger (< 900px) ── */
@media (max-width: 899px) {
    .btn-hamburger { display: flex; }
    .footer-grid { grid-template-columns: 1fr 1fr; }

    /* ── Mobile nav overlay — active for ALL hamburger-visible sizes ── */
    .header-nav {
        display: none;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0; bottom: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 2px;
        overflow-y: auto;
        z-index: 1001;
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    }
    .header-nav.mobile-open { display: flex !important; }
    .nav-group { width: 100%; }
    .nav-group-btn {
        width: 100%;
        justify-content: space-between;
        padding: 11px 14px;
        font-size: 0.93rem;
    }
    .nav-dropdown {
        position: static;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0 0 4px 16px;
        min-width: 0;
        animation: none;
    }
    .nav-dropdown a { padding: 9px 12px; font-size: 0.87rem; }
    .nav-dropdown-wide,
    .nav-dropdown-4col { width: 100% !important; transform: none !important; left: 0 !important; }
    .nav-dropdown-cols { flex-direction: column; gap: 0; }
    .nav-col { border-right: none !important; padding-right: 0 !important; }
}

/* ── Tablet portrait (768 – 899px) ── */
@media (min-width: 768px) and (max-width: 899px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .hero-section { padding: 40px 20px; }
    .hero-section h1 { font-size: 2rem; }
    .tools-container { padding: 28px 20px 48px; }
}

/* ── Mobile landscape + large phones (480 – 767px) ── */
@media (max-width: 767px) {
    :root { --header-h: 56px; }

    /* Header */
    .header-inner { padding: 0 14px; gap: 6px; }
    .logo-text { font-size: 1rem; }
    .logo-icon { width: 30px; height: 30px; font-size: 0.9rem; }
    .header-right { gap: 4px; }
    .btn-search, .btn-hamburger { width: 32px; height: 32px; font-size: 0.9rem; }

    /* Auth button shrinks to icon-only */
    .btn-auth-login { padding: 6px 10px; font-size: 0.8rem; }

    /* Tools grid */
    .tools-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tool-card { padding: 12px 14px; min-height: 68px; gap: 12px; }
    .tool-icon { width: 42px; height: 42px; font-size: 1.2rem; border-radius: 12px; }
    .tool-name { font-size: 0.82rem; }
    .tool-desc { font-size: 0.72rem; }

    /* Hero */
    .hero-section { padding: 32px 16px; }
    .hero-section h1 { font-size: 1.65rem; }
    .hero-section .subtitle { font-size: 0.92rem; }
    .hero-search-wrap input { padding: 12px 16px 12px 44px; font-size: 0.93rem; }

    /* Content */
    .tools-container { padding: 22px 14px 40px; }
    .tool-section { margin-bottom: 30px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .site-footer { padding: 36px 16px 22px; }
}

/* ── Small mobile portrait (< 480px) ── */
@media (max-width: 479px) {
    /* Stack tools to single column */
    .tools-grid { grid-template-columns: 1fr; gap: 8px; }

    /* Header: hide logo text on very small screens */
    .logo-text { display: none; }

    /* Compact auth button */
    .btn-auth-login span, .btn-auth-login { gap: 0; }
    .btn-auth-login { padding: 6px 8px; }

    /* Hero */
    .hero-section h1 { font-size: 1.4rem; }
    .hero-section .subtitle { font-size: 0.85rem; margin-bottom: 18px; }

    /* Footer single col */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .trust-strip .trust-items { gap: 14px 20px; }

    /* Section label */
    .section-label h2 { font-size: 1rem; }

    /* Mega dropdowns in mobile nav */
    .nav-col-title { font-size: 0.62rem; }
    .nav-dropdown a { font-size: 0.84rem; padding: 8px 10px; }
}


