/* =============================================
   Search Page — Public Family Tree Search
   RTL / Arabic — Premium Glass-morphism UX
   ============================================= */

/* ── Base ── */
.hidden { display: none !important; }

@keyframes highlightPulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50%  { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.highlight-pulse {
    animation: highlightPulse 0.8s ease-in-out 2;
    border-radius: 12px;
}

/* ── In-modal identity widget ── */
#modal-identity-widget {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border: 2px solid #f0c040;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}
.modal-identity-message {
    font-size: 0.95rem;
    font-weight: 600;
    color: #7c5700;
    margin-bottom: 10px;
    text-align: center;
}
.modal-identity-message i {
    color: #f0a000;
    margin-left: 6px;
}
.modal-identity-input {
    direction: rtl;
    text-align: right;
    border-radius: 8px;
}
.modal-identity-results {
    display: none;
    position: absolute;
    right: 0; left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1060;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.modal-identity-results .identity-result-item {
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    direction: rtl;
    text-align: right;
}
.modal-identity-results .identity-result-item:hover {
    background: #f5f5f5;
}
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(160deg, #eef2ff 0%, #e8eef9 40%, #f3eeff 100%);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    color: #1f2937;
    min-height: 100vh;
    font-family: 'Cairo', sans-serif;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Full-page search app */
.search-app {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100dvh;
    width: 100%;
    padding: 0 1rem 84px;
    box-sizing: border-box;
    position: relative;
}

/* ── Particle Network Background ── */
.search-app > *:not(#particleCanvas) {
    position: relative;
}

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.5s ease-out;
}

/* Hide particles when results show */
.search-app.has-results #particleCanvas {
    opacity: 0;
}

/* ── Header ── */
.search-header {
    text-align: center;
    padding: 2rem 1rem 0.4rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInDown 0.6s ease-out both;
}

.search-logo {
    font-size: 2.8rem;
    margin-bottom: 0.4rem;
    filter: drop-shadow(0 2px 8px rgba(37, 99, 235, 0.2));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

.search-logo i {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.search-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: transparent;
    background: linear-gradient(90deg, #1e3a5f, #2563eb, #7c3aed, #2563eb, #1e3a5f);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: textShine 6s ease-in-out infinite;
    margin-bottom: 0.15rem;
}

@keyframes textShine {
    0%   { background-position: 100% 50%; }
    50%  { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

.search-subtitle {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

/* Visitor counter */
.visit-counter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(37, 99, 235, 0.1);
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
    font-family: 'Cairo', sans-serif;
    animation: fadeInUp 0.5s ease-out 0.5s both;
}

.visit-counter i {
    color: #2563eb;
    font-size: 1.05rem;
}

.visit-counter #visitCount {
    color: #2563eb;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Suggest / Add person button */
.home-suggest-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    padding: 0.45rem 1.1rem;
    border-radius: 22px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    text-decoration: none;
    border: none;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    transition: all 0.2s ease;
    animation: fadeInUp 0.5s ease-out 0.6s both;
}

.home-suggest-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.home-suggest-btn i {
    font-size: 0.9rem;
}

/* Notice message */
.search-notice {
    margin-top: 0.6rem;
    font-size: 0.78rem;
    color: #6b7280;
    max-width: 420px;
    line-height: 1.7;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.5s ease-out 0.7s both;
}

/* ── Tabs ── */
/* (tabs hint removed — replaced by segmented control) */

.search-tabs-wrap {
    display: block;
    text-align: center;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding: 0 1rem;
    margin-top: 1.2rem;
    margin-bottom: 1rem;
    box-sizing: border-box;
    animation: fadeInDown 0.6s ease-out 0.15s both;
}

.search-tabs-hint {
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 500;
    margin: 0.6rem auto 0;
    max-width: 600px;
}

.search-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    position: relative;
    background: #1e3a5f;
    border-radius: 14px;
    padding: 4px;
    gap: 2px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 4px 16px rgba(30, 58, 95, 0.3);
}

/* Vertical divider between tabs */
.search-tabs::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1;
    transition: opacity 0.25s;
    pointer-events: none;
}

.search-tab-slider {
    position: absolute;
    top: 4px;
    right: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    border-radius: 11px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 0;
}

.search-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border: none;
    border-radius: 11px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: color 0.25s, background 0.25s;
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

.search-tab:not(.active):hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.1);
}

.search-tab.active {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.search-tab i { font-size: 1rem; }

/* ── Tab hint: pulsing arrow + tooltip on person-search tab ── */
.search-tab.tab-hint {
    animation: tabHintGlow 2s ease-in-out infinite;
}

.search-tab.tab-hint::before {
    content: 'اضغط هنا للبحث عن شخص ☝️';
    position: absolute;
    top: -36px;
    right: 50%;
    transform: translateX(50%);
    background: #f59e0b;
    color: #1a1a1a;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    animation: tabHintText 2s ease-in-out infinite;
    pointer-events: none;
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
    z-index: 10;
}

.search-tab.tab-hint::after {
    content: '';
    position: absolute;
    top: -6px;
    right: 50%;
    transform: translateX(50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #f59e0b;
    opacity: 0;
    animation: tabHintText 2s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes tabHintGlow {
    0%   { color: rgba(255, 255, 255, 0.55); }
    50%  { color: #fff; background: rgba(255, 255, 255, 0.15); }
    100% { color: rgba(255, 255, 255, 0.55); }
}

@keyframes tabHintText {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Glass Card Container ── */
.search-mode {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    z-index: 10;
}

.search-mode.hidden { display: none; }

.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.055),
        0 1px 3px rgba(0, 0, 0, 0.03);
    animation: fadeInUp 0.5s ease-out 0.3s both;
    position: relative;
    overflow: visible;
}

.search-form::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        100deg,
        rgba(255, 255, 255, 0) 35%,
        rgba(255, 255, 255, 0.42) 50%,
        rgba(255, 255, 255, 0) 65%
    );
    background-size: 220% 100%;
    background-position: 120% 0;
    opacity: 0;
    pointer-events: none;
}

.search-app.is-searching .search-form::after {
    opacity: 1;
    animation: cardSweep 1.4s linear infinite;
}

/* ── Input Group ── */
.search-input-group {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.search-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.search-field.wide { width: 100%; }

.search-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    padding-right: 0.2rem;
}

.search-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.72rem 1rem 0.72rem 2.2rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.2s ease;
    outline: none;
}

.search-field input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1),
                0 2px 8px rgba(37, 99, 235, 0.08);
}

.search-field input::placeholder {
    color: #9ca3af;
    font-size: 0.88rem;
}

/* Invalid input highlight (not selected from dropdown) */
.search-field input.is-invalid {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
    animation: inputShake 0.4s ease;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(2px); }
}

/* Search input wrapper */
.autocomplete-wrap {
    position: relative;
    width: 100%;
}

/* ── Input Clear Button ── */
.input-clear {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(156, 163, 175, 0.18);
    color: #6b7280;
    font-size: 0.65rem;
    cursor: pointer;
    z-index: 3;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.input-clear:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.autocomplete-wrap input:not(:placeholder-shown) ~ .input-clear {
    display: flex;
}

/* ── Connector ── */
.search-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #eff6ff, #e0e7ff);
    color: #2563eb;
    font-size: 0.95rem;
    flex-shrink: 0;
    border: 1px solid rgba(37, 99, 235, 0.12);
    transition: transform 0.4s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.search-connector:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.2);
}

/* ── Single field (person tab) ── */
.search-input-single { display: flex; }

/* ── Search Button ── */
.search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 2rem;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: center;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.search-btn:active { transform: translateY(0); }

.search-btn:not(:disabled) {
    animation: pulseGlow 2.5s ease-in-out infinite;
}

.search-btn:hover {
    animation: none;
}

.search-btn:disabled {
    background: #93c5fd;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.search-app.is-searching .search-btn:not(:disabled) {
    animation: searchingPulse 1.15s ease-in-out infinite;
    box-shadow: 0 5px 18px rgba(37, 99, 235, 0.45), 0 0 26px rgba(37, 99, 235, 0.2);
}

/* ── Quick chips (recent / popular) ── */
.quick-chips-section {
    max-width: 800px;
    margin: 0.6rem auto 0;
    width: 100%;
}

.quick-chips-label {
    font-size: 0.72rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 0.35rem;
    font-weight: 500;
    display: block;
}

.quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.28rem 0.7rem;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.7);
    font-size: 0.76rem;
    font-family: 'Cairo', sans-serif;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.quick-chip i {
    font-size: 0.68rem;
}

.quick-chip.recent i { color: #f59e0b; }

.quick-chips-section.hidden { display: none; }

/* ── Autocomplete Dropdown ── */
.autocomplete-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12),
                0 4px 12px rgba(0, 0, 0, 0.05);
    max-height: 280px;
    overflow-y: auto;
    margin-top: 6px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.autocomplete-list.show { display: block; }

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background 0.12s ease;
    border-bottom: 1px solid #f3f4f6;
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: linear-gradient(135deg, #eff6ff, #f0f0ff);
}

.autocomplete-item .ac-gender {
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f3f4f6;
    flex-shrink: 0;
}

.autocomplete-item .ac-info {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    flex: 1;
    min-width: 0;
}

.autocomplete-item .ac-name {
    font-weight: 600;
    color: #1f2937;
}

.autocomplete-item .ac-name .ac-match {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    border-radius: 3px;
    padding: 0 1px;
}

.autocomplete-item .ac-father {
    font-size: 0.73rem;
    color: #9ca3af;
}

/* ── Results Area ── */
.search-results {
    width: 100%;
    max-width: 900px;
    margin: 0.75rem auto 0;
    padding: 0;
    overflow-x: auto;
    position: relative;
    z-index: 1;
}

/* Override chat-page breakout hack */
.search-results .kt-tree,
.search-results .kinship-chain {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
}

.search-results .kinship-result {
    margin-bottom: 1.5rem;
}

.search-results .kinship-label {
    word-wrap: break-word;
    white-space: normal;
}

.search-results .kt-tree-inner {
    min-width: auto;
    width: 100%;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading (skeleton) ── */
.search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 3rem;
    color: #6b7280;
    font-size: 0.88rem;
}

.search-loading.hidden { display: none; }

.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: 340px;
}

.skeleton-line {
    height: 13px;
    border-radius: 7px;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-line:nth-child(1) { width: 65%; }
.skeleton-line:nth-child(2) { width: 85%; }
.skeleton-line:nth-child(3) { width: 50%; }

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Entrance Animations ── */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3); }
    50%      { box-shadow: 0 4px 24px rgba(37, 99, 235, 0.55), 0 0 40px rgba(37, 99, 235, 0.15); }
}

@keyframes cardSweep {
    0%   { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

@keyframes searchingPulse {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-1px); }
}

/* ── Result count badge ── */
.result-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0.8rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #eff6ff, #e0e7ff);
    color: #2563eb;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(37, 99, 235, 0.12);
    animation: slideUp 0.3s ease-out;
}
.result-count span { display: flex; align-items: center; gap: 0.35rem; }
.result-count i { font-size: 0.82rem; }

/* ── Share Button ── */
/* ── Share: full-width block button (below person card) ── */
.share-block-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.65rem 1rem;
    margin-top: 0.75rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.share-block-btn:hover {
    background: linear-gradient(135deg, #0f766e, #0d9488);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.3);
}
.share-block-btn i { font-size: 1.1rem; }

/* ── Invite a Relative button ── */
.invite-relative-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 1rem;
    margin-top: 0.5rem;
    border: 2px dashed #6366f1;
    border-radius: 12px;
    background: #eef2ff;
    color: #4338ca;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s;
}
.invite-relative-btn:hover {
    background: #e0e7ff;
    border-color: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.invite-relative-btn i { font-size: 1.05rem; }

/* ── Incomplete profile banner ── */
.incomplete-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1.5px solid #f59e0b;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #92400e;
    font-family: 'Cairo', sans-serif;
    animation: slideUp 0.3s ease-out;
}
.incomplete-banner i {
    font-size: 1.1rem;
    color: #d97706;
    flex-shrink: 0;
}

/* ── Share: WhatsApp button ── */
.share-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 1rem;
    margin-top: 0.6rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(37, 211, 102, 0.3);
}
.share-whatsapp-btn i {
    font-size: 1.2rem;
}
.share-whatsapp-btn:hover {
    background: linear-gradient(135deg, #20bd5a, #0e7a6b);
    transform: scale(1.03);
    box-shadow: 0 5px 18px rgba(37, 211, 102, 0.4);
}

/* ── Relationship results ── */
.result-relationship.hidden { display: none; }

.result-relationship {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUp 0.35s ease-out;
}

.result-relationship .kt-person,
.result-relationship .kc-node,
.result-relationship [data-person-id] {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ── Tree node tap hint ── */
.tree-tap-hint {
    animation: treeTapHint 2.5s ease-in-out 0.5s 2;
    position: relative;
    z-index: 2;
}

.tree-tap-hint::after {
    content: '\f289';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: -12px;
    left: -4px;
    font-size: 1.2rem;
    color: #2563eb;
    opacity: 0;
    animation: tapFingerBounce 2.5s ease-in-out 0.5s 2;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.4));
}

.tree-tap-hint::before {
    content: 'اضغط على الاسم لعرض التفاصيل';
    position: absolute;
    top: -30px;
    right: 50%;
    transform: translateX(50%);
    background: #1e3a5f;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    animation: hintTextPulse 2.5s ease-in-out 0.5s 2;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
    z-index: 10;
}

@keyframes treeTapHint {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
    12%  { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.35); transform: scale(1.04); }
    24%  { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); transform: scale(1); }
    40%  { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.3); transform: scale(1.04); }
    55%  { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); transform: scale(1); }
    72%  { box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.25); transform: scale(1.04); }
    85%  { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); transform: scale(1); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ── Accordion for multiple kinship paths ── */
.kinship-accordion-item {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s;
}

.kinship-accordion-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
}

.kinship-accordion-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.88rem;
    color: #1f2937;
    transition: background 0.15s;
    user-select: none;
}

.kinship-accordion-header:hover {
    background: rgba(37, 99, 235, 0.04);
}

.kinship-accordion-header .acc-icon {
    transition: transform 0.25s ease;
    color: #6b7280;
    font-size: 0.8rem;
}

.kinship-accordion-item.open .acc-icon {
    transform: rotate(180deg);
}

.kinship-accordion-header .acc-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    flex-shrink: 0;
}

.kinship-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 1rem;
}

.kinship-accordion-item.open .kinship-accordion-body {
    max-height: 2000px;
    padding: 0 1rem 1rem;
}

/* single path — no accordion, just show directly */
.kinship-single .kinship-result {
    animation: slideUp 0.35s ease-out;
}

/* ── Person result card ── */
.result-person {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    animation: slideUp 0.35s ease-out;
}

.result-person.hidden { display: none; }

.person-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.person-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.person-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.person-avatar.male {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.person-avatar.female {
    background: linear-gradient(135deg, #db2777, #ec4899);
}

.person-card-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.person-card-gender {
    font-size: 0.82rem;
    color: #6b7280;
}

.person-death-badge {
    display: inline-block;
    font-size: 1rem;
    font-weight: 600;
    color: #991b1b;
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    margin-top: 0.25rem;
}
.person-death-badge i { margin-left: 0.3rem; }

.person-relations {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.relation-group h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #374151;
    margin: 0 0 0.45rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.relation-group h4 i { color: #6b7280; font-size: 0.88rem; }

.relation-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.relation-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.88rem;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.relation-chip:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

.relation-chip .chip-gender {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* Deceased chip styling */
.relation-chip.chip-deceased {
    background: #e5e7eb;
    border-color: #d1d5db;
    color: #6b7280;
}

.relation-chip.chip-pending {
    background: #fff7ed;
    border-color: #f97316;
    color: #c2410c;
    border-style: dashed;
}

.person-card-notes {
    font-size: 0.95rem !important;
    color: #4b5563 !important;
    background: #f8f9fa;
    border-right: 3px solid #8b5cf6;
    padding: 0.35rem 0.6rem;
    border-radius: 0.3rem;
    margin-top: 0.25rem;
}

/* ── Family detail CTA button ── */
.detail-family-btn {
    background: linear-gradient(135deg, #0ea5e9, #6366f1) !important;
    color: #fff !important;
    border: none !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    padding: 0.75rem 1.5rem !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: pulseGlow 2.5s ease-in-out infinite;
}
.detail-family-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
    color: #fff !important;
}
.detail-family-btn:active {
    transform: translateY(0);
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35); }
    50%      { box-shadow: 0 4px 24px rgba(99, 102, 241, 0.55); }
}

/* ── Children grouped ── */
.children-grouped {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.child-group {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
}

.child-group-header {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.child-group-label {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
}

.child-group-header .parent-chip {
    background: #fef3c7;
    border-color: #f59e0b;
    font-weight: 600;
    font-size: 0.8rem;
}

.child-group-header .parent-chip:hover {
    background: #fde68a;
    border-color: #d97706;
    color: #92400e;
}

/* ── Tap hint animation on first chip ── */
.chip-tap-hint {
    animation: chipTapHint 2.5s ease-in-out 0.5s 2;
    position: relative;
    z-index: 2;
}

.chip-tap-hint::after {
    content: '\f289';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: -14px;
    left: -6px;
    font-size: 1.35rem;
    color: #2563eb;
    opacity: 0;
    animation: tapFingerBounce 2.5s ease-in-out 0.5s 2;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.4));
}

.chip-tap-hint::before {
    content: 'اضغط هنا للتنقل';
    position: absolute;
    top: -32px;
    right: 50%;
    transform: translateX(50%);
    background: #1e3a5f;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    animation: hintTextPulse 2.5s ease-in-out 0.5s 2;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.3);
}

@keyframes hintTextPulse {
    0%   { opacity: 0; transform: translateX(50%) translateY(4px); }
    10%  { opacity: 1; transform: translateX(50%) translateY(0); }
    65%  { opacity: 1; transform: translateX(50%) translateY(0); }
    80%  { opacity: 0; transform: translateX(50%) translateY(-2px); }
    100% { opacity: 0; transform: translateX(50%) translateY(4px); }
}

@keyframes chipTapHint {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); background: rgba(255,255,255,0.85); }
    12%  { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.35); transform: scale(1.06); background: #dbeafe; }
    24%  { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); transform: scale(1); background: rgba(255,255,255,0.85); }
    40%  { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.3); transform: scale(1.06); background: #dbeafe; }
    55%  { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); transform: scale(1); background: rgba(255,255,255,0.85); }
    72%  { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.25); transform: scale(1.06); background: #dbeafe; }
    85%  { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); transform: scale(1); background: rgba(255,255,255,0.85); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); background: rgba(255,255,255,0.85); }
}

@keyframes tapFingerBounce {
    0%   { opacity: 0; transform: translate(0, -8px) scale(0.7); }
    8%   { opacity: 1; transform: translate(0, 0) scale(1.1); }
    16%  { opacity: 1; transform: translate(0, 4px) scale(0.9); }
    24%  { opacity: 1; transform: translate(0, 0) scale(1); }
    36%  { opacity: 1; transform: translate(0, 4px) scale(0.9); }
    48%  { opacity: 1; transform: translate(0, 0) scale(1); }
    64%  { opacity: 1; transform: translate(0, 4px) scale(0.9); }
    76%  { opacity: 0.6; transform: translate(0, 0) scale(1); }
    90%  { opacity: 0; transform: translate(0, -6px) scale(0.8); }
    100% { opacity: 0; transform: translate(0, -8px) scale(0.7); }
}

/* Phase 2: return hint — same animations, different text + green color */
.chip-tap-hint-return {
    animation: chipTapHintReturn 2.5s ease-in-out 0.5s 2;
    position: relative;
    z-index: 2;
}

.chip-tap-hint-return::after {
    content: '\f289';
    font-family: 'bootstrap-icons';
    position: absolute;
    top: -14px;
    left: -6px;
    font-size: 1.35rem;
    color: #059669;
    opacity: 0;
    animation: tapFingerBounceReturn 2.5s ease-in-out 0.5s 2;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(5, 150, 105, 0.4));
}

.chip-tap-hint-return::before {
    content: 'اضغط للعودة ↩';
    position: absolute;
    top: -32px;
    right: 50%;
    transform: translateX(50%);
    background: #065f46;
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    animation: hintTextPulse 2.5s ease-in-out 0.5s 2;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(6, 95, 70, 0.3);
}

@keyframes chipTapHintReturn {
    0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); background: rgba(255,255,255,0.85); }
    12%  { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.35); transform: scale(1.06); background: #d1fae5; }
    24%  { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); transform: scale(1); background: rgba(255,255,255,0.85); }
    40%  { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.3); transform: scale(1.06); background: #d1fae5; }
    55%  { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); transform: scale(1); background: rgba(255,255,255,0.85); }
    72%  { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0.25); transform: scale(1.06); background: #d1fae5; }
    85%  { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); transform: scale(1); background: rgba(255,255,255,0.85); }
    100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); background: rgba(255,255,255,0.85); }
}

@keyframes tapFingerBounceReturn {
    0%   { opacity: 0; transform: translate(0, -8px) scale(0.7); }
    8%   { opacity: 1; transform: translate(0, 0) scale(1.1); }
    16%  { opacity: 1; transform: translate(0, 4px) scale(0.9); }
    24%  { opacity: 1; transform: translate(0, 0) scale(1); }
    36%  { opacity: 1; transform: translate(0, 4px) scale(0.9); }
    48%  { opacity: 1; transform: translate(0, 0) scale(1); }
    64%  { opacity: 1; transform: translate(0, 4px) scale(0.9); }
    76%  { opacity: 0.6; transform: translate(0, 0) scale(1); }
    90%  { opacity: 0; transform: translate(0, -6px) scale(0.8); }
    100% { opacity: 0; transform: translate(0, -8px) scale(0.7); }
}

/* ── Empty state ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 3rem 1rem;
    color: #b0b8c4;
    text-align: center;
    animation: slideUp 0.4s ease-out;
}

.empty-state i {
    font-size: 2.8rem;
    opacity: 0.35;
}

.empty-state p {
    font-size: 0.85rem;
    margin: 0;
    max-width: 250px;
    line-height: 1.6;
}

/* ── Featured Persons ── */
.featured-persons-section {
    padding: 1rem 1rem 0.25rem;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
    animation: slideUp 0.4s ease-out;
}

.featured-persons-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.65rem 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.featured-persons-label i {
    color: #f0a500;
    font-size: 0.72rem;
}

.featured-persons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem 0.75rem;
}

.featured-person-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.4rem 1rem 1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.18s, box-shadow 0.2s;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.featured-person-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4a90d9, #6ec0ff);
    border-radius: 20px 20px 0 0;
}

.featured-person-card:hover {
    background: #f8faff;
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
}

.featured-person-card:active {
    transform: translateY(-1px);
}

.featured-person-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.featured-person-avatar.male   { background: linear-gradient(135deg, #4a90d9, #2c6fad); }
.featured-person-avatar.female { background: linear-gradient(135deg, #e07b8a, #b5495a); }

.featured-person-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.3;
}

.featured-person-desc {
    font-size: 0.75rem;
    color: #6b7280;
}

.featured-person-btn {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.featured-person-btn i {
    font-size: 1rem;
}

@media (max-width: 480px) {
    .featured-person-card {
        padding: 1rem 0.6rem 0.8rem;
    }
    .featured-person-name {
        font-size: 0.82rem;
    }
    .featured-person-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
}

/* ── Modal ── */
#personModal .modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
}

#personModal .modal-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 1rem 1.25rem;
}

/* Back / Close navigation buttons */
.btn-back-nav {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #e8f4fd;
    color: #0d6efd;
    border: 1.5px solid #0d6efd;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 14px;
    transition: all 0.2s;
}
.btn-back-nav:hover {
    background: #0d6efd;
    color: #fff;
}
.btn-back-nav i {
    font-size: 0.9rem;
}
.btn-close-nav {
    background: #fde8e8;
    color: #dc3545;
    border: 1.5px solid #dc3545;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.btn-close-nav:hover {
    background: #dc3545;
    color: #fff;
}

/* Page-level back button (non-modal) */
.page-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f4fd;
    color: #0d6efd;
    border: 1.5px solid #0d6efd;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.page-back-btn:hover {
    background: #0d6efd;
    color: #fff;
}

/* Family detail content */
.family-detail-content {
    max-height: 70vh;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    direction: rtl;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #333;
}
.family-detail-content b {
    color: #0d6efd;
    font-weight: 700;
    font-size: 0.95rem;
}
.family-detail-content .fd-section {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border-right: 4px solid #0d6efd;
    background: #f8f9fa;
}
.family-detail-content .fd-section b:first-child {
    display: block;
    margin-bottom: 4px;
}
/* Person */
.fd-section.fd-person { border-right-color: #0d6efd; background: #e8f0fe; }
.fd-section.fd-person b { color: #0d6efd; }
/* Mother */
.fd-section.fd-mother { border-right-color: #d63384; background: #fce4f0; }
.fd-section.fd-mother b { color: #d63384; }
/* Grandmother paternal */
.fd-section.fd-grandma-p { border-right-color: #6f42c1; background: #f0e6ff; }
.fd-section.fd-grandma-p b { color: #6f42c1; }
/* Grandmother maternal */
.fd-section.fd-grandma-m { border-right-color: #8b5cf6; background: #f3edff; }
.fd-section.fd-grandma-m b { color: #8b5cf6; }
/* Brothers */
.fd-section.fd-brothers { border-right-color: #198754; background: #e6f4ed; }
.fd-section.fd-brothers b { color: #198754; }
/* Sisters */
.fd-section.fd-sisters { border-right-color: #0d9488; background: #e6f7f5; }
.fd-section.fd-sisters b { color: #0d9488; }
/* Maternal uncles */
.fd-section.fd-m-uncles { border-right-color: #e67e22; background: #fef3e6; }
.fd-section.fd-m-uncles b { color: #e67e22; }
/* Maternal aunts */
.fd-section.fd-m-aunts { border-right-color: #d4a017; background: #fef9e6; }
.fd-section.fd-m-aunts b { color: #d4a017; }
/* Paternal uncles */
.fd-section.fd-p-uncles { border-right-color: #3949ab; background: #e8eaf6; }
.fd-section.fd-p-uncles b { color: #3949ab; }
/* Paternal aunts */
.fd-section.fd-p-aunts { border-right-color: #0891b2; background: #e6f6fa; }
.fd-section.fd-p-aunts b { color: #0891b2; }
/* Spouses */
.fd-section.fd-spouse { border-right-color: #dc3545; background: #fde8ea; }
.fd-section.fd-spouse b { color: #dc3545; }

#personModal .modal-title {
    font-weight: 700;
    font-size: 1rem;
}

#personModal .modal-body {
    padding: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
    body:not(.force-motion) {
        animation: none;
    }

    .search-app:not(.force-motion) #particleCanvas,
    .search-app:not(.force-motion) .search-form,
    .search-app:not(.force-motion) .search-form::after,
    .search-app:not(.force-motion) .search-btn:not(:disabled),
    .search-app:not(.force-motion) .search-logo,
    .search-app:not(.force-motion) .search-header,
    .search-app:not(.force-motion) .search-tabs {
        animation: none !important;
        transition: none !important;
    }

    .search-app:not(.force-motion) #particleCanvas {
        opacity: 0;
    }

    .search-app:not(.force-motion).is-searching .search-form::after {
        display: none;
    }
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .search-app {
        padding: 0 0.5rem 84px;
    }

    .search-header {
        padding: 1.2rem 0.25rem 0.35rem;
    }

    .search-header h1 { font-size: 1.15rem; }

    .search-logo { font-size: 2.1rem; }

    .search-form {
        padding: 1rem;
        border-radius: 16px;
    }

    .search-input-group {
        flex-direction: column;
    }

    .search-connector {
        width: 32px;
        height: 32px;
        align-self: center;
    }

    .search-tabs {
        max-width: 100%;
    }

    .search-mode { padding: 0; }

    .search-results { padding: 0.4rem 0; }

    .search-results .kinship-label {
        font-size: 0.88rem;
        padding: 0.5rem 0.7rem;
    }

    .result-person {
        padding: 1rem;
        border-radius: 16px;
    }

    .click-hint {
        font-size: 0.76rem;
        padding: 0.35rem 0.6rem;
    }

    .quick-chip { font-size: 0.7rem; padding: 0.22rem 0.55rem; }

    .kinship-accordion-header {
        font-size: 0.82rem;
        padding: 0.65rem 0.75rem;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .search-mode { max-width: 100%; }
}

/* ── Footer ── */
.search-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    margin-top: auto;
    font-size: 0.8rem;
    color: #4b5563;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

/* ── Inline Add Forms (inside relation groups) ── */
.add-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border: 1.5px dashed #a5b4fc;
    border-radius: 20px;
    background: #eef2ff;
    color: #4338ca;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.add-chip:hover {
    background: #e0e7ff;
    border-color: #818cf8;
    transform: scale(1.03);
}
.add-chip i { font-size: 0.85rem; }
.inline-add-form {
    display: none;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.5rem;
    padding: 0.5rem 0.6rem;
    border: 1.5px solid #c7d2fe;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
    animation: slideDown 0.2s ease-out;
    position: relative;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.inline-add-input {
    flex: 1;
    min-width: 100px;
    padding: 0.35rem 0.6rem;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    direction: rtl;
    background: #fff;
    transition: border-color 0.2s;
}
.inline-add-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}
.inline-add-select {
    padding: 0.35rem 0.45rem;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.82rem;
    direction: rtl;
    background: #fff;
    cursor: pointer;
}
.inline-add-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border: none;
    border-radius: 7px;
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.inline-add-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.2);
}
.inline-cancel-btn {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    padding: 0.35rem 0.5rem;
    min-width: unset;
}
.inline-cancel-btn:hover {
    background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* ── Pending List (below person card) ── */
.pending-my-list {
    margin-top: 0.75rem;
}
.pending-items-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.pending-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.65rem;
    margin-bottom: 0.35rem;
    border-radius: 8px;
    background: #fef9c3;
    border: 1px solid #fde68a;
    font-size: 0.82rem;
}
.pending-item-name {
    flex: 1;
    font-weight: 700;
    color: #92400e;
}
.pending-item-type {
    color: #78716c;
    font-weight: 600;
}
.pending-item-status {
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
}
.pending-status-pending {
    background: #fef3c7;
    color: #d97706;
}

/* ── Pending Toast ── */
.pending-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.88rem;
    z-index: 999999;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.pending-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.pending-toast-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.pending-toast-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.pending-toast-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* ── Identity Bar ── */
.identity-bar {
    margin: 0.5rem auto 0;
    max-width: 600px;
    padding: 0 1rem;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    position: relative;
    z-index: 2;
    width: 100%;
}
.identity-prompt {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 0.55rem 0.9rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.identity-prompt-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.identity-prompt > i {
    color: #6366f1;
    font-size: 1.15rem;
}
.identity-prompt-label {
    color: #6b7280;
    font-size: 0.78rem;
}
.identity-search-wrap {
    position: relative;
    width: 100%;
}
.identity-search-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    color: #1f2937;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    padding: 0.4rem 0.75rem;
    direction: rtl;
    transition: border-color 0.2s;
}
.identity-search-input:focus {
    border-color: #6366f1;
    background: #fff;
}
.identity-search-input::placeholder { color: #9ca3af; }
.identity-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    direction: rtl;
    padding: 0.3rem 0;
}
.identity-result-item {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.92rem;
    color: #1f2937;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
    line-height: 1.5;
}
.identity-result-item:last-child { border-bottom: none; }
.identity-result-item:hover { background: #eef2ff; }

/* Claimed state */
.identity-claimed {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    border-radius: 12px;
    padding: 0.4rem 0.75rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.identity-claimed > i {
    color: #059669;
    font-size: 1rem;
}
.identity-claimed #identityName {
    color: #065f46;
    font-size: 0.85rem;
    font-weight: 600;
    flex: 1;
}
.identity-action-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    font-family: 'Cairo', sans-serif;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.identity-action-btn:hover { background: #f3f4f6; }
.identity-change { padding: 0.2rem 0.4rem; color: #9ca3af; }
.identity-change:hover { color: #ef4444; }

/* ── Spouse Search Input Wrapper ── */
.spouse-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 100px;
}
.spouse-input-wrapper .inline-add-input {
    width: 100%;
}

/* ── Spouse Search Results ── */
.spouse-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 9999;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.spouse-result-item {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .9rem;
    border-bottom: 1px solid #f0f0f0;
}
.spouse-result-item:last-child { border-bottom: none; }
.spouse-result-item:hover { background: #f0f7ff; }

/* ── Announcements Pages ── */
.announcements-page {
    min-height: 100vh;
    padding: 1.5rem 1rem 5rem;
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    max-width: 700px;
    margin: 0 auto;
}

.announcements-header {
    text-align: center;
    padding: 1.5rem 0 1rem;
    color: #1e3a5f;
    position: relative;
}

.announcements-header i {
    font-size: 2.5rem;
    opacity: 0.8;
}

.announcements-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0.3rem 0 0;
}

/* Submit announcement button */
.ann-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #1e3a5f;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0.45rem 1.2rem;
    font-size: 0.9rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(30,58,95,0.25);
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}
.ann-submit-btn:hover {
    background: #2c5282;
    transform: scale(1.03);
}

/* Submit announcement modal search results */
.submit-ann-results {
    max-height: 180px;
    overflow-y: auto;
    border-radius: 8px;
    margin-top: 4px;
}
.submit-ann-result-item {
    padding: 0.5rem 0.7rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid #eee;
    transition: background 0.15s;
}
.submit-ann-result-item:hover {
    background: #e8f4fd;
}
.submit-ann-no-result {
    padding: 0.5rem;
    color: #999;
    font-size: 0.85rem;
    text-align: center;
}

/* ── Announcements Filters ── */
.ann-filters {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 0 auto 1rem;
    padding: 0.6rem 1rem;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.06);
    max-width: 500px;
}
.ann-filters:has(.ann-filter-row) {
    flex-direction: column;
}
.ann-filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
}
.ann-filter-row .ann-filter-search {
    flex: 1;
    max-width: none;
}
.ann-filter-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.ann-filter-group label {
    font-size: 0.78rem;
    color: #6b7280;
    white-space: nowrap;
    margin: 0;
}
.ann-filter-select {
    padding: 0.3rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    background: #fff;
    color: #374151;
    width: 80px;
    direction: rtl;
    transition: border-color 0.2s;
}
.ann-filter-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}
.ann-filter-search {
    position: relative;
    flex: 1;
    min-width: 150px;
    max-width: 220px;
}
.ann-filter-search i {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.8rem;
    pointer-events: none;
}
.ann-filter-input {
    width: 100%;
    padding: 0.3rem 0.5rem 0.3rem 2rem;
    padding-right: 1.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.8rem;
    background: #fff;
    color: #374151;
    direction: rtl;
    transition: border-color 0.2s;
}
.ann-filter-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.12);
}
.ann-filter-input::placeholder {
    color: #9ca3af;
}
.ann-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #6366f1;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.ann-filter-btn:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.announcements-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.announcement-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.announcement-card:hover {
    background: #f8faff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.announcement-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.announcement-icon.birth {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
}

.announcement-icon.death {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

.announcement-icon.event {
    background: linear-gradient(135deg, #f472b6, #e11d48);
    color: #fff;
}

.event-card {
    border: 1px solid #fce7f3;
    background: linear-gradient(135deg, #fff 60%, #fdf2f8);
}

.event-card:hover {
    background: linear-gradient(135deg, #fdf2f8 60%, #fce7f3);
}

.event-and {
    color: #e11d48;
    font-weight: 800;
    margin: 0 0.3rem;
    font-size: 1rem;
}

.announcement-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.announcement-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e3a5f;
}

.announcement-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.announcement-notes {
    font-size: 0.75rem;
    color: #9ca3af;
}

.announcement-arrow {
    color: #cbd5e1;
    font-size: 0.85rem;
}

/* Share button on announcement cards */
.ann-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #25d366;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}
.ann-share-btn:hover {
    background: #25d366;
    color: #fff;
    border-color: #25d366;
    transform: scale(1.1);
}

/* Death date badge — prominent at end of card */
.death-date-badge {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.announcements-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #9ca3af;
}

.announcements-empty i {
    font-size: 2.5rem;
    opacity: 0.5;
}

.announcements-empty p {
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
}

/* ── Push Notification Modal ── */
.push-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.6rem;
    color: #fbbf24;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
    animation: pushBellRing 1s ease-in-out 0.3s;
}

.push-modal-yes {
    background: linear-gradient(135deg, #1e3a5f, #2563eb);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1.5rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.push-modal-yes:hover {
    background: linear-gradient(135deg, #162d4a, #1d4ed8);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.push-modal-no {
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1.5rem;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.push-modal-no:hover {
    background: #e5e7eb;
    color: #374151;
}

@keyframes pushBellRing {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-14deg); }
    45% { transform: rotate(10deg); }
    60% { transform: rotate(-10deg); }
    75% { transform: rotate(4deg); }
    90% { transform: rotate(-2deg); }
}

/* ===== Data Completion Page ===== */
.complete-subtitle {
    text-align: center;
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0 0 1rem;
}

.complete-instructions {
    display: flex;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #1e40af;
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    text-align: right;
}

.complete-instructions > i {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.complete-ancestor-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.complete-ancestor-pill {
    padding: 0.45rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.complete-ancestor-pill:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.complete-ancestor-pill.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.complete-filter-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.complete-filter-select {
    padding: 0.5rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Cairo', sans-serif;
    text-align: center;
    outline: none;
    background: #fff;
    min-width: 220px;
    transition: border-color 0.2s;
}

.complete-filter-select:focus {
    border-color: #f59e0b;
}

.complete-cards {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.complete-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border-right: 4px solid #3b82f6;
}

.complete-card.female {
    border-right-color: #ec4899;
}

.complete-card:hover {
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.complete-check-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.complete-check {
    width: 18px;
    height: 18px;
    accent-color: #f59e0b;
    cursor: pointer;
}

.complete-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
    flex-shrink: 0;
}

.complete-card-name i {
    margin-left: 0.3rem;
}

.complete-card.male .complete-card-name i { color: #3b82f6; }
.complete-card.female .complete-card-name i { color: #ec4899; }

.complete-card-missing {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-right: auto;
}

.complete-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
}

.complete-loading {
    text-align: center;
    padding: 1rem;
    color: #6b7280;
    font-size: 0.95rem;
}

.complete-loading.hidden { display: none; }

.complete-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #065f46;
    font-size: 1rem;
}

.complete-empty.hidden { display: none; }

.complete-empty i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.complete-batch-bar {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    z-index: 99;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.25);
}

.complete-batch-bar.hidden { display: none; }

.btn-batch-confirm {
    background: #f59e0b;
    color: #1f2937;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-batch-confirm:hover {
    background: #d97706;
}

.btn-batch-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Contributors Page ===== */
.contributors-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-bottom: 5rem;
}

.contributor-card {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s;
}

.contributor-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.contributor-badge-img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.contributor-info {
    display: flex;
    flex-direction: column;
}

.contributor-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1f2937;
}

.contributor-rank-label {
    font-size: 0.82rem;
    color: #6b7280;
    font-weight: 500;
}

/* ===== Golden Contributor Card (with photo) ===== */
.contributor-card-golden {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem 1rem 1rem;
    background: linear-gradient(135deg, #fffbe6 0%, #fff7cc 40%, #fff3b0 100%);
    border: 2px solid #d4af37;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.25), 0 0 0 1px rgba(212, 175, 55, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.contributor-card-golden:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(212, 175, 55, 0.4), 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.contributor-golden-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at center, rgba(212, 175, 55, 0.08) 0%, transparent 70%);
    pointer-events: none;
    animation: goldenPulse 3s ease-in-out infinite;
}

@keyframes goldenPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.contributor-golden-photo-wrap {
    position: relative;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, #d4af37, #f5d060, #d4af37);
    box-shadow: 0 2px 12px rgba(212, 175, 55, 0.4);
    margin-bottom: 0.6rem;
    z-index: 1;
}

.contributor-golden-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
}

.contributor-golden-body {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1;
}

.contributor-golden-body .contributor-badge-img {
    width: 32px;
    height: 32px;
}

.contributor-golden-name {
    font-weight: 700;
    font-size: 1rem;
    color: #78590a;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.contributor-progress-wrap {
    width: 100%;
    padding: 0 0.5rem;
    margin-top: 0.4rem;
    z-index: 1;
}

.contributor-progress-text {
    font-size: 0.7rem;
    color: #555;
    text-align: center;
    margin-bottom: 3px;
    font-weight: 600;
    direction: rtl;
}

.contributor-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0,0,0,0.08);
    border-radius: 3px;
    overflow: hidden;
}

.contributor-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width 0.6s ease;
}

.contributor-card-golden .contributor-progress-text {
    color: #78590a;
}

.contributor-card-golden .contributor-progress-bar {
    background: rgba(120, 89, 10, 0.12);
}

.contributor-card-golden .contributor-progress-fill {
    background: linear-gradient(90deg, #d4af37, #f5d060);
}

.contributor-card-me {
    box-shadow: 0 0 0 2px #2563eb, 0 4px 12px rgba(37, 99, 235, 0.2);
}
