﻿/** * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * TraitAncestryCross Cinematic Styles
 * A narrative-driven design for chromosome-level traits ancestry cross-reference.
 * Matches the aesthetic of TraitsCategoryList.cshtml
 */

/* ========================================
   CSS Custom Properties - Warm Palette
   ======================================== */
:root {
    /* Primary Colors */
    --tac-cream: #FAF8F5;
    --tac-warm-white: #FFFBF7;
    --tac-terracotta: #C4A484;
    --tac-terracotta-light: #D4B494;
    --tac-terracotta-dark: #A48464;
    --tac-sage: #87A878;
    --tac-sage-light: #A7C898;
    --tac-sage-dark: #678858;
    --tac-charcoal: #2D3436;
    --tac-charcoal-light: #4D5456;
    
    /* Accent Colors */
    --tac-gold: #D4AF37;
    --tac-copper: #B87333;
    --tac-forest: #355E3B;
    
    /* Neutral Colors */
    --tac-gray-50: #F9FAFB;
    --tac-gray-100: #F3F4F6;
    --tac-gray-200: #E5E7EB;
    --tac-gray-300: #D1D5DB;
    --tac-gray-400: #9CA3AF;
    --tac-gray-500: #6B7280;
    --tac-gray-600: #4B5563;
    --tac-gray-700: #374151;
    --tac-gray-800: #1F2937;
    --tac-gray-900: #111827;
    
    /* Confidence Colors */
    --tac-confidence-high: #22c55e;
    --tac-confidence-medium: #f59e0b;
    --tac-confidence-low: #6b7280;
    
    /* Shadows */
    --tac-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --tac-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --tac-shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --tac-shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --tac-shadow-warm: 0 10px 40px rgba(196, 164, 132, 0.15);
    --tac-shadow-terracotta: 0 8px 30px rgba(196, 164, 132, 0.25);
    
    /* Typography */
    --tac-font-display: 'Josefin Sans', system-ui, -apple-system, sans-serif;
    --tac-font-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Transitions */
    --tac-transition-fast: 150ms ease;
    --tac-transition: 300ms ease;
    --tac-transition-slow: 500ms ease;
}

/* ========================================
   Base & Main Container
   ======================================== */
.tac-main {
    background: var(--tac-warm-white);
    min-height: 100vh;
}

/* ========================================
   Hero Section
   ======================================== */
.tac-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    color: white;
}

.tac-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(135deg, rgba(45, 52, 54, 0.75) 0%, rgba(45, 52, 54, 0.9) 100%),
                url('/img/reports/traits/traits/traits-header.webp') center/cover no-repeat;
    background-attachment: fixed;
}

@media (max-width: 991px) {
    .tac-hero-bg {
        background-attachment: scroll;
    }
}

.tac-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(196, 164, 132, 0.1) 0%,
        transparent 30%,
        transparent 70%,
        rgba(45, 52, 54, 0.3) 100%
    );
    pointer-events: none;
}

.tac-hero-particles {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(196, 164, 132, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(135, 168, 120, 0.1) 0%, transparent 40%);
    animation: tacHeroParticles 20s ease-in-out infinite;
}

@keyframes tacHeroParticles {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.tac-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 120px 20px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.tac-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(196, 164, 132, 0.2);
    border: 1px solid rgba(196, 164, 132, 0.4);
    color: var(--tac-terracotta-light);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: tacFadeInUp 0.8s ease-out 0.2s forwards;
}

.tac-hero-title {
    font-family: var(--tac-font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: white;
    opacity: 0;
    animation: tacFadeInUp 0.8s ease-out 0.4s forwards;
}

.tac-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.85) !important;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto 2rem;
    font-weight: 400;
    opacity: 0;
    animation: tacFadeInUp 0.8s ease-out 0.5s forwards;
}

/* Scroll Indicator */
.tac-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tac-scroll-indicator i {
    margin-top: 8px;
    animation: tac-bounce 2s ease-in-out infinite;
}

@keyframes tac-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(8px); }
    60% { transform: translateY(4px); }
}

.tac-hero-description {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0;
    animation: tacFadeInUp 0.8s ease-out 0.6s forwards;
}

.tac-hero-sample {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(135, 168, 120, 0.2);
    border: 1px solid rgba(135, 168, 120, 0.4);
    color: var(--tac-sage-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: tacFadeInUp 0.8s ease-out 0.7s forwards;
}

.tac-hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    opacity: 0;
    animation: tacFadeInUp 0.8s ease-out 0.8s forwards;
}

.tac-hero-stat {
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    min-width: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--tac-transition);
}

.tac-hero-stat:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.tac-stat-number {
    display: block;
    font-family: var(--tac-font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--tac-terracotta-light);
    line-height: 1.2;
}

.tac-stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

@keyframes tacFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Section Base Styles
   ======================================== */
.tac-section {
    padding: 5rem 0;
}

.tac-section-light {
    background: var(--tac-warm-white);
}

.tac-section-warm {
    background: linear-gradient(180deg, var(--tac-cream) 0%, var(--tac-warm-white) 100%);
}

.tac-section-narrative {
    background: var(--tac-charcoal);
    color: white;
    position: relative;
    overflow: hidden;
}

.tac-section-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(196, 164, 132, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(135, 168, 120, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.tac-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tac-section-label {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--tac-terracotta);
    margin-bottom: 0.75rem;
}

.tac-section-narrative .tac-section-label {
    color: var(--tac-terracotta-light);
}

.tac-section-title {
    font-family: var(--tac-font-display);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 600;
    color: var(--tac-charcoal);
    margin-bottom: 1rem;
}

.tac-section-narrative .tac-section-title {
    color: white;
}

.tac-section-subtitle {
    font-size: 1.1rem;
    color: var(--tac-gray-600);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.tac-section-narrative .tac-section-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

/* ========================================
   Stats Dashboard
   ======================================== */
.tac-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.tac-stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--tac-shadow-warm);
    transition: var(--tac-transition);
    border: 2px solid transparent;
}

.tac-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tac-shadow-md);
}

.tac-stat-card-primary {
    border-color: var(--tac-terracotta-light);
}

.tac-stat-card-success {
    border-color: var(--tac-sage);
}

.tac-stat-card-warning {
    border-color: var(--tac-gold);
}

.tac-stat-card-info {
    border-color: var(--tac-terracotta);
}

.tac-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    color: white;
}

.tac-stat-card-primary .stat-icon {
    background: linear-gradient(135deg, var(--tac-terracotta-light), var(--tac-terracotta));
}

.tac-stat-card-success .stat-icon {
    background: linear-gradient(135deg, var(--tac-sage-light), var(--tac-sage));
}

.tac-stat-card-warning .stat-icon {
    background: linear-gradient(135deg, var(--tac-gold), var(--tac-copper));
}

.tac-stat-card-info .stat-icon {
    background: linear-gradient(135deg, var(--tac-terracotta), var(--tac-terracotta-dark));
}

.tac-stat-card .stat-value {
    font-family: var(--tac-font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--tac-charcoal);
    margin-bottom: 0.25rem;
}

.tac-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--tac-gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   Upload Form Card
   ======================================== */
.tac-upload-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--tac-shadow-warm);
    overflow: hidden;
    max-width: 800px;
    margin: 0 auto;
}

.tac-upload-header {
    background: linear-gradient(135deg, var(--tac-terracotta) 0%, var(--tac-terracotta-dark) 100%);
    padding: 1.5rem 2rem;
    color: white;
}

.tac-upload-header h4 {
    font-family: var(--tac-font-display);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tac-upload-body {
    padding: 2rem;
}

.tac-form-group {
    margin-bottom: 1.5rem;
}

.tac-form-label {
    font-weight: 600;
    color: var(--tac-charcoal);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tac-form-label i {
    color: var(--tac-terracotta);
}

.tac-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--tac-gray-200);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: var(--tac-transition);
    background: var(--tac-gray-50);
    appearance: none;
    -webkit-appearance: none;
    -moz-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='%23C4A484' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.tac-form-control:focus {
    outline: none;
    border-color: var(--tac-terracotta);
    background-color: white;
    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='%23A48464' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    box-shadow: 0 0 0 4px rgba(196, 164, 132, 0.1);
}

.tac-form-control option {
    background: white;
    color: var(--tac-charcoal);
    padding: 0.5rem;
}

.tac-custom-file {
    position: relative;
}

.tac-custom-file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.tac-custom-file-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border: 2px dashed var(--tac-gray-300);
    border-radius: 10px;
    background: var(--tac-gray-50);
    color: var(--tac-gray-600);
    transition: var(--tac-transition);
    cursor: pointer;
}

.tac-custom-file-label:hover {
    border-color: var(--tac-terracotta);
    background: var(--tac-cream);
}

.tac-custom-file-label::after {
    content: "Browse";
    background: linear-gradient(135deg, var(--tac-terracotta) 0%, var(--tac-terracotta-dark) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.tac-form-hint {
    font-size: 0.85rem;
    color: var(--tac-gray-500);
    margin-top: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.tac-form-hint i {
    color: var(--tac-sage);
    margin-top: 2px;
}

/* ========================================
   Buttons
   ======================================== */
.tac-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--tac-terracotta) 0%, var(--tac-terracotta-dark) 100%);
    color: white;
    padding: 0.875rem 1.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--tac-transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--tac-shadow);
    font-size: 0.95rem;
}

.tac-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--tac-shadow-lg);
    color: white;
    text-decoration: none;
}

.tac-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--tac-terracotta-dark);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--tac-transition);
    border: 2px solid var(--tac-terracotta);
    cursor: pointer;
    font-size: 0.9rem;
}

.tac-btn-secondary:hover {
    background: var(--tac-terracotta);
    color: white;
    text-decoration: none;
}

.tac-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: white;
    color: var(--tac-gray-700);
    padding: 0.6rem 1.25rem;
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--tac-transition);
    border: 1px solid var(--tac-gray-300);
    cursor: pointer;
    font-size: 0.9rem;
}

.tac-btn-outline:hover {
    border-color: var(--tac-terracotta);
    color: var(--tac-terracotta);
    text-decoration: none;
}

.tac-btn-success {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--tac-sage) 0%, var(--tac-sage-dark) 100%);
    color: white;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: var(--tac-transition);
    border: none;
    cursor: pointer;
    box-shadow: var(--tac-shadow);
    font-size: 1rem;
}

.tac-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--tac-shadow-lg);
    color: white;
    text-decoration: none;
}

/* ========================================
   Legend Card
   ======================================== */
.tac-legend-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--tac-shadow-warm);
    margin-bottom: 2rem;
}

.tac-legend-title {
    font-family: var(--tac-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tac-charcoal);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tac-legend-title i {
    color: var(--tac-terracotta);
}

.tac-ancestry-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tac-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--tac-gray-50);
    border: 1px solid var(--tac-gray-200);
    border-radius: 20px;
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    color: var(--tac-charcoal);
    transition: var(--tac-transition);
}

.tac-legend-item:hover {
    border-color: var(--tac-terracotta-light);
    background: white;
}

.tac-legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* ========================================
   Filter Bar
   ======================================== */
.tac-filter-bar {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--tac-shadow-warm);
    margin-bottom: 2rem;
}

.tac-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.tac-filter-title {
    font-family: var(--tac-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tac-charcoal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.tac-filter-title i {
    color: var(--tac-terracotta);
}

.tac-filter-clear {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--tac-gray-300);
    border-radius: 6px;
    background: white;
    color: var(--tac-gray-600);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--tac-transition);
}

.tac-filter-clear:hover {
    background: var(--tac-gray-100);
}

.tac-ethnicity-grid {
    max-height: 250px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--tac-gray-50);
    border-radius: 10px;
    border: 1px solid var(--tac-gray-200);
}

.tac-ethnicity-item {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
}

.tac-ethnicity-item .custom-control-label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--tac-gray-700);
    transition: var(--tac-transition);
}

.tac-ethnicity-item .custom-control-label:hover {
    color: var(--tac-terracotta);
}

.tac-ethnicity-item .custom-control-input:checked ~ .custom-control-label {
    color: var(--tac-terracotta);
    font-weight: 600;
}

.tac-ethnicity-item .custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--tac-terracotta);
    border-color: var(--tac-terracotta);
}

.tac-filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--tac-gray-200);
}

.tac-filter-count {
    font-size: 0.9rem;
    color: var(--tac-gray-500);
}

.tac-filter-count strong {
    color: var(--tac-terracotta);
}

/* ========================================
   Results Header
   ======================================== */
.tac-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tac-results-title {
    font-family: var(--tac-font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--tac-charcoal);
    margin: 0;
}

.tac-results-subtitle {
    font-size: 0.9rem;
    color: var(--tac-gray-500);
    margin-top: 0.25rem;
}

.tac-results-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--tac-terracotta) 0%, var(--tac-terracotta-dark) 100%);
    color: white;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.75rem;
}

/* ========================================
   Trait Cards Grid
   ======================================== */
.tac-traits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.tac-trait-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--tac-shadow-warm);
    transition: var(--tac-transition);
    border: 1px solid var(--tac-gray-100);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tac-trait-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--tac-shadow-md);
    border-color: var(--tac-terracotta-light);
}

.tac-trait-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tac-trait-title {
    font-family: var(--tac-font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tac-charcoal);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.tac-trait-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.tac-trait-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tac-trait-badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--tac-confidence-high);
}

.tac-trait-badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--tac-confidence-medium);
}

.tac-trait-badge-secondary {
    background: var(--tac-gray-100);
    color: var(--tac-gray-600);
}

.tac-trait-badge-info {
    background: rgba(196, 164, 132, 0.1);
    color: var(--tac-terracotta-dark);
}

.tac-trait-summary {
    font-size: 0.9rem;
    color: var(--tac-gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.tac-trait-ancestries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.tac-trait-ancestry {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--tac-gray-50);
    border: 1px solid var(--tac-gray-200);
    border-radius: 15px;
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    color: var(--tac-charcoal);
}

.tac-trait-ancestry-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.tac-trait-action {
    margin-top: auto;
}

/* ========================================
   Error Alert
   ======================================== */
.tac-error-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.tac-error-alert i {
    color: #ef4444;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.tac-error-alert p {
    margin: 0;
    color: #991b1b;
}

.tac-error-alert strong {
    color: #7f1d1d;
}

/* ========================================
   CTA Footer Section
   ======================================== */
.tac-cta-section {
    background: linear-gradient(135deg, var(--tac-charcoal) 0%, #1a1f20 100%);
    padding: 4rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tac-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(196, 164, 132, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(135, 168, 120, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.tac-cta-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.tac-cta-title {
    font-family: var(--tac-font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: white;
    line-height: 1.4;
    margin-bottom: 1rem;
}

.tac-cta-title span {
    color: var(--tac-terracotta-light);
}

.tac-cta-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.tac-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

/* ========================================
   Animations for Scroll
   ======================================== */
.tac-animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.tac-animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   Drawer / Panel Styles
   ======================================== */
.trait-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
    pointer-events: none;
}

.trait-drawer.open {
    pointer-events: auto;
}

.trait-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(45, 52, 54, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1049;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.trait-drawer.open .trait-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.trait-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    max-width: 800px;
    height: 100vh;
    background: var(--tac-warm-white);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.trait-drawer.open .trait-drawer-panel {
    transform: translateX(0);
}

.trait-drawer-header {
    background: linear-gradient(135deg, var(--tac-terracotta) 0%, var(--tac-terracotta-dark) 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.trait-drawer-title {
    font-family: var(--tac-font-display);
    font-weight: 600;
    font-size: 1.35rem;
    color: white;
    margin: 0;
    flex-grow: 1;
    padding-right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.trait-drawer-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.trait-drawer-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.trait-drawer-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.trait-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 1.5rem;
    scroll-behavior: smooth;
    background: white;
}

/* ========================================
   Drawer Content Cards
   ======================================== */
.tac-drawer-summary {
    background: linear-gradient(135deg, var(--tac-cream) 0%, var(--tac-warm-white) 100%);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--tac-gray-200);
}

.tac-drawer-section {
    margin-bottom: 2rem;
}

.tac-drawer-section-title {
    font-family: var(--tac-font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--tac-charcoal);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tac-drawer-section-title i {
    color: var(--tac-terracotta);
}

/* ========================================
   Ancestry Tag Style (for Haplotypes)
   ======================================== */
.tac-ancestry-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--tac-gray-200);
    border-left: 4px solid var(--tac-terracotta);
    color: var(--tac-charcoal);
    padding: 0.4rem 0.75rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: var(--tac-transition);
}

.tac-ancestry-tag:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.tac-ancestry-tag-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.tac-ancestry-tag-text {
    font-weight: 600;
    color: var(--tac-charcoal);
}

.tac-ancestry-tag-interpolated {
    font-size: 0.65rem;
    color: var(--tac-gray-400);
    margin-left: 0.25rem;
}

.tac-ancestry-tag-meta {
    font-size: 0.7rem;
    color: var(--tac-gray-500);
    margin-top: 0.35rem;
    padding-left: 1rem;
}

/* ========================================
   Drawer Table Styles
   ======================================== */
.tac-drawer-table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--tac-shadow-sm);
    border: 1px solid var(--tac-gray-200);
}

.trait-drawer-body .table {
    font-size: 0.85rem;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

.trait-drawer-body .table thead th {
    background: linear-gradient(180deg, var(--tac-cream) 0%, #F5F0EB 100%);
    color: var(--tac-charcoal);
    font-weight: 700;
    border-bottom: 2px solid var(--tac-terracotta);
    padding: 0.875rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    cursor: pointer;
    transition: var(--tac-transition);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.trait-drawer-body .table thead th:hover {
    background: var(--tac-terracotta-light);
    color: white;
}

.trait-drawer-body .table thead th:first-child {
    border-top-left-radius: 12px;
}

.trait-drawer-body .table thead th:last-child {
    border-top-right-radius: 12px;
}

.trait-drawer-body .table td {
    vertical-align: middle;
    padding: 0.875rem 0.75rem;
    border-bottom: 1px solid var(--tac-gray-100);
    background: white;
}

.trait-drawer-body .table tbody tr:nth-child(even) td {
    background: var(--tac-gray-50);
}

.trait-drawer-body .table tbody tr:hover td {
    background: rgba(196, 164, 132, 0.08);
}

.trait-drawer-body .table tbody tr:last-child td {
    border-bottom: none;
}

.trait-drawer-body .table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.trait-drawer-body .table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* Table Cell Styling */
.tac-cell-mono {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--tac-charcoal);
}

.tac-cell-mono-bold {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--tac-terracotta-dark);
}

.tac-cell-number {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-size: 0.8rem;
    color: var(--tac-gray-700);
}

/* ========================================
   Drawer Search and Export
   ======================================== */
.tac-drawer-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tac-drawer-search {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--tac-gray-200);
    border-radius: 10px;
    padding: 0 0.75rem;
    transition: var(--tac-transition);
    max-width: 280px;
    flex: 1;
}

.tac-drawer-search:focus-within {
    border-color: var(--tac-terracotta);
    box-shadow: 0 0 0 3px rgba(196, 164, 132, 0.15);
}

.tac-drawer-search i {
    color: var(--tac-terracotta);
    font-size: 0.9rem;
}

.tac-drawer-search input {
    border: none;
    background: transparent;
    padding: 0.6rem 0.5rem;
    font-size: 0.9rem;
    width: 100%;
    color: var(--tac-charcoal);
}

.tac-drawer-search input:focus {
    outline: none;
}

.tac-drawer-search input::placeholder {
    color: var(--tac-gray-400);
}

.trait-drawer-body .snp-search {
    border: 2px solid var(--tac-gray-200);
    border-radius: 8px;
    transition: var(--tac-transition);
}

.trait-drawer-body .snp-search:focus {
    border-color: var(--tac-terracotta);
    box-shadow: 0 0 0 3px rgba(196, 164, 132, 0.1);
}

.trait-drawer-body .export-snp-csv {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: white;
    border: 2px solid var(--tac-terracotta-light);
    border-radius: 8px;
    color: var(--tac-terracotta-dark);
    padding: 0.5rem 0.875rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--tac-transition);
    cursor: pointer;
}

.trait-drawer-body .export-snp-csv:hover {
    background: var(--tac-terracotta);
    border-color: var(--tac-terracotta);
    color: white;
}

/* ========================================
   Confidence Badges in Drawer
   ======================================== */
.tac-confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.tac-confidence-high {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(34, 197, 94, 0.08) 100%);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.tac-confidence-medium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tac-confidence-low {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.15) 0%, rgba(107, 114, 128, 0.08) 100%);
    color: #4b5563;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

/* ========================================
   Chromosome Browser Section
   ======================================== */
.tac-chromosome-browser {
    background: var(--tac-gray-50);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--tac-gray-200);
}

/* Mobile Styles (slides from bottom) */
@media (max-width: 768px) {
    .tac-hero-content {
        padding: 100px 20px 50px;
    }
    
    .trait-drawer-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: 85vh;
        max-height: 85vh;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.2);
    }

    .trait-drawer.open .trait-drawer-panel {
        transform: translateY(0);
    }

    .trait-drawer-header {
        border-radius: 20px 20px 0 0;
        position: relative;
    }

    .trait-drawer-header::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.4);
        border-radius: 2px;
    }
}

/* ========================================
   Color-blind Friendly Patterns
   ======================================== */
.cb-patterns .tac-legend-swatch,
.cb-patterns .tac-trait-ancestry-swatch {
    background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.3) 0, rgba(255,255,255,.3) 4px, transparent 4px, transparent 8px);
}

/* ========================================
   Empty State
   ======================================== */
.tac-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--tac-shadow-warm);
}

.tac-empty-icon {
    width: 80px;
    height: 80px;
    background: var(--tac-cream);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.tac-empty-icon i {
    font-size: 2rem;
    color: var(--tac-gray-400);
}

.tac-empty-state h4 {
    font-family: var(--tac-font-display);
    font-size: 1.25rem;
    color: var(--tac-charcoal);
    margin-bottom: 0.5rem;
}

.tac-empty-state p {
    color: var(--tac-gray-500);
    margin-bottom: 1.5rem;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 991px) {
    .tac-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tac-traits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tac-hero {
        min-height: auto;
        padding: 100px 0 60px;
    }
}

@media (max-width: 767px) {
    .tac-section {
        padding: 3rem 0;
    }
    
    .tac-stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .tac-traits-grid {
        grid-template-columns: 1fr;
    }
    
    .tac-hero {
        padding: 100px 0 50px;
        background-attachment: scroll;
    }
    
    .tac-hero-stats {
        gap: 1rem;
    }
    
    .tac-hero-stat {
        padding: 0.75rem 1rem;
        min-width: 80px;
    }
    
    .tac-stat-number {
        font-size: 1.5rem;
    }
    
    .tac-results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tac-upload-body {
        padding: 1.5rem;
    }
    
    .tac-filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .tac-filter-options {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .tac-scroll-indicator {
        display: none;
    }
}

@media (max-width: 575px) {
    .tac-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tac-cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .tac-cta-buttons .tac-btn-primary,
    .tac-cta-buttons .tac-btn-secondary {
        width: 100%;
        max-width: 280px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .tac-hero,
    .tac-cta-section,
    .tac-filter-bar,
    .tac-btn-primary,
    .tac-btn-secondary,
    .tac-btn-outline,
    .tac-btn-success,
    .trait-drawer {
        display: none !important;
    }
    
    .tac-section {
        padding: 1.5rem 0;
        break-inside: avoid;
    }
    
    .tac-trait-card,
    .tac-stat-card,
    .tac-upload-card,
    .tac-legend-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .tac-main {
        background: white;
    }
}
