/* ========================================
   COMPARISON TABLES CSS
   File: comparison-tables.css
   Location: /src/comparison-tables.css
   
   Professional comparison table styling for:
   - Article comparison tables
   - Product comparison pages
   - Feature matrices
   ======================================== */

/* ========================================
   BASE TABLE STRUCTURE
   ======================================== */

.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
    font-size: 0.9rem;
}

/* ========================================
   TABLE HEADER
   ======================================== */

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.comparison-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* First column header */
.comparison-table thead th:first-child {
    border-top-left-radius: 12px;
}

/* Last column header */
.comparison-table thead th:last-child {
    border-top-right-radius: 12px;
}

/* ========================================
   TABLE BODY
   ======================================== */

.comparison-table tbody tr {
    background-color: white;
    transition: all 0.2s ease;
}

.comparison-table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.comparison-table tbody tr:hover {
    background-color: #f3f4f6;
    transform: scale(1.01);
}

.comparison-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    color: #374151;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

/* First column (feature names) - bold */
.comparison-table tbody td:first-child {
    font-weight: 600;
    color: #111827;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile responsive tables */
@media (max-width: 768px) {
    .comparison-table {
        font-size: 0.8rem;
    }
    
    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Horizontal scroll on very narrow screens */
    .comparison-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ========================================
   ALTERNATIVE COLOR SCHEMES
   ======================================== */

/* Blue theme */
.comparison-table.blue-theme thead {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
}

/* Green theme */
.comparison-table.green-theme thead {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
}

/* Orange theme */
.comparison-table.orange-theme thead {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Red theme */
.comparison-table.red-theme thead {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* ========================================
   SPECIAL CELL TYPES
   ======================================== */

/* Checkmark cells */
.comparison-table td.check {
    color: #10b981;
    font-weight: 600;
}

.comparison-table td.check::before {
    content: "✓ ";
    font-size: 1.2em;
}

/* X mark cells */
.comparison-table td.cross {
    color: #ef4444;
    font-weight: 600;
}

.comparison-table td.cross::before {
    content: "✗ ";
    font-size: 1.2em;
}

/* Highlighted cells */
.comparison-table td.highlight {
    background-color: #fef3c7;
    font-weight: 600;
}

/* ========================================
   TABLE CAPTION
   ======================================== */

.comparison-table caption {
    caption-side: top;
    padding: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-align: left;
}

/* ========================================
   SCROLLBAR STYLING (for overflow)
   ======================================== */

.comparison-table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.comparison-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.comparison-table-wrapper::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 4px;
}

.comparison-table-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.comparison-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .comparison-table {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .comparison-table thead {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .comparison-table tbody tr:hover {
        background-color: inherit;
        transform: none;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus styles for keyboard navigation */
.comparison-table:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Screen reader helper text */
.comparison-table .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   END OF COMPARISON TABLES CSS
   ======================================== */