/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* Header Styles */
header {
    border-bottom: 2px solid #e1e8ed;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

header h1 {
    color: #1a202c;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: #718096;
    font-size: 1.1em;
    margin-top: 5px;
}

.table-name {
    color: #3182ce;
    font-weight: 600;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9em;
    color: #718096;
}

.breadcrumb a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #2c5282;
    text-decoration: underline;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #cbd5e0;
}

/* Main Content */
main {
    margin-bottom: 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #2d3748;
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.section-header h2 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Tables Grid (Homepage) */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.model-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3182ce;
}

.model-card h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
}

.model-card h3 a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s;
}

.model-card h3 a:hover {
    color: #2c5282;
    text-decoration: underline;
}

.model-image {
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
}

.model-image a {
    display: block;
    cursor: pointer;
}

.model-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}

.model-image a:hover img {
    opacity: 0.9;
}

.table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.table-card.undocumented {
    display: none;
}

.table-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #3182ce;
}

.table-card h3 {
    margin-bottom: 10px;
    font-size: 1.3em;
}

.table-card h3 a {
    color: #3182ce;
    text-decoration: none;
    transition: color 0.2s;
}

.table-card h3 a:hover {
    color: #2c5282;
    text-decoration: underline;
}

.table-description {
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.table-description p {
    margin: 0 0 0.5em 0;
}

.table-description p:last-child {
    margin-bottom: 0;
}

.table-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: #edf2f7;
    border-radius: 4px;
    font-size: 0.85em;
    color: #4a5568;
}

.badge strong {
    color: #2d3748;
    font-weight: 600;
}

.badge-undocumented {
    background-color: #fed7d7;
    color: #c53030;
}

.table-header-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

/* Table Description Section */
.description-text {
    color: #4a5568;
    font-size: 1.05em;
    line-height: 1.8;
    background-color: #f7fafc;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #3182ce;
}

.description-text p {
    margin: 0 0 1em 0;
}

.description-text p:last-child {
    margin-bottom: 0;
}

.description-text h1,
.description-text h2,
.description-text h3,
.description-text h4,
.description-text h5,
.description-text h6 {
    color: #2d3748;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.description-text h1:first-child,
.description-text h2:first-child,
.description-text h3:first-child,
.description-text h4:first-child,
.description-text h5:first-child,
.description-text h6:first-child {
    margin-top: 0;
}

.description-text ul,
.description-text ol {
    margin: 0.5em 0 1em 1.5em;
    padding-left: 1.5em;
}

.description-text li {
    margin: 0.25em 0;
}

.description-text code {
    background-color: #edf2f7;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #2d3748;
}

.description-text pre {
    background-color: #2d3748;
    color: #f7fafc;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

.description-text pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9em;
}

.description-text blockquote {
    border-left: 4px solid #3182ce;
    padding-left: 1em;
    margin: 1em 0;
    color: #718096;
    font-style: italic;
}

.description-text a {
    color: #3182ce;
    text-decoration: none;
}

.description-text a:hover {
    text-decoration: underline;
}

.description-text table {
    border-collapse: collapse;
    margin: 1em 0;
    width: 100%;
}

.description-text table th,
.description-text table td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}

.description-text table th {
    background-color: #f7fafc;
    font-weight: 600;
}

/* Columns Table */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.columns-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
}

.columns-table thead {
    background-color: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.columns-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.columns-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
}

.columns-table tbody tr:hover {
    background-color: #f7fafc;
}

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

.column-name {
    background-color: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #2d3748;
    font-weight: 600;
}

.data-type {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #805ad5;
    font-size: 0.9em;
    font-weight: 500;
}

.nullable {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.nullable.no {
    background-color: #fed7d7;
    color: #c53030;
}

.nullable.yes {
    background-color: #c6f6d5;
    color: #22543d;
}

.column-description {
    color: #4a5568;
    line-height: 1.6;
}

.column-description p {
    margin: 0 0 0.5em 0;
}

.column-description p:last-child {
    margin-bottom: 0;
}

.column-description ul,
.column-description ol {
    margin: 0.5em 0 0.5em 1.5em;
    padding-left: 1.5em;
}

.column-description li {
    margin: 0.25em 0;
}

.column-description code {
    background-color: #edf2f7;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: #2d3748;
}

.column-description a {
    color: #3182ce;
    text-decoration: none;
}

.column-description a:hover {
    text-decoration: underline;
}

/* Navigation Section */
.navigation-section {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-secondary {
    background-color: #edf2f7;
    color: #2d3748;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1a202c;
}

/* Footer */
footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 2px solid #e1e8ed;
    text-align: center;
    color: #718096;
    font-size: 0.9em;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 2em;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .section-header h2 {
        width: 100%;
        border-bottom: 2px solid #e2e8f0;
        padding-bottom: 10px;
    }

    .btn-toggle-undocumented {
        width: 100%;
        justify-content: center;
    }

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

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

    .table-wrapper {
        overflow-x: scroll;
    }

    .columns-table {
        min-width: 600px;
    }

    .columns-table th,
    .columns-table td {
        padding: 10px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.4em;
    }

    .description-text {
        padding: 15px;
        font-size: 1em;
    }
}