/* Table Styles */

.prose table,
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    table-layout: auto;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin: 24px 0;
}

.prose table thead,
.markdown-content table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.prose table th,
.markdown-content table th {
    padding: 12px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid #4c51bf;
    color: #ffffff;
}

.prose table td,
.markdown-content table td {
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #111827;
    text-align: center;
}

.prose table tbody tr,
.markdown-content table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.prose table tbody tr:hover,
.markdown-content table tbody tr:hover {
    background-color: #f9fafb;
}

.prose table tbody tr:nth-child(even),
.markdown-content table tbody tr:nth-child(even) {
    background-color: #f9fafb;
}

.prose table tbody tr:nth-child(even):hover,
.markdown-content table tbody tr:nth-child(even):hover {
    background-color: #f3f4f6;
}

.prose table td:first-child,
.markdown-content table td:first-child {
    font-weight: 600;
    color: #1f2937;
    background-color: #f9fafb;
    text-align: left;
}

.prose table th:first-child,
.markdown-content table th:first-child {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    text-align: left;
}

.prose table td:last-child,
.markdown-content table td:last-child {
    text-align: left;
}

.prose table th:last-child,
.markdown-content table th:last-child {
    text-align: left;
}

.prose table td:nth-child(2),
.markdown-content table td:nth-child(2) {
    text-align: left;
}

@media (max-width: 768px) {
    .prose table,
    .markdown-content table {
        font-size: 14px;
        display: table;
        width: auto;
        min-width: 100%;
        table-layout: fixed;
    }

    .table-scroll-wrapper table {
        min-width: 570px;
    }

    .prose table th,
    .markdown-content table th {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .prose table td,
    .markdown-content table td {
        padding: 8px 10px;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .prose table td:last-child,
    .markdown-content table td:last-child {
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}
