.checkbox-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-group input {
    display: none;
}

.checkbox-group label {
    padding: 10px 15px;
    border: 1px solid var(--porto-primary-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    min-width: 80px;
    text-transform: capitalize;
    background-color: white;
    display: inline-block;
}

.checkbox-group input:checked + label {
    background-color: var(--porto-primary-color);
    color: white;
    box-shadow: 0px 0px 5px rgba(0, 51, 102, 0.5);
}

.map-controls {
    background: white;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
}
.map-control-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.map-control-btn {
    padding: 6px 10px;
    background: #4a83ec;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
}
.map-control-btn:hover {
    background: #3366cc;
}

#draggable-pie-charts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}
.pie-chart-window {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    width: 300px;
    pointer-events: auto;
    z-index: 1001;
}
.pie-chart-header {
    padding: 8px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    cursor: move;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pie-chart-title {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
}
.pie-chart-body {
    padding: 10px;
    overflow-y: auto;
    height: 600px;
}
.pie-chart-close {
    cursor: pointer;
    padding: 0 5px;
}
.allele-selector {
    margin-bottom: 10px;
    width: 100%;
}
.chart-canvas-container {
    width: 100%;
    height: 250px;
    margin-top: 20px;
}

/* Statistics window styles */
.statistics-window {
    min-width: 400px;
    min-height: 450px;
}

.stats-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.stats-tab {
    padding: 8px 15px;
    background: #f5f5f5;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.stats-tab.active {
    border-bottom-color: #007bff;
    background: #fff;
}

.stats-panel {
    display: none;
}

.stats-panel.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stats-item {
    background: #f9f9f9;
    padding: 10px;
    border-radius: 4px;
}

.stats-label {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
}

.stats-value {
    font-size: 1.2em;
}

.statistics-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 5px;
    font-size: 12px;
}

.statistics-button:hover {
    background: #0069d9;
}

/* check the below */
.pie-chart-window {
    position: absolute;
    background: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    pointer-events: auto;
    overflow: hidden;
}

.pie-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    cursor: move;
}

.pie-chart-title {
    font-weight: bold;
    flex-grow: 1;
}

.pie-chart-close {
    font-size: 20px;
    cursor: pointer;
    line-height: 20px;
    width: 20px;
    text-align: center;
}


.statistics-window {
    resize: both;
    overflow: auto;
}

/* Create a visual indicator for the resize handle */
.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    bottom: 0;
    right: 0;
    cursor: nwse-resize;
    background: repeating-linear-gradient(
        135deg,
        rgba(0,0,0,0.1),
        rgba(0,0,0,0.1) 2px,
        transparent 2px,
        transparent 4px
    );
}


/* Add styles for the stats tabs */
.stats-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.stats-tab {
    padding: 8px 15px;
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.stats-tab.active {
    border-bottom: 2px solid #007bff;
    font-weight: bold;
}

.stats-panel {
    display: none;
}

.stats-panel.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.stats-item {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.stats-label {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Ensure the container allows pointer events on the windows */
#draggable-pie-charts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

#draggable-pie-charts-container > * {
    pointer-events: auto;
}

/* Styles for clickable alleles and action menu */
.clickable-alleles {
    list-style-type: none;
    padding-left: 5px;
}

.clickable-alleles li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.clickable-allele {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.clickable-allele:hover {
    background-color: #e8f0fe;
    color: #1a73e8;
    text-decoration: underline;
}

/* Allele Action Menu Styles */
.allele-action-menu {
    min-width: 220px;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.allele-action-menu ul {
    padding: 5px 0;
}

.allele-action-menu .menu-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.allele-action-menu .menu-item:hover {
    background-color: #f5f5f5;
    color: #1a73e8;
}

/* Statistics Window Styles */
.statistics-window {
    min-height: 300px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pie-chart-window {
    position: absolute;
    z-index: 100;
    resize: both;
    overflow: auto;
    border: 1px solid #ddd;
}

.pie-chart-header {
    background-color: #f5f5f5;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
}

.pie-chart-title {
    font-weight: bold;
    font-size: 15px;
}

.pie-chart-close {
    cursor: pointer;
    font-size: 20px;
    line-height: 20px;
    color: #666;
}

.pie-chart-close:hover {
    color: #333;
}

.pie-chart-body {
    padding: 12px;
}

/* Stats Tabs and Content */
.stats-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 12px;
}

.stats-tab {
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.stats-tab:hover {
    background-color: #f9f9f9;
}

.stats-tab.active {
    border-bottom: 2px solid #1a73e8;
    color: #1a73e8;
    font-weight: 500;
}

.stats-panel {
    display: none;
}

.stats-panel.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stats-item {
    background-color: #f5f7fa;
    padding: 8px 12px;
    border-radius: 4px;
}

.stats-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.stats-value {
    font-size: 16px;
    font-weight: 500;
}

/* Locus selectors */
.overview-locus-selector,
.locus-chart-selector {
    width: 100%;
    padding: 6px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Cross Region Window Specific Styles */
.cross-region-window {
    min-height: 550px;
}

.frequency-info {
    margin-bottom: 12px;
    color: #555;
}

.region-frequency-table {
    border: 1px solid #eee;
    border-radius: 4px;
}

.region-frequency-table table {
    width: 100%;
}

.region-frequency-table th {
    background-color: #f5f5f5;
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

.region-frequency-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.region-frequency-table tr:hover {
    background-color: #eef5ff;
}

/* Chart Type Options */
.chart-type-options {
    margin: 10px 0;
}

.chart-type-btn {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    transition: all 0.2s ease;
}

.chart-type-btn:hover {
    background-color: #e8e8e8;
}

.chart-type-btn.active {
    background-color: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* Canvas container */
.chart-canvas-container {
    position: relative;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
}

/* Container */
.allele-selection-container {
    width: 100%;
    max-width: 600px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 15px;
    margin-top: 10px;
    background-color: #f9f9f9;
}

/* Tab Navigation */
.selection-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 8px 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #2271b1;
    border-bottom-color: #2271b1;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 10px 0;
}

.tab-content.active {
    display: block;
}

/* Type Tab */
.allele-search-wrapper {
    position: relative;
    margin-bottom: 15px;
}

#allele-search {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.allele-autocomplete {
    display: none;
    position: absolute;
    width: 100%;
    max-height: 250px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.autocomplete-item:hover {
    background-color: #f0f7ff;
}

.autocomplete-item:last-child {
    border-bottom: none;
}


.add-allele-btn {
    width: 60px;
    padding: 8px 0;
    margin-left: 10px;
    background-color: #2271b1;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    vertical-align: middle;
    margin-top: 10px;
}

.add-allele-btn:hover {
    background-color: #135e96;
}

/* Selected Alleles */
.selected-alleles-container {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 40px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    padding: 8px;
    background-color: #fff;
}

.selected-alleles-container:empty::before {
    content: 'No alleles selected';
    color: #888;
    font-style: italic;
}

.allele-tag {
    display: inline-flex;
    align-items: center;
    background-color: #e6f0ff;
    border: 1px solid #b8d4ff;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 13px;
}

.remove-allele {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #b8d4ff;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-allele:hover {
    background-color: #7fabff;
}

/* Error Message */
.error-message {
    color: #d63638;
    padding: 10px;
    margin-bottom: 15px;
    background-color: #ffebee;
    border-left: 4px solid #d63638;
    font-size: 14px;
}


:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --text: #343a40;
    --text-light: #6c757d;
    --light: #f8f9fa;
    --border: #dee2e6;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}


h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
}

#haplotype-frequency-form {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 10px;
      background-color: #f5f5f5;
      border-radius: 4px;
      margin-bottom: 10px;
      font-weight: bold;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

select, input[type="text"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background-color: white;
    color: var(--text);
    transition: var(--transition);
    font-size: 14px;
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}



.checkbox-group label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    margin: 0;
    min-width: 60px;
}

.checkbox-group input[type="checkbox"]:checked + label {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.allele-frequency-container {
    margin-top: 10px;
}

.selection-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary);
}

.tab-content {
    display: none;
    padding: 15px 0;
}

.tab-content.active {
    display: block;
}

.allele-search-wrapper {
    position: relative;
}

#allele-search {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 14px;
}

.allele-autocomplete {
    position: absolute;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    z-index: 10;
    display: none;
}

.allele-select {
    width: calc(100% - 100px);
    margin-right: 10px;
}

.add-allele-btn {
    padding: 10px 20px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.add-allele-btn:hover {
    background-color: var(--primary);
}

.selected-alleles-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    min-height: 40px;
    padding: 10px;
    border: 1px dashed var(--border);
    border-radius: var(--border-radius);
}

.switch-container {
    display: flex;
    align-items: center;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin-right: 10px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.search-btn {
    background-color: var(--secondary)  !important;
    border-color: var(--secondary) !important;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: block;
    margin: 20px auto 0;
    width: 200px;
}

.search-btn:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
}

#allele-frequency-map {
    margin-top: 40px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

#allele-charts-container {
    margin-top: 40px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    #haplotype-frequency-form {
        padding: 20px;
    }
}

/* Add these styles to your CSS */
.selection-type-toggle {
    display: flex;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    padding: 10px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: background-color 0.3s;
}

.toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.toggle-btn.active {
    background-color: var(--secondary);
    color: white;
    /* border-color: #0069d9; */
}

.selection-section {
    display: none;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 20px;
}

.selection-section.active {
    display: block;
}

/* Modern Haplotype Frequency Styles */
:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --danger: #e74c3c;
    --warning: #f39c12;
    --border-radius: 6px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --table-header-bg: #2c3e50;
    --table-header-text: #ffffff;
    --table-stripe: rgba(236, 240, 241, 0.5);
    --table-hover: rgba(52, 152, 219, 0.1);
}

/* ======== Form Styling ======== */
#haplotype-frequency-form {
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-bottom: 40px;
}

.form-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.form-section:last-child {
    border-bottom: none;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 15px;
    transition: var(--transition);
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.form-group input.error {
    border-color: var(--danger);
}

.error-message {
    color: var(--danger);
    font-size: 13px;
    margin-top: 5px;
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

/* Button Styling */
.search-btn {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: block;
    margin: 20px auto 0;
    width: 200px;
}

.search-btn:hover {
    background-color: #27ae60 !important;
    transform: translateY(-2px);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.search-btn.loading {
    position: relative;
    color: transparent;
}

.search-btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s infinite linear;
}

/* ======== Results Tables Styling ======== */
#results-container {
    opacity: 0;
    transition: opacity 0.4s ease;
}

#results-container.hide-initially {
    display: none;
}

#results-container:not(.hide-initially) {
    opacity: 1;
}

.wrap h1 {
    font-size: 28px;
    margin-bottom: 30px;
    color: var(--dark);
    border-bottom: 3px solid var(--primary);
    padding-bottom: 10px;
}

.wrap h2 {
    font-size: 22px;
    margin: 35px 0 15px;
    color: var(--dark);
    display: flex;
    align-items: center;
}

.wrap h2::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 20px;
    background-color: var(--primary);
    margin-right: 10px;
    border-radius: 2px;
}

/* Enhanced DataTables styling */
.dataTables_wrapper {
    padding: 0;
    margin-bottom: 40px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.table-controls-left, 
.table-controls-right {
    display: flex;
    align-items: center;
}

.dataTables_length {
    margin-right: 20px;
}

.dataTables_length select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background-color: white;
}

.dataTables_filter {
    position: relative;
}

.dataTables_filter input {
    padding: 10px 15px 10px 35px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    width: 250px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

.table-responsive {
    padding: 0 15px;
    overflow: auto;
}

table.dataTable {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0 !important;
}

table.dataTable thead th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    padding: 12px 10px;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #555 !important;
}

table.dataTable tbody tr {
    background-color: white;
    transition: var(--transition);
}

table.dataTable tbody tr:nth-child(even) {
    background-color: var(--table-stripe);
}

table.dataTable tbody tr:hover {
    background-color: var(--table-hover);
}

table.dataTable tbody td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* Genotype cell styling */
.genotype-cell {
    max-width: 600px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 2px 0;
    font-family: monospace;
}

/* Frequency bar styling */
.frequency-value {
    font-weight: 500;
    font-family: monospace;
}

.frequency-percentage {
    color: #777;
    font-size: 12px;
    margin-top: 2px;
}

.frequency-bar {
    height: 4px;
    background-color: var(--primary);
    border-radius: 2px;
    margin-top: 5px;
    min-width: 2px;
}

/* Pagination styling */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

.dataTables_info {
    color: #666;
    font-size: 14px;
}

.dataTables_paginate {
    display: flex;
}

.paginate_button {
    padding: 8px 12px;
    margin: 0 2px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.paginate_button:not(.disabled):hover {
    background-color: #e9e9e9;
}

.paginate_button.current {
    background-color: var(--primary);
    color: white;
}

.paginate_button.disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Export buttons styling */
.export-buttons {
    display: flex;
    margin-right: 15px;
}

.export-csv,
.export-excel {
    padding: 8px 12px;
    margin-right: 8px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.export-csv:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.export-excel:hover {
    background-color: #27ae60;
    color: white;
    border-color: #27ae60;
}

/* Loading indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-indicator {
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error notification */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    background-color: white;
    border-left: 4px solid var(--danger);
    box-shadow: var(--shadow);
    padding: 15px;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out forwards;
}

.error-icon {
    font-size: 24px;
    margin-right: 15px;
}

.error-content {
    flex: 1;
}

.error-content h3 {
    margin: 0 0 5px 0;
    color: var(--danger);
    font-size: 16px;
}

.error-content p {
    margin: 0;
    color: #555;
    font-size: 14px;
}

.close-error {
    background: none;
    border: none;
    font-size: 20px;
    color: #aaa;
    cursor: pointer;
    padding: 0 5px;
}

.close-error:hover {
    color: #555;
}

@keyframes slideIn {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

/* ======== Responsive adjustments ======== */
@media (max-width: 768px) {
    .form-section {
        padding: 15px;
    }
    
    .table-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .table-controls-left, 
    .table-controls-right {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .dataTables_filter input {
        width: 100%;
    }
    
    .export-buttons {
        margin-bottom: 10px;
        margin-right: 0;
    }
    
    .table-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dataTables_info {
        margin-bottom: 10px;
    }
    
    .dataTables_paginate {
        width: 100%;
        overflow-x: auto;
    }
}


.export-buttons-container {
    margin: 10px 0;
    padding: 5px 0;
    display: flex;
    gap: 10px;
}

.export-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.export-buttons .dashicons {
    font-size: 16px;
    height: 16px;
    width: 16px;
}

/* Export Button Container */
.custom-buttons-container {
    display: flex;
    margin: 10px 0;
  }
  
  .export-buttons {
    display: flex;
    gap: 8px;
    margin-left: auto;
  }
  
  /* Export CSV Button Specific */
  .export-csv {
    background-color: #0073aa !important;
    color: white !important;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #006799 !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
  }
  
  .export-csv:hover {
    background-color: #006799 !important;
  }
  
  .export-csv:focus {
    outline: none;
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px #0073aa !important;
  }
  
  .export-csv:active {
    background-color: #005a87 !important;
    transform: translateY(1px);
  }
  
  /* Responsive adjustments */
  @media screen and (max-width: 768px) {
    .custom-buttons-container {
      flex-direction: column;
      align-items: flex-start;
    }
    
    .export-buttons {
      margin-left: 0;
      margin-top: 8px;
      width: 100%;
    }
    
    .export-csv {
      width: 100%;
    }
  }


  .view-toggle-buttons {
    margin: 20px 0;
}

.view-btn {
    margin-right: 10px;
    padding: 8px 16px;
    background-color: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.view-btn:hover {
    background-color: #005177;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
}
/* Large Dataset Optimizations */
.dataTables_wrapper {
    margin-top: 20px;
}

.dataTables_processing {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200px;
    margin-left: -100px;
    margin-top: -26px;
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Pagination styling */
.dataTables_paginate {
    margin-top: 15px !important;
    text-align: center;
}

.dataTables_info {
    margin-top: 15px !important;
    float: left;
}

.dataTables_length {
    float: left;
    margin-bottom: 10px;
}

.dataTables_filter {
    float: right;
    margin-bottom: 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.5em 1em;
    margin-left: 2px;
    display: inline-block;
    cursor: pointer;
    color: #333 !important;
    border: 1px solid transparent;
    border-radius: 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    color: white !important;
    border: 1px solid #111;
    background: #585858;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    color: white !important;
    border: 1px solid #979797;
    background: #b0b0b0;
}

/* Performance optimizations for large tables */
.dataTables_wrapper .dataTable {
    table-layout: fixed;
}

.genotype-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Progress indicator for large datasets */
.large-dataset-progress {
    background: #f0f0f0;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
    font-style: italic;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: #007cba;
    transition: width 0.3s ease;
}

/* Clear floats */
.dataTables_wrapper:after {
    content: "";
    display: table;
    clear: both;
}