/* ToolHub Custom Application Stylesheet */

/* Core Responsive Base Engine (Ensures 100% instant responsiveness on initial page load without waiting for CDN JS) */
html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *:before, *:after {
    box-sizing: inherit;
}
body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, p, span, a, button, input, select, textarea, label {
    font-family: inherit;
}

/* Instant Mobile Navigation Display Rules */
@media (max-width: 1023.98px) {
    nav.hidden, .lg\:flex {
        display: none !important;
    }
}
@media (min-width: 1024px) {
    .lg\:flex {
        display: flex !important;
    }
}

/* Mobile Responsive Grid & Container Fallbacks */
@media (max-width: 639.98px) {
    .hidden.sm\:block {
        display: none !important;
    }
}

/* Page Preloader Overlay - Centered & Responsive */
#page-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background-color: #f8f9ff;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#page-preloader.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.preloader-brand-title {
    font-family: 'Hanken Grotesk', 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #ba0914;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.preloader-spinner-ring {
    width: 40px;
    height: 40px;
    border: 3px solid #ffdad6;
    border-top: 3px solid #ba0914;
    border-radius: 50%;
    animation: preloader-spin 0.65s linear infinite;
}

@keyframes preloader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Material Symbols Outlined - Prevent Raw Icon Text Flash (FOUT) while preserving Tailwind icon colors */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-display: block;
    overflow: hidden;
    user-select: none;
    vertical-align: middle;
    visibility: hidden; /* Hide raw icon text without overriding Tailwind color classes */
}

/* When fonts are ready, reveal icons with their vibrant original Tailwind colors intact */
.fonts-ready .material-symbols-outlined,
body.fonts-ready .material-symbols-outlined {
    visibility: visible;
}

/* Tool Card Micro-interactions */
.tool-card:hover .icon-bg {
    transform: scale(1.1);
}

/* Custom Scrollbar Styles */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* SEO Article Content Styling (Headings, Paragraphs, Lists, Tables) */
.seo-article-body {
    font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 0.875rem !important;
    line-height: 1.7 !important;
    color: #475569 !important;
}

.dark .seo-article-body {
    color: #cbd5e1 !important;
}

.seo-article-body h2 {
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.35 !important;
    letter-spacing: -0.01em !important;
}

.dark .seo-article-body h2 {
    color: #f8fafc !important;
}

.seo-article-body h3 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.4 !important;
}

.dark .seo-article-body h3 {
    color: #f1f5f9 !important;
}

.seo-article-body h4 {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #334155 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.35rem !important;
}

.dark .seo-article-body h4 {
    color: #e2e8f0 !important;
}

.seo-article-body p {
    margin-bottom: 0.85rem !important;
    line-height: 1.7 !important;
}

.seo-article-body ul, .seo-article-body ol {
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
    padding-left: 1.5rem !important;
}

.seo-article-body ul {
    list-style-type: disc !important;
}

.seo-article-body ol {
    list-style-type: decimal !important;
}

.seo-article-body li {
    margin-bottom: 0.4rem !important;
    line-height: 1.6 !important;
    font-size: 0.875rem !important;
}

.seo-article-body strong, .seo-article-body b {
    font-weight: 700 !important;
    color: #0f172a !important;
}

.dark .seo-article-body strong, .dark .seo-article-body b {
    color: #f8fafc !important;
}

.seo-article-body table {
    width: 100% !important;
    margin-top: 1.25rem !important;
    margin-bottom: 1.25rem !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
}

.dark .seo-article-body table {
    border-color: #334155 !important;
}

.seo-article-body th {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    padding: 12px 16px !important;
    text-align: left !important;
    border-bottom: 2px solid #e2e8f0 !important;
}

.dark .seo-article-body th {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-bottom-color: #334155 !important;
}

.seo-article-body td {
    padding: 12px 16px !important;
    font-size: 13px !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
    vertical-align: middle !important;
}

.dark .seo-article-body td {
    color: #cbd5e1 !important;
    border-bottom-color: #1e293b !important;
}

.seo-article-body tr:last-child td {
    border-bottom: none !important;
}

.seo-article-body tr:nth-child(even) td {
    background-color: #f8fafc/50 !important;
}

.dark .seo-article-body tr:nth-child(even) td {
    background-color: #0f172a/50 !important;
}

.seo-article-body tr:hover td {
    background-color: #f1f5f9 !important;
}

.dark .seo-article-body tr:hover td {
    background-color: #1e293b !important;
}


/* ==========================================================================
   UNIFIED GLOBAL TYPOGRAPHY SYSTEM (Google Quality & Consistency Standards)
   ========================================================================== */

/* 1. Global H1 Page Titles */
h1, .page-title, .hero-title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: clamp(1.875rem, 4vw, 2.25rem) !important; /* 30px on mobile, 36px on desktop */
    font-weight: 800 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.025em !important;
}

/* 2. Global H2 Section & Card Titles */
h2, .section-title, .card-h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem) !important; /* 20px - 24px */
    font-weight: 800 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.02em !important;
}

/* 3. Global H3 Sub-section & 4-Step How-to-Use Titles */
h3, .sub-section-title, .card-h3 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif !important;
    font-size: clamp(1.05rem, 2vw, 1.125rem) !important; /* 17px - 18px */
    font-weight: 800 !important;
    line-height: 1.4 !important;
    letter-spacing: -0.015em !important;
}

/* 4. Global H4 Tool Titles & Widget Headers */
h4, .tool-title, .card-h4 {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif !important;
    font-size: 0.875rem !important; /* 14px */
    font-weight: 700 !important;
    line-height: 1.45 !important;
}

/* 5. Hero Subtitle / Lead Paragraphs */
.hero-subtitle, p.lead, header p, .header-desc {
    font-size: clamp(0.875rem, 1.5vw, 1rem) !important; /* 14px - 16px */
    line-height: 1.65 !important;
    font-weight: 500 !important;
}

/* 6. Standard Body Paragraphs */
p, .body-text {
    font-size: 0.875rem !important; /* 14px */
    line-height: 1.7 !important;
}

/* 7. Step Description Text in How-to-Use 4-Step Bar */
.step-desc, .step-text, .how-to-step p {
    font-size: 0.75rem !important; /* 12px */
    line-height: 1.6 !important;
    font-weight: 600 !important;
}
