/* Container for horizontal scroll */
.eh-table-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 20px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Table styling */
.eh-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    min-width: 600px;
}

/* Header styling */
.eh-table thead th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
    padding: 12px 16px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    border-right: 1px solid #e9ecef;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.eh-table thead th:last-child {
    border-right: none;
}

/* Body cell styling */
.eh-table tbody td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
}

.eh-table tbody td:last-child {
    border-right: none;
}

/* Alternate row colors */
.eh-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.eh-table tbody tr:hover {
    background-color: #e9ecef;
}

/* Sticky first column (Name column) */
.eh-table .sticky-col {
    position: sticky;
    left: 0;
    background-color: #fff;
    font-weight: 500;
    text-align: left;
    z-index: 5;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    white-space: nowrap;
}

/* Sticky header + sticky column intersection */
.eh-table thead .sticky-col {
    z-index: 15;
    background-color: #f8f9fa;
}

/* Keep sticky column background on hover */
.eh-table tbody tr:hover .sticky-col {
    background-color: #fff;
}

.eh-table tbody tr:nth-child(even) .sticky-col {
    background-color: #f8f9fa;
}

.eh-table tbody tr:nth-child(even):hover .sticky-col {
    background-color: #f8f9fa;
}

/* Present/Absent icons */
.eh-table .present {
    color: #28a745;
    font-size: 18px;
    font-weight: bold;
}

.eh-table .absent {
    color: #dc3545;
    font-size: 18px;
    font-weight: bold;
}

/* Loading state */
.eh-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Mobile-specific adjustments */
@media screen and (max-width: 768px) {
    .eh-table thead th,
    .eh-table tbody td {
        padding: 8px 12px; /* Slightly smaller padding */
    }
    
    .eh-table .sticky-col {
        min-width: 120px; /* Ensure names column has minimum width */
        max-width: 180px; /* Prevent it from taking too much space */
    }
    
    .eh-table .present,
    .eh-table .absent {
        font-size: 16px; /* Slightly smaller icons */
    }
    
    /* Add scroll hint */
    .eh-table-wrapper::after {
        content: "← Swipe to see more →";
        display: block;
        text-align: center;
        padding: 8px;
        font-size: 12px;
        color: #666;
        background-color: #f8f9fa;
        border-top: 1px solid #dee2e6;
    }
    
    /* Hide scroll hint after first interaction */
    .eh-table-wrapper.scrolled::after {
        display: none;
    }
}

/* Very small mobile screens */
@media screen and (max-width: 480px) {
    .eh-table .sticky-col {
        font-size: 14px;
        min-width: 100px;
        max-width: 120px;
    }
}