/**
 * Risk Full Shortcode Styles
 */

/* Main container */
.risk-full-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
}

/* Search filter container and button */
.risk-search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.risk-search-input {
    padding: 10px;
    flex: 1;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.risk-search-button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.risk-search-button:hover {
    background-color: #005a87;
}

.risk-search-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
}

/* Table styles */
.risk-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.risk-full-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #ddd;
    table-layout: fixed;
}

.risk-full-table th,
.risk-full-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
    overflow: hidden;
    max-width: 100%;
}

/* Set width for columns */
.risk-full-table th:nth-child(1),
.risk-full-table td:nth-child(1) {
    width: 50%;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.risk-full-table th:nth-child(2),
.risk-full-table td:nth-child(2) {
    width: 20%;
}

.risk-full-table th:nth-child(3),
.risk-full-table td:nth-child(3) {
    width: 15%;
}

.risk-full-table th:nth-child(4),
.risk-full-table td:nth-child(4) {
    width: 15%;
}

.risk-full-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.risk-full-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.risk-full-table tr:hover {
    background-color: #f1f7ff;
}

.risk-view-link {
    color: #0073aa;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #0073aa;
    border-radius: 3px;
    text-align: center;
    transition: all 0.2s ease;
}

.risk-view-link:hover {
    background-color: #0073aa;
    color: #fff;
}

.risk-no-data {
    text-align: center;
    font-style: italic;
    padding: 20px !important;
}

#risk-no-results {
    text-align: center;
    font-style: italic;
}

/* Add these styles after risk-no-results */

/* Loading indicator for search */
.risk-loading {
    text-align: center;
    padding: 20px !important;
    color: #757575;
    position: relative;
}

.risk-loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    vertical-align: middle;
    border: 3px solid rgba(0, 115, 170, 0.3);
    border-radius: 50%;
    border-top-color: #0073aa;
    animation: risk-spin 1s infinite linear;
}

@keyframes risk-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error message for search */
.risk-error {
    background-color: #fff1f1;
    border-left: 4px solid #dc3232;
    color: #444;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Highlight search results */
.risk-highlight {
    background-color: #ffffa0;
    padding: 2px;
    border-radius: 2px;
}

/* Pagination */
.risk-pagination {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.risk-page-link,
.risk-page-current {
    display: inline-block;
    padding: 5px 10px;
    margin: 3px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 15px;
    text-align: center;
}

.risk-page-link {
    color: #0073aa;
    background-color: #fff;
    transition: all 0.2s ease;
}

.risk-page-link:hover {
    background-color: #f2f2f2;
}

.risk-page-current {
    background-color: #0073aa;
    color: #fff;
    font-weight: bold;
}

.risk-pagination-dots,
.risk-page-ellipsis {
    margin: 0 5px;
    align-self: center;
    display: inline-block;
    padding: 5px 10px;
}

/* Disabled pagination button */
.risk-page-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Adjust pagination on mobile */
@media (max-width: 768px) {
    .risk-pagination {
        gap: 3px;
    }
    
    .risk-page-link,
    .risk-page-current {
        padding: 3px 8px;
        margin: 1px;
    }
}

/* Download button */
.risk-download-container {
    margin: 20px 0;
    text-align: center;
}

.risk-download-button {
    display: inline-block;
    background-color: #0073aa;
    color: white !important;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.risk-download-button:hover {
    background-color: #005a87;
    text-decoration: none !important;
}

/* Modal popup */
.risk-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.risk-modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 80%;
    max-width: 700px;
    border-radius: 5px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.risk-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.risk-modal-close:hover {
    color: #333;
}

.risk-modal-body {
    margin-top: 10px;
}

.risk-modal-body h3 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 20px;
}

.risk-detail-row {
    margin-bottom: 10px;
}

.risk-announcement {
    margin-top: 20px;
    margin-bottom: 10px;
}

.risk-announcement-text {
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
}

/* Error message */
.risk-error {
    background-color: #fff1f1;
    border-left: 4px solid #dc3232;
    color: #444;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
    .risk-full-table th, 
    .risk-full-table td {
        padding: 8px 5px;
        font-size: 14px;
    }
    
    .risk-modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 15px;
    }
}