/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Haplogroup Type Index Listing Page - Premium Dark Theme
 * Dark cinematic theme for Y-DNA and mtDNA listing pages
 */

/* ========================================
   Google Fonts Import
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Inter:wght@300;400;500;600;700&display=swap');

/* ========================================
   CSS Custom Properties
   ======================================== */
:root {
    /* Golden Palette */
    --hgx-gold: #C4956A;
    --hgx-gold-light: #D4B896;
    --hgx-gold-dark: #8B6D4F;
    
    /* Dark Backgrounds */
    --hgx-obsidian: #0d1117;
    --hgx-obsidian-light: #161b22;
    --hgx-obsidian-lighter: #1c2128;
    
    /* Text Colors */
    --hgx-text-primary: rgba(255, 255, 255, 0.9);
    --hgx-text-secondary: rgba(255, 255, 255, 0.7);
    --hgx-text-muted: rgba(255, 255, 255, 0.5);
    
    /* Gradients */
    --hgx-gold-gradient: linear-gradient(135deg, #8B6D4F 0%, #C4956A 100%);
}

/* ========================================
   Base & Reset
   ======================================== */
body:has(.hgx-listing-main) {
    background-color: var(--hgx-obsidian) !important;
    background-image: none !important;
}

body:has(.hgx-listing-main) #wrapper,
body:has(.hgx-listing-main) #content-wrapper,
body:has(.hgx-listing-main) #content-fluid {
    background: transparent !important;
}

body:has(.hgx-listing-main) footer {
    background-color: #0a0d12 !important;
}

.hgx-listing-main {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--hgx-text-primary);
    line-height: 1.7;
    background-color: var(--hgx-obsidian);
    padding-top: var(--content-offset, 80px);
}

/* ========================================
   Hero Header Section
   ======================================== */
.hgx-listing-hero {
    text-align: center;
    padding: 60px 24px 40px;
    position: relative;
}

.hgx-listing-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(196, 149, 106, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.hgx-listing-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.hgx-listing-title i {
    color: var(--hgx-gold);
    margin-right: 0.5rem;
}

.hgx-listing-subtitle {
    font-size: 1.125rem;
    color: var(--hgx-text-secondary);
    max-width: 600px;
    margin: 0 auto 24px;
    position: relative;
    z-index: 1;
}

.hgx-breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.hgx-breadcrumb-item {
    color: var(--hgx-text-muted);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.hgx-breadcrumb-item:hover {
    color: var(--hgx-gold);
    text-decoration: none;
}

.hgx-breadcrumb-separator {
    color: var(--hgx-text-muted);
    margin: 0 4px;
}

.hgx-breadcrumb-item.active {
    color: var(--hgx-gold);
}

/* ========================================
   Filter Bar
   ======================================== */
.hgx-filter-bar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.hgx-filter-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

.hgx-search-input-wrapper {
    position: relative;
}

.hgx-search-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hgx-gold);
    z-index: 1;
}

.hgx-search-input-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--hgx-text-primary);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.hgx-search-input-wrapper input::placeholder {
    color: var(--hgx-text-muted);
}

.hgx-search-input-wrapper input:focus {
    outline: none;
    border-color: rgba(196, 149, 106, 0.3);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.1);
}

.hgx-select-wrapper {
    position: relative;
}

.hgx-select-wrapper select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--hgx-text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23C4956A' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.hgx-select-wrapper select:focus {
    outline: none;
    border-color: rgba(196, 149, 106, 0.3);
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(196, 149, 106, 0.1);
}

.hgx-filter-btn {
    background: var(--hgx-gold-gradient);
    color: var(--hgx-obsidian);
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.hgx-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(196, 149, 106, 0.3);
}

.hgx-filter-btn i {
    margin-right: 8px;
}

/* ========================================
   Results Section
   ======================================== */
.hgx-results-section {
    max-width: 1200px;
    margin: 0 auto;
}

.hgx-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px 16px 0 0;
    border-bottom: none;
}

.hgx-results-count {
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
}

.hgx-results-count span {
    color: var(--hgx-gold);
}

.hgx-page-info {
    color: var(--hgx-text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Results Grid (Mobile Alternative)
   ======================================== */
.hgx-results-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 16px 16px;
}

@media (max-width: 768px) {
    .hgx-results-grid {
        display: grid;
    }
}

.hgx-result-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.hgx-result-card:hover {
    transform: translateY(-4px);
    border-color: rgba(196, 149, 106, 0.3);
    box-shadow: 0 8px 24px rgba(196, 149, 106, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.hgx-result-code {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hgx-gold);
    margin-bottom: 0.75rem;
}

.hgx-result-name {
    font-size: 1rem;
    color: var(--hgx-text-primary);
    margin-bottom: 1rem;
}

.hgx-result-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hgx-result-detail-item {
    font-size: 0.875rem;
    color: var(--hgx-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hgx-result-detail-item i {
    color: var(--hgx-gold);
    width: 16px;
}

.hgx-result-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--hgx-gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.hgx-result-link:hover {
    color: var(--hgx-gold-light);
    text-decoration: none;
}

.hgx-result-link i {
    transition: transform 0.2s ease;
}

.hgx-result-link:hover i {
    transform: translateX(4px);
}

/* ========================================
   Results Table (Desktop)
   ======================================== */
.hgx-results-table-wrapper {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 0 16px 16px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .hgx-results-table-wrapper {
        display: none;
    }
}

.hgx-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.hgx-table thead {
    background: rgba(255, 255, 255, 0.03);
}

.hgx-table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hgx-text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hgx-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.hgx-table th.sortable:hover {
    color: var(--hgx-gold);
}

.hgx-table th.sortable i {
    margin-left: 0.5rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.hgx-table th.sortable.active i {
    opacity: 1;
    color: var(--hgx-gold);
}

.hgx-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s ease;
}

.hgx-table tbody tr:hover {
    background: rgba(196, 149, 106, 0.05);
}

.hgx-table tbody tr:last-child {
    border-bottom: none;
}

.hgx-table td {
    padding: 1rem 1.5rem;
    color: var(--hgx-text-primary);
    font-size: 0.9375rem;
}

.hgx-table-code {
    font-weight: 700;
    color: var(--hgx-gold);
}

.hgx-table-code a {
    color: var(--hgx-gold);
    text-decoration: none;
    transition: color 0.2s ease;
}

.hgx-table-code a:hover {
    color: var(--hgx-gold-light);
    text-decoration: none;
}

.hgx-table-name {
    color: var(--hgx-text-primary);
}

.hgx-table-origin,
.hgx-table-time {
    color: var(--hgx-text-secondary);
    font-size: 0.875rem;
}

.hgx-table-subclades {
    text-align: center;
}

.hgx-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(196, 149, 106, 0.2);
    color: var(--hgx-gold);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.hgx-table-actions {
    text-align: right;
}

.hgx-table-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(196, 149, 106, 0.3);
    border-radius: 8px;
    color: var(--hgx-gold);
    text-decoration: none;
    transition: all 0.2s ease;
}

.hgx-table-link:hover {
    background: var(--hgx-gold);
    color: var(--hgx-obsidian);
    border-color: var(--hgx-gold);
    text-decoration: none;
    transform: translateY(-2px);
}

/* ========================================
   Pagination
   ======================================== */
.hgx-pagination-wrapper {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.hgx-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.hgx-pagination-item {
    display: flex;
}

.hgx-pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--hgx-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.hgx-pagination-link:hover {
    background: rgba(196, 149, 106, 0.1);
    border-color: rgba(196, 149, 106, 0.3);
    color: var(--hgx-gold);
    text-decoration: none;
}

.hgx-pagination-item.active .hgx-pagination-link {
    background: var(--hgx-gold-gradient);
    border-color: var(--hgx-gold);
    color: var(--hgx-obsidian);
    font-weight: 600;
}

.hgx-pagination-item.disabled .hgx-pagination-link {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .hgx-filter-form {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hgx-filter-btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .hgx-listing-main {
        padding-top: 60px;
    }

    .hgx-listing-hero {
        padding: 40px 16px 24px;
    }

    .hgx-listing-title {
        font-size: 1.75rem;
    }

    .hgx-listing-subtitle {
        font-size: 1rem;
    }

    .hgx-filter-bar {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .hgx-results-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
        padding: 1rem 1.5rem;
    }

    .hgx-results-grid {
        padding: 1rem;
        gap: 1rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .hgx-filter-bar,
    .hgx-pagination-wrapper {
        display: none;
    }
}
