/* Rule of Law Dashboard - Frontend Styles */

.rold-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Collapsible Intro */
.rold-dashboard-intro-wrapper {
    margin-bottom: 30px;
}

.rold-intro-toggle {
    background: #fff !important;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 14px 20px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555 !important;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    box-shadow: none !important;
}

.rold-intro-toggle:hover {
    background: #f8f9fa !important;
    border-color: #2271b1;
    color: #2271b1 !important;
}

.rold-intro-toggle:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    background: #fff !important;
    color: #555 !important;
}

.rold-intro-toggle:active {
    background: #fff !important;
    color: #555 !important;
}

.rold-intro-toggle[aria-expanded="true"] {
    border-radius: 6px 6px 0 0;
    border-bottom-color: transparent;
    background: #fff !important;
    color: #555 !important;
}

.rold-toggle-icon {
    font-size: 10px;
    transition: transform 0.3s;
    display: inline-block;
}

.rold-intro-toggle[aria-expanded="true"] .rold-toggle-icon {
    transform: rotate(90deg);
}

.rold-dashboard-intro {
    background: #fff;
    padding: 25px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    margin-top: -1px;
}

.rold-dashboard-intro p {
    margin: 0 0 15px 0;
    line-height: 1.6;
    color: #333;
    font-size: 14px;
}

.rold-dashboard-intro p:last-child {
    margin-bottom: 0;
}

/* Filters */
.rold-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #e8f2ff, #f6f9ff);
    border: 1px solid #c7d9f2;
    border-radius: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.rold-filter-group {
    flex: 1;
    min-width: 200px;
}

.rold-filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.rold-filter {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    transition: all 0.2s;
    cursor: pointer;
}

.rold-filter:hover {
    border-color: #2271b1;
}

.rold-filter:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Loading State */
.rold-loading {
    text-align: center;
    padding: 60px 20px;
}

.rold-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Table Styles */
.rold-table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
    border: 1px solid #cfd8e6;
    box-shadow: 0 8px 18px rgba(15, 35, 95, 0.05);
    border-radius: 8px;
    background: #ffffff;
}

.rold-cases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 0;
}

.rold-cases-table thead {
    background: linear-gradient(90deg, #e6f0ff, #f2f7ff);
}

.rold-cases-table th {
    padding: 16px 16px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
    white-space: nowrap;
    vertical-align: middle;
}

.rold-cases-table tbody tr {
    border-bottom: 1px solid #edf1f8;
    transition: background-color 0.2s, transform 0.15s;
}

.rold-cases-table tbody tr:hover {
    background-color: #f3f7ff;
    transform: translateY(-1px);
}

.rold-cases-table tbody tr:last-child {
    border-bottom: none;
}

.rold-cases-table tbody tr:nth-child(even) {
    background-color: #fbfdff;
}

.rold-cases-table td {
    padding: 16px 16px;
    vertical-align: middle;
    line-height: 1.5;
}

.rold-case-number {
    font-weight: 500;
    min-width: 150px;
    width: 20%;
}

.rold-case-number a {
    color: #1d63b5;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}

.rold-case-number a:hover {
    text-decoration: underline;
}

.rold-discontinued {
    display: inline-block;
    color: #999;
    font-style: italic;
    font-size: 12px;
    margin-left: 5px;
}

.rold-ecli {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 4px;
    line-height: 1.3;
}

.rold-case-name {
    min-width: 200px;
    width: 35%;
}

.rold-case-name a {
    color: #2271b1;
    text-decoration: none;
}

.rold-case-name a:hover {
    text-decoration: underline;
}

.rold-case-date {
    min-width: 120px;
    white-space: nowrap;
    width: 15%;
}

.rold-case-summary {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}

.rold-summary-toggle {
    background: #2271b1;
    color: #fff;
    border: 1px solid #2271b1;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-block;
    text-decoration: none;
}

.rold-summary-toggle:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.rold-summary-toggle:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Results Info */
.rold-results-info {
    padding: 12px 16px;
    background: linear-gradient(90deg, #eaf3ff, #f7fbff);
    border: 1px solid #cfd8e6;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* No Cases Message */
.rold-no-cases {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 0;
}

.rold-no-cases p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Pagination */
.rold-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 25px 20px;
    margin-top: 30px;
}

.rold-page-btn {
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
    min-width: 40px;
}

.rold-page-btn:hover {
    background: #f8f9fa;
    border-color: #2271b1;
    color: #2271b1;
}

.rold-page-btn.rold-page-current {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    font-weight: 600;
    pointer-events: none;
}

.rold-page-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rold-page-dots {
    padding: 0 5px;
    color: #666;
}

/* Summary Modal */
.rold-summary-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rold-summary-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s;
    position: relative;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.rold-summary-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
}

.rold-summary-modal p {
    line-height: 1.8;
    color: #555;
    margin: 0;
}

.rold-case-details {
    margin-top: 10px;
}

.rold-detail-row {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eee;
    line-height: 1.6;
    color: #555;
    font-size: 14px;
}

.rold-detail-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rold-detail-row strong {
    display: inline-block;
    min-width: 150px;
    color: #333;
    font-weight: 600;
    margin-right: 10px;
    vertical-align: top;
}

.rold-detail-row a {
    color: #2271b1;
    text-decoration: none;
}

.rold-detail-row a:hover {
    text-decoration: underline;
}

.rold-detail-row .rold-discontinued {
    color: #999;
    font-style: italic;
    font-size: 12px;
    margin-left: 5px;
}

.rold-summary-section {
    margin-top: 10px;
}

.rold-summary-content {
    margin-top: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.rold-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #999;
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
}

.rold-modal-close:hover,
.rold-modal-close:focus {
    color: #333;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .rold-cases-table {
        font-size: 13px;
    }
    
    .rold-cases-table th,
    .rold-cases-table td {
        padding: 12px 10px;
    }
}

@media screen and (max-width: 768px) {
    .rold-filters {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .rold-filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }
    
    .rold-filter-group label {
        font-size: 13px;
        font-weight: 600;
    }
    
    .rold-filter {
        width: 100%;
        min-width: auto;
        padding: 12px 14px;
    }
    
    .rold-pagination {
        flex-wrap: wrap;
        gap: 5px;
        padding: 20px 10px;
    }
    
    .rold-page-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 35px;
    }
    
    .rold-table-wrapper {
        border: none;
        border-radius: 0;
    }
    
    .rold-cases-table {
        display: block;
    }
    
    .rold-cases-table thead {
        display: none;
    }
    
    .rold-cases-table tbody {
        display: block;
    }
    
    .rold-cases-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 15px;
        background: #fff;
    }
    
    .rold-cases-table td {
        display: block;
        padding: 8px 0;
        border: none;
        min-width: auto !important;
    }
    
    .rold-cases-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 5px;
        color: #333;
    }
    
    .rold-summary-modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }
    
    .rold-detail-row strong {
        min-width: 120px;
        display: block;
        margin-bottom: 5px;
    }
    
    .rold-detail-row {
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 480px) {
    .rold-dashboard-intro {
        padding: 20px;
    }
    
    .rold-summary-modal-content {
        margin: 30% auto;
    }
}
