/**
 * CDC Frontend CSS
 */

/* Container */
.solmetex-cdc-container {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header */
.solmetex-cdc-header {
    color: #fff;
    padding: 40px 20px;
    position: relative;
    background-size: cover;
    background-position: center center;
    border-radius: 10px 10px 0 0;
}

.solmetex-cdc-header-content {
    position: relative;
    z-index: 2;
    max-width: 50%;
}

.solmetex-cdc-header h2 {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 15px;
    color: #fff;
}

.solmetex-cdc-header p {
    font-size: 1.1em;
    margin-bottom: 20px;
}

/* State Selector */
.solmetex-cdc-state-selector {
    margin-top: 20px;
    max-width: 300px;
}

#solmetex-cdc-state {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    text-transform: uppercase;
}

#solmetex-cdc-state option {
    text-transform: uppercase;
}

/* Content Area */
.solmetex-cdc-content {
    background-color: #f9f9f9;
    padding: 30px 20px;
    min-height: 200px;
    border-radius: 0 0 10px 10px;
    border: 1px solid #ddd;
    border-top: none;
}

/* Loading Indicator */
.solmetex-cdc-loading {
    text-align: center;
    padding: 30px;
}

.solmetex-cdc-loading .spinner {
    display: inline-block;
    visibility: visible;
    float: none;
    width: 25px;
    height: 25px;
    margin: 0 10px 0 0;
    background-size: 25px 25px;
}

/* Search Box */
.solmetex-cdc-search {
    display: none;
}

#solmetex-cdc-search {
    display: none;
}

/* Table */
.solmetex-cdc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.solmetex-cdc-table th {
    background-color: #f2f2f2;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.solmetex-cdc-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

.solmetex-cdc-table tr:hover {
    background-color: #f5f5f5;
}

/* Links */
.solmetex-cdc-table a {
    color: #008dab;
    text-decoration: none;
    font-weight: 500;
}

.solmetex-cdc-table a:hover {
    text-decoration: underline;
}

/* No Data Message */
.solmetex-cdc-no-data {
    text-align: center;
    padding: 30px;
    font-style: italic;
    color: #666;
}

/* DataTables Customization */
.solmetex-cdc-table-container .dataTables_info {
    display: none;
}

.solmetex-cdc-table-container .dataTables_paginate {
    display: none;
}

.solmetex-cdc-table-container .dataTables_filter {
    display: none;
}

.solmetex-cdc-table td:first-child {
    text-transform: capitalize;
}

/* Responsive */
@media (max-width: 768px) {
    .solmetex-cdc-header-content {
        max-width: 100%;
    }
    
    .solmetex-cdc-header h2 {
        font-size: 1.8em;
    }
    
    .solmetex-cdc-search {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .solmetex-cdc-search label {
        margin-bottom: 5px;
    }
    
    #solmetex-cdc-search {
        width: 100%;
        min-width: unset;
    }
    
    .solmetex-cdc-table th,
    .solmetex-cdc-table td {
        padding: 8px 10px;
    }
}

/* Accessibility Enhancements */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Focus States */
#solmetex-cdc-state:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #0073aa;
}

.solmetex-cdc-table a:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    text-decoration: underline;
}

/* Improved contrast */
.solmetex-cdc-table a {
    color: #006e89; /* Darker shade for better contrast */
    text-decoration: none;
    font-weight: 500;
}

.solmetex-cdc-table th {
    background-color: #eeeeee; /* Slightly darker background for better contrast */
    color: #333333; /* Ensure text has sufficient contrast */
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

/* Skip link for keyboard users */
.solmetex-cdc-skip-link {
    background-color: #fff;
    color: #0073aa;
    font-weight: 700;
    left: 50%;
    padding: 8px;
    position: absolute;
    transform: translateY(-100%);
    transition: transform 0.3s;
    z-index: 100;
}

.solmetex-cdc-skip-link:focus {
    transform: translateY(0%);
    outline: 2px solid #0073aa;
}

/* Ensure sufficient contrast in header text */
.solmetex-cdc-header h2, 
.solmetex-cdc-header p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Text shadow to improve readability */
} 

.tablepress tbody > tr:first-child > td {
    background: #d9edf7;
    font-size: 24px;
    padding: 10px;
    line-height: 34px;
    height: 50px;
    font-weight: bold;
    color: #414042;
}

.tablepress {
    font-size: 14px;
}

.tablepress tr {
    vertical-align: top;
}

.tablepress .column-1 {
    white-space: nowrap;
}