
/**
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Ancestry report styling.
 */


/*
 * Copyright (c) 2026 DNA Genics, S.L. All rights reserved.
 * 
 * Ancestry shared region cards styling.
 */

/* ========================================
   Shared Ancestry Region Cards & Drawer Styles
   Used by: SharedAncientOrigins, SharedModernOrigins
   ======================================== */

/* Region Cards Grid */
.region-cards-section {
    margin-top: 3rem;
    margin-bottom: 3rem;
}

.region-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.region-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.region-card-highlight {
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        border: none;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(0, 180, 216, 0.4), 0 10px 30px rgba(0, 180, 216, 0.3) !important;
        border: 2px solid var(--dnagenics-teal);
    }
}

.region-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.region-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.region-card:hover .region-card-image img {
    transform: scale(1.05);
}

.region-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
}

.region-percentage-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--dnagenics-teal);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.region-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.region-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dnagenics-dark);
    margin-bottom: 0.5rem;
}

.continent-badge {
    display: inline-block;
    background: var(--dnagenics-lime);
    color: var(--dnagenics-dark);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.region-card-description {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.region-card .btn-learn-more {
    align-self: flex-start;
    font-weight: 600;
    transition: all 0.3s ease;
}

.region-card:hover .btn-learn-more {
    transform: translateX(5px);
}

/* ========================================
   Region Detail Drawer
   ======================================== */

/* Drawer Container */
.region-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1060;
    pointer-events: none;
}

.region-drawer.open {
    pointer-events: auto;
}

/* Backdrop */
.region-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 8, 5, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 1059;
    pointer-events: none;
}

.region-drawer.open .region-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer Panel - Desktop (slides from right) */
.region-drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    max-width: 780px;
    height: 100vh;
    background: #faf8f5;
    box-shadow: -8px 0 48px rgba(0, 0, 0, 0.18);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid rgba(160, 82, 45, 0.12);
}

.region-drawer.open .region-drawer-panel {
    transform: translateX(0);
}

/* Drawer Header */
.region-drawer-header {
    background: #fff;
    border-bottom: 1px solid rgba(160, 82, 45, 0.15);
    padding: 1.75rem 2rem 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 1rem;
}

.region-drawer-title {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: 1.6rem;
    line-height: 1.25;
    color: #2c1a0e;
    margin: 0;
    flex-grow: 1;
    letter-spacing: -0.01em;
}

.region-drawer-close {
    background: transparent;
    border: 1px solid rgba(160, 82, 45, 0.2);
    color: #a0522d;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 1rem;
}

.region-drawer-close:hover {
    background: rgba(160, 82, 45, 0.08);
    border-color: rgba(160, 82, 45, 0.4);
    color: #7a3b1e;
    transform: rotate(90deg);
}

.region-drawer-close:focus {
    outline: 2px solid rgba(160, 82, 45, 0.4);
    outline-offset: 2px;
}

/* Drawer Body */
.region-drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(160, 82, 45, 0.25) transparent;
}

.region-drawer-body::-webkit-scrollbar {
    width: 6px;
}

.region-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.region-drawer-body::-webkit-scrollbar-thumb {
    background: rgba(160, 82, 45, 0.25);
    border-radius: 3px;
}

/* Mobile Styles (slides from bottom) */
@media (max-width: 768px) {
    .region-drawer-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
        height: 88vh;
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
        border-left: none;
        border-top: 1px solid rgba(160, 82, 45, 0.15);
        box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.2);
    }
    
    .region-drawer.open .region-drawer-panel {
        transform: translateY(0);
    }
    
    .region-drawer-header {
        border-radius: 20px 20px 0 0;
        padding: 1.5rem 1.5rem 1.25rem;
        position: relative;
    }
    
    /* Mobile Drag Handle */
    .region-drawer-drag-handle {
        display: block;
        width: 36px;
        height: 4px;
        background: rgba(160, 82, 45, 0.2);
        border-radius: 2px;
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .region-drawer-title {
        font-size: 1.35rem;
        margin-top: 8px;
    }
}

/* Hide drag handle on desktop */
.region-drawer-drag-handle {
    display: none;
}

/* Prevent body scroll when drawer is open */
body.drawer-open {
    overflow: hidden;
}

/* ========================================
   Region Detail Content Sections
   ======================================== */

.region-detail-section {
    padding: 1.75rem 2rem;
    border-bottom: 1px solid rgba(160, 82, 45, 0.08);
    background: #fff;
}

.region-detail-section:last-child {
    border-bottom: none;
}

.region-detail-section + .region-detail-section {
    margin-top: 0;
}

.region-detail-section h5 {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 600;
    font-size: 1.15rem;
    color: #a0522d;
    margin-bottom: 0.9rem;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.region-detail-section p {
    color: #3d2b1a;
    line-height: 1.75;
    font-size: 0.96rem;
}

.region-detail-hero {
    position: relative;
    height: 260px;
    overflow: hidden;
    background: #1a0f08;
}

.region-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

.region-detail-stats {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(10, 5, 2, 0.85) 0%, rgba(10, 5, 2, 0.3) 70%, transparent 100%);
    padding: 2rem 2rem 1.5rem;
    color: white;
}

.region-stat-item {
    display: inline-block;
    margin-right: 2.5rem;
}

.region-stat-value {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 2.2rem;
    font-weight: 700;
    display: block;
    line-height: 1;
    color: #f0d080;
    letter-spacing: -0.02em;
}

.region-stat-label {
    font-size: 0.78rem;
    opacity: 0.75;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
    display: block;
}

/* Countries List - elegant grid */
.countries-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-left: 2px solid rgba(160, 82, 45, 0.25);
    color: #3d2b1a;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.country-item:hover {
    border-left-color: #a0522d;
}

.country-item .dna-icon {
    color: #a0522d;
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

/* Custom typography helpers for drawer content */
.sao-drawer-lead {
    color: #5a3d28;
    line-height: 1.75;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.sao-drawer-subtitle {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #a0522d;
    margin-bottom: 0.6rem;
}

.sao-drawer-muted {
    color: #7a6252;
    font-size: 0.88rem;
    line-height: 1.65;
}

.sao-drawer-link {
    color: #a0522d;
    text-decoration: none;
    border-bottom: 1px solid rgba(160, 82, 45, 0.3);
    transition: border-color 0.2s ease;
}

.sao-drawer-link:hover {
    border-bottom-color: #a0522d;
    color: #7a3b1e;
}

/* Read More Button - elegant outline style */
.sao-drawer-read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: transparent;
    border: 1px solid rgba(160, 82, 45, 0.4);
    border-radius: 4px;
    color: #a0522d;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sao-drawer-read-more-btn:hover {
    background: rgba(160, 82, 45, 0.07);
    border-color: #a0522d;
    color: #7a3b1e;
    transform: none;
}

/* Resources section - lighter visual weight */
.sao-drawer-resources {
    background: #faf8f5;
}

.sao-drawer-resources h5 {
    font-size: 0.95rem;
}

/* Mobile responsive section padding */
@media (max-width: 768px) {
    .region-detail-section {
        padding: 1.5rem;
    }
    
    .region-detail-hero {
        height: 200px;
    }
    
    .region-stat-value {
        font-size: 1.8rem;
    }
    
    .countries-list {
        grid-template-columns: 1fr 1fr;
        gap: 0.35rem;
    }
}

/* ========================================
   Animation for card entrance
   ======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.region-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.region-card:nth-child(1) { animation-delay: 0.1s; }
.region-card:nth-child(2) { animation-delay: 0.2s; }
.region-card:nth-child(3) { animation-delay: 0.3s; }
.region-card:nth-child(4) { animation-delay: 0.4s; }
.region-card:nth-child(5) { animation-delay: 0.5s; }
.region-card:nth-child(6) { animation-delay: 0.6s; }

/* ========================================
   Mobile Responsive for Region Cards
   ======================================== */

@media (max-width: 768px) {
    .region-card-image {
        height: 180px;
    }
    
    .region-percentage-badge {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    .region-card-body {
        padding: 1rem;
    }
    
    .region-detail-modal .modal-dialog {
        margin: 0.5rem;
    }
    
    .region-detail-section {
        padding: 1.5rem;
    }
    
    .region-detail-hero {
        height: 200px;
    }
    
    .countries-list {
        grid-template-columns: 1fr;
    }
}

