﻿/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 *
 * Spotlights Detail page styles - extends the Shared Roots cinematic
 * design system (src-*/srv-*) with Spotlight-specific components:
 * hero badges, key facts, tags, timeline, dynamic sections, sample
 * catalog (table/cards), publications, AI panel, and related cards.
 */

/* ========================================
   HERO EXTENSIONS
   ======================================== */
.spot-hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.spot-hero-bg-fallback {
    background: linear-gradient(135deg, #2a2417 0%, #0d0d0f 100%);
}

.spot-hero-bg-fallback img {
    display: none;
}

/* ========================================
   KEY FACTS / TAGS (Overview)
   ======================================== */
.spot-key-facts {
    margin-top: 40px;
}

.spot-tags-section {
    max-width: 900px;
    margin: 40px auto 0;
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.spot-tags-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
}

.spot-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spot-tag-badge {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(184, 149, 106, 0.12);
    color: #d4b896;
    border: 1px solid rgba(184, 149, 106, 0.25);
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.spot-tag-badge:hover {
    background: #b8956a;
    color: #14151a;
    text-decoration: none;
}

.spot-overview-map {
    max-width: 900px;
    margin: 40px auto 0;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spot-overview-map .src-map-container {
    height: 220px;
}

.spot-map-popup .leaflet-popup-content-wrapper {
    background: #1a1810;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(184, 149, 106, 0.3);
    border-radius: 8px;
}

.spot-map-popup .leaflet-popup-content {
    margin: 10px 14px;
    font-size: 0.85rem;
}

.spot-map-popup .leaflet-popup-content strong {
    color: #d4b896;
}

.spot-map-popup .leaflet-popup-tip {
    background: #1a1810;
    border: 1px solid rgba(184, 149, 106, 0.3);
}

/* ========================================
   TIMELINE
   ======================================== */
.spot-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 56px;
}

.spot-timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #b8956a, rgba(184, 149, 106, 0.15));
    border-radius: 2px;
}

.spot-timeline-item {
    position: relative;
    padding-bottom: 36px;
}

.spot-timeline-item:last-child {
    padding-bottom: 0;
}

.spot-timeline-marker {
    position: absolute;
    left: -56px;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #14151a;
    border: 3px solid #b8956a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8956a;
    z-index: 1;
}

.spot-timeline-content {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 24px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.spot-timeline-content:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(184, 149, 106, 0.25);
}

.spot-timeline-date {
    display: inline-block;
    background: rgba(184, 149, 106, 0.15);
    color: #d4b896;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.spot-timeline-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 6px;
}

.spot-timeline-description {
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.7;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .spot-timeline {
        padding-left: 44px;
    }

    .spot-timeline::before {
        left: 14px;
    }

    .spot-timeline-marker {
        left: -44px;
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   DYNAMIC CONTENT SECTIONS
   ======================================== */
.spot-section-layout {
    align-items: center;
}

.spot-section-bullets {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.spot-section-bullets li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.85);
}

.spot-section-bullets li i {
    color: #b8956a;
    margin-top: 4px;
}

.spot-section-media img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* ========================================
   SAMPLE CATALOG - View Toggle
   ======================================== */
.spotlight-view-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.spotlight-view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(184, 149, 106, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.spotlight-view-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(184, 149, 106, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.spotlight-view-toggle-btn.active {
    background: rgba(184, 149, 106, 0.18);
    border-color: #b8956a;
    color: #d4b896;
}

/* ========================================
   SAMPLE CATALOG - Search and Count
   ======================================== */
.spotlight-catalog-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.spotlight-catalog-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.spotlight-catalog-search .dna-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.35);
}

.spotlight-catalog-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(184, 149, 106, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.spotlight-catalog-search input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.spotlight-catalog-search input:focus {
    border-color: #b8956a;
}

.spotlight-catalog-count {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* ========================================
   SAMPLE CATALOG - Table
   ======================================== */
.spotlight-ancient-table-wrapper {
    overflow-x: auto;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.spotlight-ancient-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.spotlight-ancient-table thead {
    background: rgba(184, 149, 106, 0.1);
}

.spotlight-ancient-table th {
    padding: 14px 12px;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #d4b896;
    border-bottom: 2px solid rgba(184, 149, 106, 0.3);
}

.spotlight-ancient-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.spotlight-ancient-table tbody tr:hover,
.spotlight-clickable-row:hover {
    background: rgba(184, 149, 106, 0.06) !important;
}

.spotlight-ancient-table td {
    padding: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    vertical-align: middle;
}

.spotlight-sample-portrait {
    position: relative;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
}

.spotlight-sample-portrait img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.spotlight-sample-name-cell strong {
    color: #d4b896;
}

.spotlight-haplo-code {
    background: rgba(184, 149, 106, 0.15);
    color: #7ccc8f;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85rem;
}

.spotlight-sex-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.spotlight-sex-badge.male {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.spotlight-sex-badge.female {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
}

.spotlight-clickable-row {
    transition: all 0.2s ease;
    cursor: pointer;
}

.spotlight-table-loadmore,
.spotlight-catalog-loadmore {
    text-align: center;
    margin-top: 24px;
}

/* ========================================
   SAMPLE CATALOG - Cards Grid
   ======================================== */
.spotlight-catalog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 992px) {
    .spotlight-catalog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .spotlight-catalog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.spotlight-sample-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(184, 149, 106, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.spotlight-sample-card:hover {
    background: rgba(184, 149, 106, 0.07);
    border-color: rgba(184, 149, 106, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.spotlight-sample-hidden,
.spotlight-table-row-hidden {
    display: none !important;
}

.spotlight-card-portrait {
    width: 100%;
    aspect-ratio: 1;
    max-width: 120px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
}

.spotlight-card-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spotlight-sample-info {
    width: 100%;
    text-align: center;
}

.spotlight-sample-id {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #d4b896;
    margin-bottom: 4px;
}

.spotlight-sample-name {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 8px;
}

.spotlight-sample-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 8px;
}

.spotlight-sample-meta-item i {
    color: #b8956a;
    margin-right: 4px;
}

.spotlight-sample-haplo {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.spotlight-haplo-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.spotlight-haplo-badge.ydna {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.spotlight-haplo-badge.mtdna {
    background: rgba(236, 72, 153, 0.2);
    color: #f9a8d4;
}

@media (max-width: 768px) {
    .spotlight-view-toggle {
        flex-direction: column;
        gap: 8px;
    }

    .spotlight-view-toggle-btn {
        width: 100%;
        justify-content: center;
    }

    .spotlight-catalog-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .spotlight-catalog-search {
        max-width: 100%;
    }

    .spotlight-ancient-table {
        min-width: 600px;
        font-size: 0.8rem;
    }
}

/* ========================================
   PUBLICATIONS
   ======================================== */
.publications-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.publication-card {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.publication-card:hover {
    border-color: rgba(184, 149, 106, 0.25);
    transform: translateY(-2px);
}

.publication-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 12px;
    line-height: 1.5;
}

.publication-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.publication-title a:hover {
    color: #b8956a;
}

.publication-authors {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.publication-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 16px;
}

.publication-meta-item i {
    color: #b8956a;
    margin-right: 6px;
}

.publication-abstract {
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.publication-abstract p {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.65);
}

.btn-toggle-abstract {
    background: none;
    border: none;
    color: #d4b896;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.3s ease;
}

.btn-toggle-abstract:hover {
    color: #f0dcc0;
}

.publication-actions {
    margin-top: 8px;
}

.publication-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: rgba(184, 149, 106, 0.12);
    border: 1px solid rgba(184, 149, 106, 0.3);
    color: #d4b896;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.publication-link-btn:hover {
    background: #b8956a;
    color: #14151a;
    text-decoration: none;
}

/* ========================================
   AI ASSISTANT PANEL
   ======================================== */
.spot-ai-panel .ai-section-panel {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 48px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .spot-ai-panel .ai-section-panel {
        padding: 28px;
    }
}

.spot-ai-panel .ai-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.spot-ai-panel .ai-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f5f0e8;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.spot-ai-panel .ai-section-title small {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: normal;
}

.spot-ai-panel .ai-license-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.spot-ai-panel .ai-license-badge.licensed {
    background: rgba(46, 125, 88, 0.9);
    color: white;
}

.spot-ai-panel .ai-license-badge.unlicensed {
    background: #b8956a;
    color: #14151a;
}

.spot-ai-panel .ai-info-alert {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
}

.spot-ai-panel .ai-info-alert i {
    color: #b8956a;
    margin-right: 8px;
}

.spot-ai-panel .ai-suggested-prompts {
    margin-bottom: 24px;
}

.spot-ai-panel .ai-suggested-prompts-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.spot-ai-panel .ai-suggested-prompts-label i {
    color: #b8956a;
}

.spot-ai-panel .ai-prompt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 8px;
    margin-bottom: 8px;
}

.spot-ai-panel .ai-prompt-btn:hover {
    background: #b8956a;
    border-color: #b8956a;
    color: #14151a;
}

.spot-ai-panel .ai-prompt-btn i {
    color: #b8956a;
}

.spot-ai-panel .ai-prompt-btn:hover i {
    color: #14151a;
}

.spot-ai-panel .ai-main-action {
    text-align: center;
}

.spot-ai-panel .ai-explain-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    background: #b8956a;
    border: none;
    border-radius: 50px;
    color: #14151a;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 24px rgba(184, 149, 106, 0.35);
}

.spot-ai-panel .ai-explain-btn:hover {
    background: #cba876;
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(184, 149, 106, 0.45);
}

.spot-ai-panel .ai-explain-btn img {
    width: 24px;
    height: 24px;
}

.spot-ai-panel .ai-results {
    margin-top: 32px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.spot-ai-panel .ai-results:empty {
    display: none;
}

.spot-ai-panel .ai-result-content {
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.8;
    font-size: 1rem;
}

.spot-ai-panel .ai-result-content p {
    margin-bottom: 16px;
}

.spot-ai-panel .ai-sample-output {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.spot-ai-panel .ai-sample-output h6 {
    color: #f5f0e8;
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spot-ai-panel .ai-sample-output h6 i {
    color: #b8956a;
}

.spot-ai-panel .ai-sample-content {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.95rem;
    line-height: 1.7;
    position: relative;
}

.spot-ai-panel .ai-blur-overlay {
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(4px);
    padding: 20px;
    border-radius: 12px;
    margin-top: 16px;
}

.spot-ai-panel .ai-blur-overlay p {
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 12px;
}

.spot-ai-panel .ai-blur-overlay ul {
    color: rgba(255, 255, 255, 0.55);
    padding-left: 20px;
    margin: 0;
}

.spot-ai-panel .ai-unlock-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #b8956a;
    color: #14151a;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.spot-ai-panel .ai-unlock-btn:hover {
    background: #cba876;
    color: #14151a;
    text-decoration: none;
    transform: translateY(-2px);
}

/* ========================================
   RELATED CULTURES
   ======================================== */
.related-carousel {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 16px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.related-carousel::-webkit-scrollbar {
    height: 8px;
}

.related-carousel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.related-carousel::-webkit-scrollbar-thumb {
    background: #b8956a;
    border-radius: 4px;
}

.related-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.03);
}

.related-card:hover {
    transform: translateY(-6px);
    border-color: rgba(184, 149, 106, 0.35);
    text-decoration: none;
    color: inherit;
}

.related-image {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.related-image .ac-placeholder-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.related-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
}

.related-content {
    padding: 20px;
}

.related-era {
    font-size: 0.75rem;
    color: #b8956a;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.related-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f5f0e8;
    margin: 8px 0 0;
}

/* ========================================
   FOOTER CTA
   ======================================== */
.spot-footer-cta-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .src-page-nav,
    .src-bottom-nav,
    .src-back-to-top,
    .src-scroll-progress,
    .spotlight-view-toggle,
    .spotlight-table-loadmore,
    .spotlight-catalog-loadmore,
    .btn-toggle-abstract,
    .spot-ai-panel {
        display: none !important;
    }
}
