
/* MuslimAncestry Browse Page - Matching Real Estate/NikahFinder Style */
.muslimancestry-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 9px 12px 11px;
    text-align: center;
    position: relative;
    margin-bottom: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(102, 126, 234, 0.2);
}

.muslimancestry-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255,255,255,0.08), transparent 55%),
                radial-gradient(circle at 80% 30%, rgba(255,255,255,0.06), transparent 50%);
    opacity: 0.7;
}

.muslimancestry-hero h1 {
    font-size: clamp(1rem, 1.9vw, 1.3rem);
    font-weight: 800;
    margin-bottom: 3px;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
    line-height: 1.2;
}

.muslimancestry-hero p {
    font-size: clamp(0.78rem, 1.2vw, 0.9rem);
    opacity: 0.95;
    margin: 0 auto 6px;
    max-width: 620px;
    position: relative;
    z-index: 1;
    line-height: 1.35;
}



.hero-meta {
    position: relative;
    z-index: 1;
    margin-top: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
    gap: 6px;
}

.hero-meta-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 7px 9px;
    backdrop-filter: blur(5px);
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.hero-meta-number {
    font-size: clamp(0.88rem, 1.3vw, 1rem);
    font-weight: 700;
    display: block;
    margin-bottom: 1px;
}

.hero-meta-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    opacity: 0.85;
}

.hero-search-status {
    margin-top: 5px;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.25px;
    font-weight: 500;
}



.stats-bar {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.stats-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    text-align: center;
}

.stat-box {
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-text {
    font-size: 13px;
    color: #666;
}

.ancestor-section {
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
}

.view-all-btn {
    padding: 10px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.ancestor-row-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.95);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s;
}

.scroll-btn:hover {
    background: #667eea;
    color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.scroll-btn-left { left: -20px; }
.scroll-btn-right { right: -20px; }

.ancestor-row {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
}

.ancestor-row::-webkit-scrollbar {
    display: none;
}

.ancestor-card {
    flex: 0 0 280px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}

.ancestor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(102,126,234,0.2);
}

.ancestor-card.search-match {
    box-shadow: 0 0 0 3px rgba(59,130,246,0.35), 0 8px 24px rgba(59,130,246,0.25);
    transform: translateY(-5px);
}

.ancestor-card.search-hidden {
    display: none !important;
}

.ancestor-photo {
    width: 100%;
    height: 280px;
    object-fit: cover;
    position: relative;
}

.verified-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #28a745;
    color: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.ancestor-info {
    padding: 20px;
}

.ancestor-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.ancestor-dates {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
    margin-bottom: 8px;
}

.ancestor-generation {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
}

.ancestor-details {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.ancestor-details div {
    margin-bottom: 6px;
}

.ancestor-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    margin-top: 15px;
}

.ancestor-stat {
    text-align: center;
}

.ancestor-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.ancestor-stat-label {
    font-size: 11px;
    color: #999;
}

.muslimancestry-compact-sections {
    max-width: 1200px;
    margin: 20px auto 40px;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.compact-section {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.12);
    padding: 24px 26px;
}

.compact-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.compact-section-header h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #334155;
    margin: 0;
}

.compact-section-header h3 i {
    color: #667eea;
    margin-right: 8px;
    font-size: 1.1rem;
}

.compact-section-header p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

.compact-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.compact-card {
    background: #f8f9ff;
    border: 1px solid rgba(102, 126, 234, 0.18);
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(102, 126, 234, 0.16);
}

.compact-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

.compact-icon i {
    font-size: 1.05rem;
}

.compact-card h4 {
    margin: 0;
    font-size: 1rem;
    color: #1f2937;
}

.compact-card p {
    margin: 0;
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.5;
}

.comparison-toggle {
    max-width: 1180px;
    margin: 10px auto 0;
    padding: 0 20px;
    display: flex;
    justify-content: flex-end;
}

.comparison-trigger {
    border: 1px solid rgba(102,126,234,0.4);
    background: linear-gradient(135deg, rgba(102,126,234,0.12), rgba(118,75,162,0.12));
    color: #4c51bf;
    font-weight: 600;
    border-radius: 999px;
    padding: 8px 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.comparison-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(102,126,234,0.18);
}

.comparison-trigger .toggle-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.comparison-trigger .toggle-indicator i {
    transition: transform 0.2s ease;
}

.comparison-trigger.open .toggle-indicator i {
    transform: rotate(180deg);
}

.comparison-panel {
    max-width: 1180px;
    margin: 12px auto 28px;
    padding: 0 20px;
    display: none;
}

.comparison-panel.open {
    display: block;
}

.comparison-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.18);
    overflow: hidden;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.comparison-table th,
.comparison-table td {
    padding: 16px 18px;
    text-align: left;
    border-bottom: 1px solid rgba(102,126,234,0.12);
    font-size: 0.92rem;
}

.comparison-table tbody tr:nth-child(even) {
    background: rgba(102,126,234,0.05);
}

.comparison-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.comparison-pill.badge-primary {
    background: rgba(59,130,246,0.12);
    color: #2563eb;
}

.comparison-pill.badge-success {
    background: rgba(16,185,129,0.12);
    color: #059669;
}

.comparison-pill.badge-warning {
    background: rgba(245,158,11,0.15);
    color: #b45309;
}

.comparison-pill.badge-danger {
    background: rgba(239,68,68,0.12);
    color: #dc2626;
}

.muslimancestry-cta {
    max-width: 1180px;
    margin: 18px auto 32px;
    padding: 20px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.25);
}

.muslimancestry-cta h3 {
    font-size: 1.55rem;
    margin-bottom: 4px;
    font-weight: 700;
}

.muslimancestry-cta p {
    font-size: 0.95rem;
    margin-bottom: 12px;
    opacity: 0.92;
}

.muslimancestry-cta .cta-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.muslimancestry-cta .cta-btn {
    background: #fff;
    color: #5b67d2;
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 600;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.muslimancestry-cta .cta-btn.secondary {
    background: rgba(255,255,255,0.18);
    color: #fff;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.35);
}

.muslimancestry-cta .cta-btn:hover {
    transform: translateY(-3px);
}

/* Detail Modal Styles */
.ancestor-detail-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.ancestor-detail-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ancestor-detail-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
}

.ancestor-detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 12px 24px;
    border-radius: 16px 16px 0 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ancestor-detail-header h2,
.ancestor-detail-header h3 {
    font-size: 1.4rem;
    margin: 0;
    line-height: 1.3;
}

.ancestor-detail-header p {
    font-size: 0.9rem;
    margin: 6px 0 0 0;
    opacity: 0.9;
}

.ancestor-detail-close {
    position: absolute;
    top: 12px;
    right: 18px;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.ancestor-detail-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.ancestor-detail-body {
    padding: 30px;
}

.ancestor-detail-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 25px;
    display: block;
    border: 5px solid #667eea;
    box-shadow: 0 5px 20px rgba(102,126,234,0.3);
}

.ancestor-detail-name {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.ancestor-detail-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.ancestor-detail-info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 15px;
}

.ancestor-detail-info-item i {
    color: #667eea;
    width: 20px;
    text-align: center;
}

.ancestor-detail-description {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    margin-top: 25px;
    line-height: 1.8;
    font-size: 15px;
    color: #555;
}

.ancestor-detail-description h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.ancestor-detail-description p {
    margin-bottom: 15px;
}

.ancestor-detail-family {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #e0e0e0;
}

.ancestor-detail-family h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.ancestor-detail-family-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.ancestor-detail-family-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.ancestor-detail-family-item strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
}

.ancestor-detail-family-item span {
    color: #666;
    font-size: 13px;
}

@media (max-width: 768px) {
    .muslimancestry-hero {
        padding: 34px 16px 38px;
    }

    .muslimancestry-hero h1 {
        font-size: 1.9rem;
    }

    .muslimancestry-hero p {
        font-size: 0.95rem;
    }

    .hero-meta {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
    }

    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 12px;
    }

    .muslimancestry-compact-sections {
        padding: 0 16px;
        gap: 18px;
    }

    .compact-section {
        padding: 20px;
    }

    .compact-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .compact-card-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .muslimancestry-cta {
        margin: 16px 16px 32px;
        padding: 20px;
    }

    .muslimancestry-cta h3 {
        font-size: 1.4rem;
    }

    .muslimancestry-cta .cta-actions {
        gap: 10px;
    }

    .ancestor-detail-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .ancestor-detail-name {
        font-size: 1.5rem;
    }
    
    .ancestor-detail-photo {
        width: 150px;
        height: 150px;
    }
}
