/* Enhanced Table Styles for Market Timing Website */
/* This CSS fixes table styling to match the dark theme aesthetic and ensure proper readability */

/* Override any existing Bootstrap table styles that cause white background issues */
.post-container .table,
.post-container table,
.entry-content table,
.post-content table {
    width: 100% !important;
    max-width: 100% !important;
    margin: 1.5em 0 2em 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%) !important;
    border: 1px solid #555555 !important;
}

/* Table headers - dark styling to match site aesthetic */
.post-container .table th,
.post-container table th,
.entry-content table th,
.post-content table th {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%) !important;
    color: #f5f5f5 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 0.85em !important;
    padding: 12px 15px !important;
    border: none !important;
    border-bottom: 2px solid #666666 !important;
    text-align: left !important;
    vertical-align: middle !important;
}

/* Table cells - darker background with light text for good contrast */
.post-container .table td,
.post-container table td,
.entry-content table td,
.post-content table td {
    background-color: #1e1e1e !important;
    color: #d0d0d0 !important;
    padding: 12px 15px !important;
    border: none !important;
    border-bottom: 1px solid #444444 !important;
    vertical-align: middle !important;
    line-height: 1.5 !important;
}

/* Alternating row colors for better readability */
.post-container .table tbody tr:nth-child(even) td,
.post-container table tbody tr:nth-child(even) td,
.entry-content table tbody tr:nth-child(even) td,
.post-content table tbody tr:nth-child(even) td {
    background-color: #262626 !important;
}

/* Hover effects for interactive feel */
.post-container .table tbody tr:hover td,
.post-container table tbody tr:hover td,
.entry-content table tbody tr:hover td,
.post-content table tbody tr:hover td {
    background-color: #353535 !important;
    transform: scale(1.005);
    transition: all 0.2s ease;
}

/* First column styling - often contains headers/important data */
.post-container .table td:first-child,
.post-container .table th:first-child,
.post-container table td:first-child,
.post-container table th:first-child,
.entry-content table td:first-child,
.entry-content table th:first-child,
.post-content table td:first-child,
.post-content table th:first-child {
    font-weight: 600 !important;
    border-left: 3px solid #0085a1 !important; /* Brand color accent */
}

/* Last column rounded corners */
.post-container .table th:last-child,
.post-container table th:last-child,
.entry-content table th:last-child,
.post-content table th:last-child {
    border-top-right-radius: 6px !important;
}

.post-container .table th:first-child,
.post-container table th:first-child,
.entry-content table th:first-child,
.post-content table th:first-child {
    border-top-left-radius: 6px !important;
}

.post-container .table tbody tr:last-child td:first-child,
.post-container table tbody tr:last-child td:first-child,
.entry-content table tbody tr:last-child td:first-child,
.post-content table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 6px !important;
}

.post-container .table tbody tr:last-child td:last-child,
.post-container table tbody tr:last-child td:last-child,
.entry-content table tbody tr:last-child td:last-child,
.post-content table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 6px !important;
}

/* Responsive table improvements */
@media (max-width: 768px) {
    .post-container .table,
    .post-container table,
    .entry-content table,
    .post-content table {
        font-size: 0.875em !important;
        margin: 1em 0 !important;
    }
    
    .post-container .table th,
    .post-container .table td,
    .post-container table th,
    .post-container table td,
    .entry-content table th,
    .entry-content table td,
    .post-content table th,
    .post-content table td {
        padding: 8px 10px !important;
    }
    
    /* Stack table on very small screens if needed */
    .post-container .responsive-table,
    .entry-content .responsive-table,
    .post-content .responsive-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Special styling for numerical data */
.post-container .table td.number,
.post-container .table td[data-type="number"],
.post-container table td.number,
.post-container table td[data-type="number"],
.entry-content table td.number,
.entry-content table td[data-type="number"],
.post-content table td.number,
.post-content table td[data-type="number"] {
    text-align: right !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace !important;
    font-weight: 500 !important;
}

/* Special styling for code or technical content in tables */
.post-container .table td code,
.post-container .table th code,
.post-container table td code,
.post-container table th code,
.entry-content table td code,
.entry-content table th code,
.post-content table td code,
.post-content table th code {
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 2px 6px !important;
    border-radius: 3px !important;
    font-size: 0.9em !important;
    color: #ffa726 !important;
    border: none !important;
}

/* Success/positive values styling */
.post-container .table .positive,
.post-container .table .success,
.post-container table .positive,
.post-container table .success,
.entry-content table .positive,
.entry-content table .success,
.post-content table .positive,
.post-content table .success {
    color: #198754 !important;
    font-weight: 600 !important;
}

/* Error/negative values styling */
.post-container .table .negative,
.post-container .table .error,
.post-container table .negative,
.post-container table .error,
.entry-content table .negative,
.entry-content table .error,
.post-content table .negative,
.post-content table .error {
    color: #dc3545 !important;
    font-weight: 600 !important;
}

/* Warning/neutral values styling */
.post-container .table .warning,
.post-container .table .neutral,
.post-container table .warning,
.post-container table .neutral,
.entry-content table .warning,
.entry-content table .neutral,
.post-content table .warning,
.post-content table .neutral {
    color: #fd7e14 !important;
    font-weight: 600 !important;
}

/* Links in tables */
.post-container .table a,
.post-container table a,
.entry-content table a,
.post-content table a {
    color: #0085a1 !important;
    text-decoration: none !important;
    border-bottom: 1px dotted #0085a1 !important;
    transition: all 0.2s ease !important;
}

.post-container .table a:hover,
.post-container table a:hover,
.entry-content table a:hover,
.post-content table a:hover {
    color: #006d84 !important;
    border-bottom-style: solid !important;
}

/* Table captions */
.post-container .table caption,
.post-container table caption,
.entry-content table caption,
.post-content table caption {
    caption-side: top !important;
    color: #6c757d !important;
    font-style: italic !important;
    font-size: 0.9em !important;
    margin-bottom: 0.5em !important;
    text-align: left !important;
}

/* Override any Bootstrap table striping that might conflict */
.post-container .table-striped > tbody > tr:nth-of-type(odd) > td,
.post-container .table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: #ffffff !important;
}

.post-container .table-striped > tbody > tr:nth-of-type(even) > td,
.post-container .table-striped > tbody > tr:nth-of-type(even) > th {
    background-color: #f8f9fa !important;
}

/* Ensure text is always readable */
.post-container .table *,
.post-container table *,
.entry-content table *,
.post-content table * {
    color: inherit !important;
}

.post-container .table th *,
.post-container table th *,
.entry-content table th *,
.post-content table th * {
    color: #f5f5f5 !important;
}

.post-container .table td *,
.post-container table td *,
.entry-content table td *,
.post-content table td * {
    color: #d0d0d0 !important;
}

/* Override the problematic Bootstrap table styling that was creating white backgrounds */
.table th,.table td {
    border: none !important;
    background-color: transparent !important;
}

/* Dark mode compatibility (in case the site has dark mode toggle) */
@media (prefers-color-scheme: dark) {
    .post-container .table,
    .post-container table,
    .entry-content table,
    .post-content table {
        background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%) !important;
        border-color: #555555 !important;
    }
    
    .post-container .table th,
    .post-container table th,
    .entry-content table th,
    .post-content table th {
        background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%) !important;
        color: #f5f5f5 !important;
        border-bottom-color: #666666 !important;
    }
    
    .post-container .table td,
    .post-container table td,
    .entry-content table td,
    .post-content table td {
        background-color: #1e1e1e !important;
        color: #d0d0d0 !important;
        border-bottom-color: #444444 !important;
    }
    
    .post-container .table tbody tr:nth-child(even) td,
    .post-container table tbody tr:nth-child(even) td,
    .entry-content table tbody tr:nth-child(even) td,
    .post-content table tbody tr:nth-child(even) td {
        background-color: #262626 !important;
    }
    
    .post-container .table tbody tr:hover td,
    .post-container table tbody tr:hover td,
    .entry-content table tbody tr:hover td,
    .post-content table tbody tr:hover td {
        background-color: #353535 !important;
    }
}
