/**
 * Infographic Styles
 *
 * CSS for HTML infographics generated by Agent 8 (Infographic Architect)
 * Designed to work with Eleventy and Markdown embedding
 */

/* =========================================================================
   MAIN INFOGRAPHIC CONTAINER
   ========================================================================= */

.seo-infographic {
    max-width: 100%;
    overflow-x: auto;
    margin: 3rem 0;
    border: 3px solid #3b82f6;
    border-radius: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
    position: relative;
}

.seo-infographic::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border-radius: 1rem 1rem 0 0;
}

/* =========================================================================
   INFOGRAPHIC TABLES
   ========================================================================= */

.infographic-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* Table Headers */
.infographic-table th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1.25rem 1rem;
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    border-bottom: 3px solid #1e40af;
}

.infographic-table th:first-child {
    border-radius: 0.75rem 0 0 0;
}

.infographic-table th:last-child {
    border-radius: 0 0.75rem 0 0;
}

/* Table Cells */
.infographic-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.6;
    vertical-align: top;
}

.infographic-table tr:last-child td {
    border-bottom: none;
}

/* Alternating row colors */
.infographic-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.infographic-table tbody tr:hover {
    background-color: #eff6ff;
    transition: background-color 0.2s ease;
}

/* First column emphasis */
.infographic-table tbody td:first-child {
    font-weight: 700;
    color: #1f2937;
    background-color: rgba(59, 130, 246, 0.05);
}

/* =========================================================================
   INFOGRAPHIC LISTS
   ========================================================================= */

.infographic-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.infographic-list li {
    padding: 1rem 1.5rem 1rem 3.5rem;
    margin-bottom: 1rem;
    background: white;
    border-left: 4px solid #3b82f6;
    border-radius: 0.5rem;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.infographic-list li:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateX(4px);
}

.infographic-list li::before {
    content: '✓';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background: #3b82f6;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

/* =========================================================================
   INFOGRAPHIC GRID LAYOUTS
   ========================================================================= */

.infographic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.infographic-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
    text-align: center;
}

.infographic-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
    transform: translateY(-4px);
}

.infographic-card h3 {
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.infographic-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* =========================================================================
   STAT BOXES
   ========================================================================= */

.infographic-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.stat-box {
    flex: 1;
    min-width: 200px;
    padding: 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* =========================================================================
   MOBILE RESPONSIVE
   ========================================================================= */

@media (max-width: 768px) {
    .seo-infographic {
        margin: 2rem -1rem;
        padding: 1.5rem 1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .infographic-table {
        font-size: 0.85rem;
    }

    .infographic-table th,
    .infographic-table td {
        padding: 0.875rem 0.75rem;
    }

    /* Stack table on very small screens */
    @media (max-width: 480px) {
        .infographic-table,
        .infographic-table thead,
        .infographic-table tbody,
        .infographic-table tr,
        .infographic-table th,
        .infographic-table td {
            display: block;
        }

        .infographic-table thead {
            display: none;
        }

        .infographic-table tr {
            margin-bottom: 1rem;
            border: 2px solid #e5e7eb;
            border-radius: 0.75rem;
            overflow: hidden;
        }

        .infographic-table td {
            text-align: right;
            padding-left: 50%;
            position: relative;
            border: none;
            border-bottom: 1px solid #e5e7eb;
        }

        .infographic-table td:last-child {
            border-bottom: none;
        }

        .infographic-table td::before {
            content: attr(data-label);
            position: absolute;
            left: 1rem;
            width: 45%;
            padding-right: 10px;
            white-space: nowrap;
            text-align: left;
            font-weight: bold;
            color: #1f2937;
        }
    }

    .infographic-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .infographic-list li {
        padding-left: 3rem;
    }
}

/* =========================================================================
   PRINT STYLES
   ========================================================================= */

@media print {
    .seo-infographic {
        border: 2px solid #000;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .infographic-table {
        box-shadow: none;
    }

    .infographic-table th {
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =========================================================================
   ACCESSIBILITY
   ========================================================================= */

/* Focus styles for keyboard navigation */
.infographic-table a:focus,
.infographic-list a:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .seo-infographic {
        border-width: 4px;
    }

    .infographic-table th {
        border-bottom-width: 4px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .infographic-list li,
    .infographic-card {
        transition: none;
    }
}
