/* =============================================
   PDF TOOLS — GLOBAL LAYOUT STYLES
   Mirrors the structural classes used by pdf_layout.blade.php
   (tool-wrap, tool-breadcrumb, tool-header, tool-box, etc.)
   Uses the same CSS variables defined in calcleaf.css :root
   ============================================= */

.tool-wrap {
    max-width: var(--container, 1200px);
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* Breadcrumb styling now lives solely in the global calcleaf.css,
   so it's shared and consistent across Calculators, Text Tools,
   and Pdf Tools. */

/* =============================================
   TOOL SWITCHER TABS (for related tools in the same category)
   ============================================= */
.tool-tabs-bar {
    display: flex;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-bottom: 10px;
    padding-bottom: 2px;
}
.tool-tab {
    flex-shrink: 0;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    background: var(--white);
    border: 1px solid var(--border);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}
.tool-tab:hover { border-color: var(--teal); color: var(--navy); }
.tool-tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }

/* =============================================
   TOOL HEADER
   ============================================= */
.tool-header {
    margin-bottom: 10px;
}
.tool-header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}
.tool-header-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.5px;
    margin-bottom: 2px;
    text-align: center;
}
.tool-header-desc {
    color: var(--text2);
    font-size: 15px;
    line-height: 1.7;
    max-width: 780px;
}
.tool-header-desc p { margin-bottom: 8px; }

/* =============================================
   TOOL BOX (main card wrapping the tool widget)
   ============================================= */
.tool-box {
    background: transparent;
    margin-bottom: 12px;
}

.pdf-tool-widget {
    margin-top: 0;
}

/* =============================================
   BOTTOM DESCRIPTION
   ============================================= */
.tool-bottom-desc {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 26px 28px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text2);
    margin-bottom: 28px;
}
.tool-bottom-desc h2,
.tool-bottom-desc h3 {
    color: var(--navy);
    margin: 18px 0 8px;
    font-size: 18px;
}
.tool-bottom-desc h2:first-child,
.tool-bottom-desc h3:first-child { margin-top: 0; }
.tool-bottom-desc p { margin-bottom: 10px; }

/* =============================================
   FAQ SECTION
   ============================================= */
.tool-faq-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    margin-bottom: 28px;
}
.tool-faq-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 14px;
}
.tool-faq-list { display: flex; flex-direction: column; gap: 8px; }
.tool-faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.tool-faq-question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--light);
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    text-align: left;
    cursor: pointer;
}
.tool-faq-icon { font-size: 18px; color: var(--teal); font-weight: 700; }
.tool-faq-answer {
    display: none;
    padding: 14px 16px;
    font-size: 13.5px;
    color: var(--text2);
    line-height: 1.7;
    border-top: 1px solid var(--border);
}
.tool-faq-item.open .tool-faq-answer { display: block; }
.tool-faq-item.open .tool-faq-icon { transform: rotate(45deg); }

/* =============================================
   SIDEBAR LINKS (used when page_type == 'category')
   ============================================= */
.sidebar-links {
    list-style: none;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-links li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text2);
    text-decoration: none;
    transition: all 0.15s;
}
.sidebar-links li a:hover { background: var(--light); color: var(--navy); }
.sidebar-link-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    color: var(--teal);
    flex-shrink: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 600px) {
    .tool-header-title { font-size: 24px; }
    .tool-wrap { padding: 16px 14px 40px; }
    .tool-bottom-desc,
    .tool-faq-section { padding: 18px 18px; }
}

/* =============================================
   SHARE BUTTONS (bottom of tool page) - navy header
   card style matching the sitewide share widget
   ============================================= */
.tool-sidebar-share {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 28px;
    padding: 0;
}
.tool-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--navy);
    padding: 14px 24px;
}
.tool-share-inline {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 20px 24px;
}
.tool-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.15s, opacity 0.15s;
}
.tool-share-btn svg { width: 17px; height: 17px; }
.tool-share-btn:hover { transform: translateY(-2px); opacity: 0.9; }
.tool-share-whatsapp { background: #25d366; }
.tool-share-facebook { background: #1877f2; }
.tool-share-twitter { background: #000000; }
.tool-share-linkedin { background: #0a66c2; }
.tool-share-copy { background: var(--teal); border: none; cursor: pointer; }
.tool-share-copy.copied { background: #059669; }

/* Floating feedback widget CSS has moved to the global calcleaf.css
   so it's shared across Calculators, Text Tools, and Pdf Tools. */

/* =============================================
   SHARED ACTION BUTTONS / MODAL / ERROR STATES
   Used by Invoice Generator, Convert to PDF, and
   any future Pdf Tools (class names use inv- prefix
   for historical reasons, but are generic/reusable)
   ============================================= */
.inv-actionbar {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.inv-btn {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 12px 22px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
.inv-btn:hover { background: #0da271; }

.inv-disclaimer {
    font-size: 12px;
    color: #6b7280;
    margin-top: 16px;
    line-height: 1.5;
}

/* =============================================
   VALIDATION ERROR STATE
   ============================================= */
.inv-error {
    border-color: #dc2626 !important;
    background: #fff5f5 !important;
}
.inv-error-text {
    display: block;
    width: 100%;
    color: #dc2626;
    font-size: 12px;
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.4;
}

/* =============================================
   POST-GENERATE ACTIONS (Preview / Download / Edit)
   ============================================= */
.inv-post-actions {
    display: none;
}
.inv-post-actions.show { display: contents; }

.inv-btn-outline {
    background: #fff;
    color: #10b981;
    border: 1px solid #10b981;
}
.inv-btn-outline:hover { background: #f0fdf9; }

.inv-edit-link {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 8px 4px;
}
.inv-edit-link:hover { color: #374151; }

/* =============================================
   PREVIEW MODAL — large in-page popup
   ============================================= */
.inv-preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-preview-overlay.open { display: flex; }

.inv-preview-modal {
    background: #fff;
    width: 100%;
    max-width: 950px;
    height: 92vh;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.inv-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e2a4a;
    color: #fff;
    flex-shrink: 0;
}
.inv-preview-header h3 { font-size: 15px; margin: 0; font-weight: 700; }

.inv-preview-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}
.inv-preview-close:hover { opacity: 0.7; }

.inv-preview-body { flex: 1; min-height: 0; }
.inv-preview-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

@media (max-width: 600px) {
    .inv-preview-overlay { padding: 0; }
    .inv-preview-modal { max-width: 100%; height: 100vh; border-radius: 0; }
}

.inv-preview-footer {
    display: flex;
    justify-content: flex-end;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.inv-inline-message {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #b91c1c;
    font-size: 13px;
}

/* =============================================
   CATEGORY PAGE — sub-tool card grid (e.g. Convert to PDF hub)
   ============================================= */
.conv-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.conv-tool-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 20px 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.conv-tool-card:hover {
    border-color: var(--teal);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.conv-tool-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--teal);
}
.conv-tool-card-icon svg { width: 32px; height: 32px; }
.conv-tool-card-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--navy);
}

@media (max-width: 500px) {
    .conv-tool-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

#invNotes{ width:100%;padding:10px; }
/* =============================================
   LOGO/PHOTO REMOVE BUTTON — shared across all Pdf Tools
   Used by Invoice Generator's logo, CV Generator's profile
   photo, and any future tool with an uploaded image preview.
   ============================================= */
.inv-logo-remove {
    display: inline-block;
    align-self: center;
    flex-shrink: 0;
    width: auto;
    height: auto;
    background: none;
    border: 1px solid #dc2626;
    color: #dc2626;
    font-size: 12px;
    line-height: 1.4;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
}
.inv-logo-remove:hover { background: #fef2f2; }

/* =============================================
   LOGO/PHOTO CROP MODAL — shared across all Pdf Tools
   Used by Invoice Generator's logo crop, CV Generator's
   profile photo crop, and any future tool needing cropping.
   ============================================= */
.inv-crop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.inv-crop-overlay.open { display: flex; }

.inv-crop-modal {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.inv-crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #1e2a4a;
    color: #fff;
    flex-shrink: 0;
}
.inv-crop-header h3 { font-size: 15px; margin: 0; font-weight: 700; }

.inv-crop-body {
    padding: 16px;
    background: #f3f4f6;
}
.inv-crop-body img {
    display: block;
    max-width: 100%;
    max-height: 60vh;
}

.inv-crop-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .inv-crop-overlay { padding: 0; }
    .inv-crop-modal { max-width: 100%; height: 100vh; border-radius: 0; }
    .inv-crop-body { flex: 1; }
}

/* =============================================
   PREVIEW MODAL — template tabs + hint
   Shared across all Pdf Tools with a template preview switcher
   (Invoice Generator, CV Generator, etc.)
   ============================================= */
.inv-preview-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}
.inv-preview-tab {
    flex-shrink: 0;
    padding: 7px 16px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.inv-preview-tab:hover { border-color: #10b981; color: #10b981; }
.inv-preview-tab.active {
    background: #10b981;
    border-color: #10b981;
    color: #fff;
}

.inv-preview-hint {
    padding: 8px 20px 0;
    font-size: 12.5px;
    color: #6b7280;
    background: #f8fafc;
    flex-shrink: 0;
}