body {
    padding-bottom: 60px;
}

.container {
    position: relative;
    padding: 1rem;
}

.loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    min-height: 230px;
}

.loaded {
    display: none;
}

.loading-icon {
    width: 5rem;
    height: 5rem;
}

.acc-btn-icon::after {
    margin-left: 1rem;
}

.fading-text {
    animation: fadeInOut 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    } 
}

/* NEW: CSS class for the Select All/Deselect All button */
.filter-control-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 10px;
    transition: background-color 0.2s ease;
}

.filter-control-btn:hover {
    background-color: #0056b3;
}

.filter-control-btn:active {
    background-color: #004085;
}

.difficulty-disclaimer { 
    margin-top: 12px;
    padding: 8px 12px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 13px;
    color: #856404;
    line-height: 1.4;
}

/* Interactive Dataset List Styles */
.aps-chart-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    align-items: flex-start;
}
/* Allow zoom and pan */
#aps-chart {
    touch-action: manipulation; 
    user-select: none; 
    cursor: grab;
}

#aps-chart:active {
    cursor: grabbing; /* Show grabbing cursor when dragging */
}

.aps-chart-wrapper {
    flex: 4;
    min-width: 0; 
    overflow: hidden; 
}

.aps-dataset-list-wrapper {
    flex: 1;
    max-width: 220px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

.aps-dataset-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 5px;
    margin-top: 25px; 
    flex-shrink: 0; 
}

.aps-dataset-list-header h5 {
    margin: 0;
    font-weight: bold;
    color: #666;
    font-size: 18px;
    text-align: center;
    flex: 1;
    font-weight: bold; 
}

/* Clear highlight button styling */
.aps-dataset-list-header .btn-sm {
    font-size: 9.5px;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 3px;
}

.aps-dataset-list-header .btn-sm i {
    font-size: 10px;
    margin-right: 0.2rem;
}

.aps-dataset-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    height: 550px; 
    overflow-y: auto;
    overflow-x: hidden; 
    border: 1px solid #e5e7eb;
}

.aps-dataset-item {
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
}

.aps-dataset-item:last-child {
    border-bottom: none;
}

.aps-dataset-item:hover {
    background-color: #f8fafc;
    transform: translateX(2px);
}

.aps-dataset-item.highlighted {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.aps-dataset-item.highlighted:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateX(3px);
}

.aps-dataset-name {
    font-size: 14px;
    font-weight: 500;
}

.aps-dataset-item.highlighted .aps-dataset-name {
    font-weight: 600;
}

/* Responsive adjustments for the chart container */
@media (max-width: 1024px) {
    .aps-chart-container {
        flex-direction: column;
    }
    
    .aps-dataset-list-wrapper {
        max-width: none;
        min-width: 0;
    }
    
    .aps-dataset-list {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .aps-chart-container {
        gap: 15px;
        margin: 15px 0;
    }
    
    .aps-dataset-list-header h5 {
        font-size: 16px;
    }
    
    .aps-dataset-item {
        padding: 10px 12px;
    }
    
    .aps-dataset-name {
        font-size: 13px;
    }
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    box-shadow: none;
    border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-top: 0;
    margin-bottom: 0;
}

.modern-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modern-table thead th {
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 16px 20px;
    text-align: center;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0.025em;
    border-top: none;
}

.modern-table thead th:last-child {
    border-right: none;
}

.modern-table thead th:first-child {
    text-align: left;
}

.modern-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background-color: #f9fafb;
}

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

.modern-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.modern-table tbody tr:nth-child(even):hover {
    background-color: #f1f5f9;
}

.modern-table tbody td {
    padding: 12px 20px;
    font-size: 14px;
    color: #374151;
    border: none;
    border-right: 1px solid #e5e7eb;
    text-align: center;
}

.modern-table tbody td:last-child {
    border-right: none;
}

.modern-table tbody td:first-child {
    font-weight: 500;
    color: #1f2937;
    text-align: left;
}

/* Section headers */
.modern-section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    border-radius: 12px 12px 0 0;
    letter-spacing: 0.025em;
    border: none;
}

/* Table sections */
.modern-table-section {
    margin-bottom: 5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: white;
}

/* Remove gaps between header and table */
.modern-section-header+.modern-table {
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: none;
}

.modern-table-section .modern-table {
    border-top: none;
}

.modern-no-data {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-style: italic;
    background: white;
    border-right: none !important;
}

.compact-spacing {
    margin-bottom: 1rem !important;
}

.compact-spacing-large {
    margin-bottom: 2rem !important;
}

.modern-section-divider {
    margin: 3rem 0;
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #667eea 50%, transparent 100%);
    border-radius: 1px;
}

.modern-section-divider+.modern-table-section {
    margin-top: 3rem;
}

/* Modal overlay */
.info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.info-modal-overlay.show {
    display: flex;
}

/* Modal content container */
.info-modal-content {
    background: white;
    border-radius: 12px;
    padding: 0;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    margin: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

/* Modal header */
.info-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.info-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.info-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.info-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Modal body */
.info-modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Modal section styling */
.info-modal-section {
    margin-bottom: 25px;
}

.info-modal-section:last-child {
    margin-bottom: 0;
}

/* Individual level items */
.info-modal-level {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 18px;
    border-radius: 10px;
    background: #f8f9fa;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.info-modal-level:hover {
    background: #f1f3f4;
    transform: translateX(2px);
}

/* Level badges */
.info-modal-badge {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 20px;
    min-width: 90px;
    text-align: center;
    flex-shrink: 0;
    color: white;
}

.info-modal-badge.very-hard {
    background: #343a40;
}

.info-modal-badge.hard {
    background: #dc3545;
}

.info-modal-badge.medium {
    background: #ffc107;
    color: #000;
}

.info-modal-badge.easy {
    background: #0d6efd;
}

.info-modal-badge.very-easy {
    background: #198754;
}

.info-modal-badge.very-low {
    background: #6c757d;
}

.info-modal-badge.low {
    background: #dc3545;
}

.info-modal-badge.moderate {
    background: #ffc107;
    color: #000;
}

.info-modal-badge.high {
    background: #0d6efd;
}

.info-modal-badge.very-high {
    background: #198754;
}

/* Level information */
.info-modal-info {
    flex: 1;
}

.info-modal-info h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 16px;
    font-weight: 600;
}

.info-modal-info p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.5;
}

/* Info icon styling for modals */
.info-icon-modal {
    color: #0d6efd;
    cursor: pointer;
    margin-left: 8px;
    font-size: 16px;
    font-weight: bold;
    display: inline-block;
    min-width: 16px;
    min-height: 16px;
    transition: color 0.2s ease;
}

.info-icon-modal:hover {
    color: #0056b3;
}

/* Responsive modal design */
@media (max-width: 768px) {
    .info-modal-content {
        max-width: 95vw;
        max-height: 90vh;
        margin: 10px;
    }
    
    .info-modal-header {
        padding: 15px 20px;
    }
    
    .info-modal-title {
        font-size: 18px;
    }
    
    .info-modal-body {
        padding: 20px;
    }
    
    .info-modal-level {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .info-modal-badge {
        margin-right: 0;
        margin-bottom: 10px;
        min-width: auto;
    }
    
    .info-modal-info h4 {
        font-size: 14px;
    }
    
    .info-modal-info p {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .info-modal-content {
        max-width: 98vw;
        margin: 5px;
    }
    
    .info-modal-header {
        padding: 12px 15px;
    }
    
    .info-modal-title {
        font-size: 16px;
    }
    
    .info-modal-body {
        padding: 15px;
    }
    
    .info-modal-level {
        padding: 12px;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {
    .modern-table {
        font-size: 12px;
    }

    .modern-table thead th,
    .modern-table tbody td {
        padding: 10px 16px;
    }

    .modern-section-header {
        padding: 12px 16px;
        font-size: 16px;
    }

    .modern-no-data {
        padding: 20px;
    }

    .modern-table-section {
        margin-bottom: 3rem;
    }
}

@media (max-width: 480px) {

    .modern-table thead th,
    .modern-table tbody td {
        padding: 8px 12px;
        font-size: 11px;
    }

    .modern-section-header {
        font-size: 14px;
        padding: 10px 12px;
    }

    .modern-table-section {
        margin-bottom: 2.5rem;
    }
}