/* 
    *     File         : phylogenetic.css
    *     Description  : Styles for the phylogenetic tree visualization
*/

.phylogenetic-container {
    width: 90%;
    margin-left: 5%;
    margin-right: 5%;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background-color: #f9f9f9;
}

.tree-controls {
    margin-bottom: 15px;
    text-align: center;
}

.tree-controls button {
    margin: 0 5px;
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.tree-controls button:hover {
    background-color: #45a049;
}

.tree-controls button.active {
    background-color: #45a049;
}

.tree-svg {
    width: 100%;
    height: 600px;
    border: 1px solid #ccc;
    background-color: white;
}

.node circle {
    fill: #fff;
    stroke: steelblue;
    stroke-width: 3px;
    cursor: pointer;
}

.node text {
    font: 12px sans-serif;
    cursor: pointer;
}

.node--internal circle {
    fill: lightsteelblue;
}

.node--internal text {
    text-shadow: 0 1px 0 #fff, 0 -1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff;
}

.link {
    fill: none;
    stroke: #ccc;
    stroke-width: 2px;
}

.phylo-tooltip {
    position: absolute;
    text-align: left;
    width: auto;
    height: auto;
    padding: 8px;
    font: 12px sans-serif;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    z-index: 10000; /* Increased to match unified tooltip z-index */
}

/* 
    File         : index.css
    Description  : Index page specific styles
    Updated      : September 24, 2025 - Improved organization and centered search results
*/

/* Search section styles */
/* Styles centralisés dans components/search-container.css */

/* Search button */
.search-container .button {
    padding: 12px 25px;
    font-size: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-container .button:hover {
    background-color: var(--primary-hover);
}

/* Search input styling */
.search-container input[type="text"],
.search-container input:not([type="submit"]) {
    padding: 12px 15px;
    font-size: 16px;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-container input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(63, 113, 174, 0.2);
    outline: none;
}

/* Examples section */
.search-examples {
    margin-top: 15px;
    color: #6c757d;
}

.search-examples a {
    margin: 0 5px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.search-examples a:hover {
    text-decoration: underline;
}

/* Search actions (Advanced Search button) */
.search-actions {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

.search-actions .button-secondary {
    background-color: transparent;
    color: var(--primary-color);
    padding: 5px 10px;
    font-size: 13px;
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.search-actions .button-secondary:hover {
    background-color: rgba(63, 113, 174, 0.1);
    text-decoration: none;
}

/* Page-card styling is now centralized in components/page-card.css */

/* Results container width alignment */
/* Styles centralisés dans components/search-container.css */

/* Table layout improvements - now in components/results-table.css */

/* Responsive: narrow screens revert to wrapping if needed */
@media (max-width: 850px) {
    .page-index .search-container,
    .page-index .page-card,
    .page-index .results-main-container {
        max-width: 100%;
    }
}

.page-card .card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.page-card .card-header .icon {
    font-size: 32px;
    color: #3F71AE;
    flex-shrink: 0;
    line-height: 1;
}

.page-card .card-header h2 {
    font-size: 22px;
    color: #2d3748;
    margin: 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.page-card .card-body {
    padding: 0;
}

/* Search results and table styles - moved to components/results-table.css */

/* Search summary container - defined in unified-containers.css */

/* Pagination wrapper to center pagination */
.pagination-wrapper {
    max-width: 800px;
    width: 100%;
    margin: 15px auto;
    box-sizing: border-box;
    clear: both;
    display: flex;
    justify-content: center;
}

/* Top pagination styling */
.top-pagination {
    display: block;
    margin-bottom: 15px;
    background-color: #ffffff;
}

/* Bottom pagination - hide on index page */
.page-index .bottom-pagination {
    display: none !important;
}

/* Bottom pagination - show on other pages */
.bottom-pagination:not(.page-index .bottom-pagination) {
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Results count display */
.results-count-display {
    text-align: center;
    color: #6c757d;
    font-size: 14px;
    max-width: 800px;
    width: 100%;
    margin: 0 auto 30px;
    padding: 15px 0;
    border-top: 1px solid #e2e8f0;
}

/* Footer info section styling */
.page-footer-info {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 20px;
    font-size: 12px;
    color: #6c757d;
    padding: 10px;
    background-color: transparent;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border-top: 1px solid #e2e8f0;
}

.cache-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cache-indicator.active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.cache-indicator.inactive {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.debug-controls {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #dee2e6;
}

.debug-controls a {
    color: #6c757d;
    text-decoration: none;
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.debug-controls a:hover {
    color: #495057;
    background-color: #e9ecef;
    text-decoration: underline;
}

/* Alert styling improvements */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Cache management panel styling */
.cache-management h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #495057;
}

.cache-actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cache-stats {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.cache-stats h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #495057;
    font-size: 16px;
}

.cache-stats ul {
    margin: 0;
    padding-left: 20px;
}

.cache-stats li {
    margin-bottom: 5px;
    color: #6c757d;
}

/* Responsive adjustments - simplified */
@media (max-width: 850px) {
    .search-results .results-table {
        table-layout: auto !important;
    }
}

/* Small screen adaptations */
@media (max-width: 600px) {
    .search-results {
        overflow-x: auto !important;
    }
    
    .search-results .results-table {
        min-width: 600px;
    }
    
    .page-index .search-results {
        border-radius: 8px !important;
    }
}

/* Table header styling - consolidated */
.page-index .results-table thead {
    background-color: var(--primary-color) !important;
}

/* Sort indicators */
.page-index .results-table th.sort-indicator:after,
.page-index .results-table th.sort-asc:after,
.page-index .results-table th.sort-desc:after {
    color: rgba(255,255,255,0.9) !important;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}

/* Ensure the first column header and cells have enough width to avoid truncation */
.page-index .results-main-container .search-results .results-table th:nth-child(1),
.page-index .results-main-container .search-results .results-table td:nth-child(1) {
    min-width: 150px;
}

/* Container width standardization */
.page-index .page-card,
.page-index .results-main-container,
.page-index .pagination-wrapper {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Index: avoid double separators between results count and footer */
.page-index .page-footer-info {
    border-top: 1px solid #e2e8f0 !important; /* single separator */
    margin-top: 10px !important;
}

.page-index .debug-controls {
    border-top: 0 !important; /* remove inner line */
    padding-top: 0 !important;
}

/* Table container styling - adjusted for white results-card */
.page-index .search-results {
    padding: 0 !important;
    overflow: hidden;
    background: #ffffff !important;
    border: none !important; /* Supprimé car results-card a déjà une bordure */
    border-radius: 8px !important;
    box-shadow: none !important; /* Supprimé car results-card a déjà une ombre */
    width: 98% !important; /* Légèrement réduit pour créer une marge visuelle */
    max-width: 980px !important;
    margin: 0 auto 20px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
}

/* Hover effect removed as results-card now has white background */

.page-index .search-results .results-table {
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    width: 100% !important;
    margin: 0 auto !important;
    border-collapse: collapse !important;
    font-size: 14px !important;
}

/* Ensure last row does not draw an extra line beyond the container border */
.page-index .search-results .results-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Table header links styling */
.page-index .results-table thead th a,
.page-index .advanced-results-table thead th a {
    color: #fff !important;
    text-decoration: none !important;
    display: block !important;
}

.page-index .results-table thead th a:hover,
.page-index .advanced-results-table thead th a:hover {
    text-decoration: underline !important;
}

/* Results card styling - with white background */
.page-index .results-card {
    padding: 0;
    background-color: #ffffff; /* Fond blanc */
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px auto;
    width: 100%;
    max-width: 1100px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-index .pagination-wrapper {
    padding: 20px 15px 10px;
    text-align: center;
    background-color: #ffffff;
}

.page-index .results-count-display {
    padding: 0 15px 20px;
    text-align: center;
    width: 100%;
    background-color: #ffffff;
}

/* Unified table header styling - matching advanced search */
.page-index .results-table th,
.page-index .advanced-results-table th {
    background-color: #4a7bab !important;
    color: white !important;
    border: 1px solid #3a6a9b;
    opacity: 1 !important;
    padding: 12px 15px !important;
    text-align: left !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

/* Centered search results container - styled like advanced search */
/* This style is now consolidated with the table container styling below */

/* Table styling for index page - matching advanced search */
.page-index .results-table {
    border-collapse: collapse !important;
    box-shadow: none !important;
}

/* Table cell styling */
.page-index .results-table td {
    padding: 10px 15px !important;
    border: 1px solid #e1e1e1 !important;
    text-align: left !important;
    font-size: 14px !important;
}

/* Override already covered in unified table header links styling above */