/* =========================================
   PDFTEQ MASTER STYLESHEET
   Status: ACCESSIBILITY OPTIMIZED (100/100)
   ========================================= */

/* ========== CSS Variables ========== */
:root {
    /* Colors - Light Theme */
    --primary-color: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-blue: #2563eb;
    --secondary-color: #64748b;
    --accent-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-light: #f8fafc;
    
    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --text-dark: #0f172a;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-sm: 4px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-xxl: 1.5rem;
    --font-size-xxxl: 2rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* ========== Reset & Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== Button Styles ========== */
.primary-btn {
    background-color: var(--primary-color);
    color: #ffffff !important; /* WHITE TEXT FOR ACCESSIBILITY */
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.secondary-btn {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 22px;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.secondary-btn:hover {
    background-color: var(--bg-tertiary);
    transform: translateY(-1px);
}

/* ========== Tool Card Styles ========== */
.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* ========== Header & Navigation ========== */
.site-header {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: var(--bg-tertiary);
}

/* ========== Footer ========== */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xxl) 0 var(--spacing-xl);
    margin-top: auto;
}

/* ========== Alert Styles ========== */
.alert-success {
    background-color: var(--success-color);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .tool-card {
        padding: var(--spacing-lg);
    }
}

/* ========== Accessibility Overrides ========== */
/* Fix for button contrast issue found in PageSpeed Insights */
.btn[style*="background-color: #3B82F6"],
.primary-btn[style*="background-color: #3B82F6"] {
    color: #ffffff !important;
    background-color: #2563eb !important; /* Slightly darker blue for better contrast */
}

/* =========================================
   NEW: HTML VALIDATION & STRUCTURE FIXES
   ========================================= */

/* 1. VISUAL HELPERS FOR HEADINGS 
   Use these classes on <h4> tags to make them look smaller, 
   fixing the skipped heading level errors (H3 -> H5/H6). */

/* Makes an <h4> look like your previous <h5> */
.visual-h5 {
    font-size: var(--font-size-base); /* 1rem */
    line-height: 1.5;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

/* Makes an <h4> look like your previous <h6> */
.visual-h6 {
    font-size: var(--font-size-sm); /* 0.875rem */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

/* Ensures your tool names (moved from H3 to H2) don't look too big */
h2.tool-name {
    font-size: var(--font-size-xl); /* 1.25rem */
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

/* =========================================
   ACCESSIBILITY: HIGH CONTRAST FIXES
   (Fixes "Background and foreground colors do not have sufficient contrast")
   ========================================= */

/* 1. Lighten the BLUE text (Primary) on dark backgrounds */
.bg-dark .text-primary,
[data-bs-theme="dark"] .text-primary,
a.text-primary,
.tool-title {
    color: #60a5fa !important; /* A much lighter, accessible blue */
}

/* 2. Lighten the GREEN text (Success) */
.bg-dark .text-success,
[data-bs-theme="dark"] .text-success {
    color: #4ade80 !important; /* A bright, neon green */
}

/* 3. Lighten the GRAY text (Secondary) */
/* This fixes the footer text and descriptions */
.bg-dark .text-secondary,
[data-bs-theme="dark"] .text-secondary,
footer .text-secondary,
.text-secondary {
    color: #cbd5e1 !important; /* Light gray (Slate-300) */
}

/* 4. Lighten the RED text (Danger) */
.bg-dark .text-danger,
[data-bs-theme="dark"] .text-danger {
    color: #f87171 !important; /* Soft red */
}

/* 5. Fix Links in Paragraphs */
.bg-dark p a,
footer a:not(.btn) {
    color: #60a5fa;
    text-decoration: underline;
    text-decoration-color: rgba(96, 165, 250, 0.3);
}
footer a:not(.btn):hover {
    color: #ffffff !important;
    text-decoration-color: #ffffff;
}

/* 6. Fix "Badge" Contrast (e.g., TECHNICAL, COMPLIANCE) */
.badge.bg-danger.bg-opacity-10 {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: #fca5a5 !important; /* Very light red text */
}
.badge.bg-success.bg-opacity-10 {
    background-color: rgba(74, 222, 128, 0.15) !important;
    color: #86efac !important; /* Very light green text */
}
/* FIX: Blue "NEW" Badge Contrast */
.badge.bg-primary.bg-opacity-10 {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important; /* Lighter Blue (Tailwind Blue-300) */
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* FIX: Ensure all links in the footer have high contrast on hover */
.text-decoration-none.text-secondary:hover {
    color: #ffffff !important;
}

/* =========================================
   FINAL ACCESSIBILITY PATCH (For 100/100 Score)
   ========================================= */

/* 1. Fix "Core Processing" & "Page Operations" Titles */
/* Forces lighter colors on dark backgrounds */
.bg-dark .text-primary, 
.tool-category-title.text-primary {
    color: #60a5fa !important; /* Lighter Blue */
}

.bg-dark .text-success, 
.tool-category-title.text-success {
    color: #4ade80 !important; /* Lighter Green */
}

.bg-dark .text-warning, 
.tool-category-title.text-warning {
    color: #fbbf24 !important; /* Lighter Orange/Yellow */
}

/* 2. Fix Description Text Contrast */
/* Your current grey is slightly too dark for Google */
.text-secondary, 
.tool-desc,
p.small {
    color: #e2e8f0 !important; /* Very Light Grey (Slate-200) */
}

/* 3. Fix Footer Links */
footer a, .site-footer a {
    color: #cbd5e1 !important; /* Ensure footer links are readable */
}
footer a:hover, .site-footer a:hover {
    color: #ffffff !important;
}

/* 4. Fix Footer Heading Sizes */
footer h4, .site-footer h4 {
    font-size: 1rem !important; /* Keep text small like H6 */
    font-weight: 700;
    color: #fff !important;
}

/* =========================================
   100/100 FINAL SCORE FIX: BUTTON CONTRAST
   ========================================= */

/* Fix "View All Guides" Button Visibility */
.btn-outline-primary {
    color: #93c5fd !important;       /* Light Blue Text */
    border-color: #60a5fa !important; /* Light Blue Border */
    background-color: transparent !important;
}

/* Hover Effect */
.btn-outline-primary:hover {
    background-color: #60a5fa !important;
    color: #0f172a !important;        /* Dark Text on Hover */
    border-color: #60a5fa !important;
}
