/**
 * Documentation Pages - Color Contrast & Zoom Fix
 * 
 * Issues Fixed:
 * 1. Pages appearing zoomed out
 * 2. White text on white background (poor contrast)
 * 3. Inconsistent text colors across documentation pages
 * 
 * Apply to all docs-*.php pages
 */

/* ============================================
   1. ZOOM/VIEWPORT FIX
   ============================================ */

/* Ensure proper viewport scaling */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-size: 1rem;
    line-height: 1.6;
    /* Prevent unwanted zooming */
    touch-action: manipulation;
}

/* Fix for documentation pages specifically */
.docs-content-header,
.docs-main-content,
.docs-nav-sidebar {
    /* Ensure proper scaling */
    transform: none !important;
    zoom: 1 !important;
}

/* ============================================
   2. TEXT COLOR FIXES - Global
   ============================================ */

/* Main content text - ensure dark text on light backgrounds */
.docs-main-content,
.docs-main-content p,
.docs-main-content li,
.docs-main-content td,
.docs-main-content .accordion-body {
    color: #1e293b !important;
}

/* Headings - ensure dark color */
.docs-main-content h1,
.docs-main-content h2,
.docs-main-content h3,
.docs-main-content h4,
.docs-main-content h5,
.docs-main-content h6 {
    color: #0f172a !important;
}

/* ============================================
   3. CONTENT BOX FIXES
   ============================================ */

.docs-content-box {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1px solid #e2e8f0 !important;
}

.docs-content-box h4,
.docs-content-box h5,
.docs-content-box h6 {
    color: #0f172a !important;
}

.docs-content-box p,
.docs-content-box li,
.docs-content-box td,
.docs-content-box th {
    color: #334155 !important;
}

/* Table headers in content boxes */
.docs-content-box .docs-table th {
    background: #f8fafc !important;
    color: #0f172a !important;
}

/* Table body in content boxes */
.docs-content-box .docs-table td {
    background: #ffffff !important;
    color: #334155 !important;
}

/* ============================================
   4. FEATURE CARD FIXES
   ============================================ */

.docs-feature-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

.docs-feature-card h5 {
    color: #0f172a !important;
}

.docs-feature-card p {
    color: #475569 !important;
}

.docs-feature-card:hover {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
}

/* Icons in feature cards - ensure visibility */
.docs-feature-card i {
    color: #3b82f6 !important;
}

/* ============================================
   5. TIP BOX FIXES
   ============================================ */

.docs-tip-box {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    border-left: 4px solid #0284c7 !important;
    color: #0c4a6e !important;
}

.docs-tip-box h5 {
    color: #075985 !important;
}

.docs-tip-box p {
    color: #0c4a6e !important;
}

/* ============================================
   6. CODE BLOCK FIXES
   ============================================ */

.docs-code-block {
    background: #1e293b !important;
    color: #e2e8f0 !important;
}

/* Ensure code is readable */
.docs-code-block .keyword,
.docs-code-block .string,
.docs-code-block .comment,
.docs-code-block .number {
    color: inherit !important;
    opacity: 0.9;
}

/* ============================================
   7. ACCORDION FIXES
   ============================================ */

.accordion-button {
    background: #ffffff !important;
    color: #0f172a !important;
}

.accordion-button:not(.collapsed) {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

.accordion-button:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}

.accordion-body {
    background: #ffffff !important;
    color: #334155 !important;
}

/* ============================================
   8. TABLE FIXES
   ============================================ */

.docs-table {
    background: #ffffff !important;
}

.docs-table th {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: #e2e8f0 !important;
}

.docs-table td {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: #e2e8f0 !important;
}

.docs-table tr:nth-child(even) td {
    background: #f8fafc !important;
}

.docs-table tr:hover td {
    background: #eff6ff !important;
}

/* ============================================
   9. BADGE FIXES
   ============================================ */

/* Ensure badge text is always readable */
.badge {
    color: #ffffff !important;
}

.badge.bg-light {
    color: #0f172a !important;
}

/* Specific badge colors with better contrast */
.badge.bg-success {
    background-color: #16a34a !important;
}

.badge.bg-info {
    background-color: #0284c7 !important;
}

.badge.bg-warning {
    background-color: #ca8a04 !important;
    color: #ffffff !important;
}

.badge.bg-danger {
    background-color: #dc2626 !important;
}

/* ============================================
   10. NAVIGATION SIDEBAR FIXES
   ============================================ */

.docs-nav-sidebar {
    background: #ffffff !important;
    color: #1e293b !important;
}

.docs-nav-title {
    color: #0f172a !important;
}

.docs-nav-list a {
    color: #475569 !important;
}

.docs-nav-list a:hover,
.docs-nav-list a.active {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
}

/* ============================================
   11. HERO SECTION FIXES
   ============================================ */

.docs-content-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: #ffffff !important;
}

.docs-content-header h1,
.docs-content-header h2,
.docs-content-header p,
.docs-content-header .lead {
    color: #ffffff !important;
}

/* Breadcrumb links in hero */
.docs-content-header .breadcrumb a {
    color: #93c5fd !important;
}

/* Hero badges */
.docs-content-header .badge {
    color: #ffffff !important;
}

/* ============================================
   12. STEP GUIDE FIXES
   ============================================ */

.docs-step-item h5 {
    color: #0f172a !important;
}

.docs-step-item p {
    color: #334155 !important;
}

.docs-step-item li {
    color: #334155 !important;
}

/* ============================================
   13. WORKFLOW DIAGRAM FIXES
   ============================================ */

.docs-workflow-diagram {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    border-color: #3b82f6 !important;
    color: #1e293b !important;
}

.docs-workflow-step {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    color: #1d4ed8 !important;
}

.docs-workflow-arrow {
    color: #64748b !important;
}

/* ============================================
   14. ALERT FIXES
   ============================================ */

.alert {
    color: #0f172a !important;
}

.alert-info {
    background: #eff6ff !important;
    border-color: #3b82f6 !important;
    color: #1d4ed8 !important;
}

.alert-success {
    background: #f0fdf4 !important;
    border-color: #16a34a !important;
    color: #15803d !important;
}

.alert-warning {
    background: #fef3c7 !important;
    border-color: #ca8a04 !important;
    color: #a16207 !important;
}

.alert-danger {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
}

/* ============================================
   15. RESPONSIVE FIXES
   ============================================ */

@media (max-width: 991px) {
    .docs-nav-sidebar {
        position: relative !important;
        top: 0 !important;
        max-height: none !important;
        margin-bottom: 40px !important;
    }
    
    /* Ensure text remains readable on mobile */
    .docs-content-header h1 {
        font-size: 2rem !important;
    }
    
    .docs-main-content {
        font-size: 0.95rem !important;
    }
}

/* ============================================
   16. PRINT FIXES
   ============================================ */

@media print {
    .docs-nav-sidebar,
    .docs-content-header {
        display: none !important;
    }
    
    .docs-main-content,
    .docs-content-box {
        color: #000000 !important;
        background: #ffffff !important;
    }
}

/* ============================================
   17. ACCESSIBILITY FIXES
   ============================================ */

/* Focus states for better accessibility */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid #3b82f6 !important;
    outline-offset: 2px !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .docs-content-box,
    .docs-feature-card,
    .docs-table {
        border-width: 2px !important;
    }
}

/* ============================================
   18. LOADING STATE FIXES
   ============================================ */

/* Ensure loading states are visible */
.loading {
    color: #64748b !important;
    background: #f8fafc !important;
}

/* ============================================
   19. LINK FIXES
   ============================================ */

.docs-main-content a {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

.docs-main-content a:hover {
    color: #1e40af !important;
}

/* Links in dark backgrounds */
.docs-content-header a {
    color: #93c5fd !important;
}

.docs-content-header a:hover {
    color: #ffffff !important;
}

/* ============================================
   20. MISC FIXES
   ============================================ */

/* Ensure all text has proper contrast */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Fix for Bootstrap components */
.list-group-item {
    color: #1e293b !important;
    background: #ffffff !important;
}

.list-group-item:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
}

/* Card components */
.card {
    color: #1e293b !important;
}

.card-header {
    color: #0f172a !important;
    background: #f8fafc !important;
}

/* Form elements */
.form-control,
.form-select {
    color: #1e293b !important;
    background: #ffffff !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #3b82f6 !important;
    color: #1e293b !important;
}
