@import url('/assets/font/NotoKufiArabic/NotoKufiArabic.css');

/* --- المتغيرات الأساسية (نفس الألوان الأصلية) --- */
:root {
    --primary-color: #19b3be;
    --primary-hover: #21c8e5;
    --secondary-color: #1ee6db;
    --success-color: #24e86f;
    --warning-color: #ff7842;
    --error-color: #e54343;
    --bg-dark: #181a1b;
    --bg-darker: #141516;
    --bg-card: #151718;
    --bg-headers: #121415;
    --text-primary: #e3e3e3;
    --text-secondary: #d5d5d5;
    --text-accent: #21e3e5;
    --text-success: #a4ff93;
    --border-color: #232526;
    --border-focus: #303233;
    --shadow-primary: 0 4px 40px rgba(25, 179, 190, 0.18);
    --shadow-hover: 0 10px 40px rgba(25, 179, 190, 0.35);
    --shadow-card: 0 6px 32px rgba(25, 179, 190, 0.22);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 16px;
}

/* --- إعادة تعيين الأنماط الأساسية --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Kufi Arabic', sans-serif;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/*
     التحسين الإبداعي 1: خلفية أورورا المتحركة
    - تم إضافة خلفية متدرجة متحركة لإعطاء عمق وحيوية للصفحة.
*/
@keyframes aurora-bg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    background-color: var(--bg-darker);
    background-image: linear-gradient(135deg, var(--bg-dark) 0%, #1a1c1d 50%, var(--bg-darker) 100%);
    color: var(--text-primary);
    margin: 0;
    min-height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Noto Kufi Arabic', sans-serif;
    position: relative;
    overflow: hidden; /* لإخفاء أجزاء الخلفية الزائدة */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 10% 20%, rgba(25, 179, 190, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(30, 230, 219, 0.15) 0%, transparent 40%);
    animation: aurora-bg 20s ease-in-out infinite;
    z-index: -1;
    pointer-events: none;
}


h1, h2, h3, p, a {
    font-family: 'Noto Kufi Arabic', sans-serif;
}

h1 {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: 50px;
    font-size: clamp(2rem, 5vw, 2.8rem); /* خط مرن */
    color: var(--text-primary);
    text-shadow: 0 0 15px rgba(33, 200, 229, 0.3);
}

#editTime {
    padding: 100px 100px 0 0;
    color: #808080;
}

.containers {
    max-width: 1100px;
    margin: 0 auto;
    margin-top: 50px;
    padding: clamp(15px, 4vw, 20px); /* مساحة مرنة */
    animation: fadeIn 0.8s ease-out;
    background-color: transparent !important;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.top-bar {
    width: fit-content;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 0 auto 40px;
    align-items: center;
    padding: 0 8px;
    justify-content: center;
}

.top-bar button { box-sizing: border-box; }

.main-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(25, 179, 190, 0.3);
    letter-spacing: 1px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    will-change: transform, box-shadow;
}

.main-btn:not(.active) {
    background: rgba(35, 37, 38, 0.5);
    backdrop-filter: blur(5px);
    color: #c6e3e4;
    border: 1.5px solid var(--border-focus);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.main-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 35px rgba(25, 179, 190, 0.45);
}

.main-btn:active {
    transform: scale(0.97);
    transition: transform 0.1s;
}

.main-btn.active {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--secondary-color) 100%);
    box-shadow: 0 6px 25px rgba(25, 179, 190, 0.5);
}

.gear {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.2, 1);
}

.main-btn:hover .gear {
    transform: rotate(180deg);
}

/*
    التحسين الإبداعي 2: تأثير الزجاج المصنفر والحركة العائمة للبطاقة الرئيسية
*/
@keyframes subtle-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.genes-card {
    width: 40%;
    /* تأثير الزجاج */
    background: rgba(21, 23, 24, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    border-radius: var(--radius-md);
    border: 2px solid var(--primary-color);
    margin-bottom: 30px;
    box-shadow: var(--shadow-primary), 0 2px 10px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    animation: slideUp 0.6s ease-out 0.2s backwards, subtle-float 6s ease-in-out infinite;
    margin: auto;
    transition: var(--transition);
}

.genes-card:hover {
    box-shadow: var(--shadow-hover), 0 4px 20px rgba(0, 0, 0, 0.5);
    transform: scale(1.02);
}


@keyframes slideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.genes-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: glow 3s ease-in-out infinite alternate;
}

@keyframes glow {
    from { opacity: 0.6; filter: blur(2px); }
    to { opacity: 1; filter: blur(0px); }
}

.headers {
    border-bottom: 2px solid var(--bg-dark);
    color: var(--primary-color);
    padding: 18px 26px 16px 22px;
    font-weight: 700;
    letter-spacing: 2px;
    font-size: 1.2rem;
    background: linear-gradient(135deg, rgba(18, 20, 21, 0.7) 0%, rgba(15, 16, 17, 0.7) 100%);
    text-align: right;
    position: relative;
    overflow: hidden;
    text-shadow: 0 0 8px rgba(33, 200, 229, 0.5);
}

.headers::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.genes-area-block {
    display: flex;
    align-items: flex-start;
    padding: 30px 20px;
    flex-direction: row;
    gap: 20px;
}

.genes-inputarea {
    position: relative;
    width: 100%;
    min-width: 380px;
    max-width: 500px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.genes-preview-stack {
    position: absolute;
    top: 15px; right: 16px; left: 16px;
    height: calc(100% - 36px);
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
    direction: ltr;
}

.genes-row {
    display: flex;
    gap: 8px;
    position: absolute;
    right: 0;
    top: 0;
    height: 24px;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
    pointer-events: none;
}

.gene-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--bg-dark);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gene-icon:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.gene-G, .gene-Y, .gene-H {
    background: linear-gradient(135deg, var(--success-color) 0%, #1db757 100%);
    color: #0a1a0f; border-color: #18b660;
    box-shadow: 0 0 12px rgba(36, 232, 111, 0.4);
}

.gene-W {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e6632a 100%);
    color: #fff; border-color: #d54313;
    box-shadow: 0 0 12px rgba(255, 120, 66, 0.4);
}

.gene-X {
    background: linear-gradient(135deg, var(--error-color) 0%, #c73030 100%);
    color: #fff; border-color: #a31e1e;
    box-shadow: 0 0 12px rgba(229, 67, 67, 0.4);
}

.genes-textarea {
    background: linear-gradient(135deg, rgba(28, 31, 32, 0.8) 0%, rgba(24, 26, 27, 0.8) 100%);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 18px 16px;
    min-height: 160px;
    resize: vertical;
    outline: none;
    letter-spacing: 1.5px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5);
    direction: ltr;
    position: relative;
    z-index: 1;
    transition: var(--transition);
    line-height: 1.5;
    padding-left: 40px;
    overflow: hidden;
}

.genes-textarea:focus {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #1a1e21 0%, #1e2224 100%);
    box-shadow: 0 0 0 4px rgba(25, 179, 190, 0.2), inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.genes-textarea::placeholder {
    color: #888;
    opacity: 1;
}

.btn-calc {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    border: none;
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(25, 179, 190, 0.3);
    letter-spacing: 1px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    align-self: flex-start;
    will-change: transform, box-shadow;
}

.btn-calc:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 35px rgba(25, 179, 190, 0.45);
}

.btn-calc:active {
    transform: scale(0.98);
    transition: transform 0.1s;
}

.btn-calc::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 60%);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.5s ease;
}

.btn-calc:hover::before {
    transform: translate(-50%, -50%) scale(2);
}

.error-msg {
    color: var(--error-color);
    font-size: 1rem;
    min-height: 24px;
    font-weight: 500;
    padding-right: 4px;
    letter-spacing: 0.5px;
    text-align: right;
    animation: shake 0.5s ease-in-out;
    text-shadow: 0 0 8px rgba(229, 67, 67, 0.5);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.results-title {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: bold;
    margin: 20px 0 25px 0;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    text-align: right;
    position: relative;
    animation: slideRight 0.6s ease-out 0.4s backwards;
}

@keyframes slideRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.results-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    filter: blur(1px);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    direction: ltr;
    perspective: 1000px; /* لتفعيل التأثير ثلاثي الأبعاد */
}

/*
    التحسين الإبداعي 3: بطاقات نتائج زجاجية مع حركة تفاعلية ثلاثية الأبعاد
*/
.result-card {
    /* تأثير الزجاج */
    background: linear-gradient(135deg, rgba(21, 23, 24, 0.5) 0%, rgba(23, 26, 27, 0.6) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    padding: 25px 20px 20px;
    box-shadow: var(--shadow-card), 0 2px 14px rgba(0, 0, 0, 0.4);
    position: relative;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
    animation: cardSlide 0.6s ease-out backwards;
    will-change: transform, box-shadow;
}

@keyframes cardSlide {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }
.result-card:nth-child(6) { animation-delay: 0.6s; }


.result-card:hover, .result-card:focus-within {
    /* transform: translateY(-8px) rotateY(-5deg) rotateX(8deg) scale(1.05); */
    box-shadow: var(--shadow-hover), 0 8px 30px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(25, 179, 190, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.result-card:hover::before {
    opacity: 1;
}

.result-card .genes-row {
    position: static;
    justify-content: center;
    gap: 12px;
    margin: 15px 0 12px 0;
    font-size: 1.1rem;
    opacity: 1;
    pointer-events: none;
}

.result-card .genes-row .sur-label {
    position: absolute;
    left: 5px;
}

.result-card .gene-icon {
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    margin: 0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--bg-dark);
    letter-spacing: 2px;
}

.score-row {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    direction: rtl;
    color: #d4f9ff;
    font-weight: bold;
    letter-spacing: 1px;
}

.score-row .score {
    color: var(--text-success);
    font-weight: bold;
    margin: 0 8px;
    font-size: 1.2rem;
    text-shadow: 0 0 10px var(--success-color);
}

.center-sapling, .surrounding-saplings {
    margin: 8px 0 6px 0;
    position: relative;
}

.subtitle {
    color: var(--text-accent);
    font-size: 1.05rem;
    margin-bottom: 4px;
    letter-spacing: 1px;
    font-weight: 600;
    text-align: center;
}

.bad-result-msg {
    color: var(--error-color);
    font-size: 1.05rem;
    text-align: center;
    font-weight: bold;
    padding: 12px 4px 4px 4px;
    margin-top: 10px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.02); }
}

.card-tooltip {
    display: none;
    position: absolute;
    top: 15px;
    right: 110%;
    min-width: 150px;
    background: linear-gradient(135deg, #1e2527 0%, #242829 100%);
    color: #2fffd2;
    padding: 15px 20px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 6px 30px rgba(31, 210, 187, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 999;
    transition: var(--transition);
    opacity: 0;
    pointer-events: none;
    text-align: right;
    border: 1px solid rgba(31, 210, 187, 0.3);
}

.card-tooltip::before {
    content: '';
    position: absolute;
    top: 50%; left: -8px;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #1e2527;
}

.result-card.show-tooltip .card-tooltip {
    display: block;
    opacity: 1;
    pointer-events: all;
}

.line-numbers {
    position: absolute;
    top: 18px; left: 7px;
    width: 34px;
    height: calc(100% - 38px);
    font-size: .8rem;
    color: #a0c8c8;
    text-align: left;
    background: transparent;
    pointer-events: none;
    z-index: 12;
    padding-top: 2px;
    line-height: 2.063;
    font-weight: bold;
    user-select: none;
}

/*
    التحسين الإبداعي 4: تحسين التجاوب مع جميع الشاشات
    - تعديلات لجعل التأثيرات تعمل بسلاسة على الشاشات الأصغر.
*/
@media (max-width: 1000px) {
    .genes-card { width: 60%; animation: slideUp 0.6s ease-out 0.2s backwards; /* إيقاف الحركة العائمة على الشاشات المتوسطة */ }
}

@media (max-width: 768px) {
    .containers { padding: 15px; }
    .top-bar {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 12px;
        margin: 0 0 30px;
    }
    .top-bar button { width: 80%; max-width: 350px; }
    .main-btn { font-size: 1rem; padding: 10px 18px; min-width: 100px; }
    .genes-area-block { flex-direction: column; padding: 20px 15px; gap: 0; }
    .genes-inputarea { max-width: 100%; min-width: unset; }
    .genes-textarea { min-height: 140px; padding: 15px; padding-left: 40px; }
    .headers { padding: 15px 15px 12px; font-size: 1.1rem; }
    .results-title { font-size: 1.2rem; margin: 15px 0 20px 0; }
    .results-grid { grid-template-columns: 1fr; gap: 20px; perspective: none; /* إيقاف التأثير ثلاثي الأبعاد على الموبايل */ }
    .result-card:hover, .result-card:focus-within {
      transform: translateY(-6px) scale(1.03); /* حركة أبسط للموبايل */
    }
    .result-card { padding: 20px 15px; }
    .result-card .gene-icon { width: 32px; height: 32px; font-size: 1.1rem; }
    .card-tooltip {
        right: unset; left: 50%; top: unset; bottom: 110%;
        transform: translateX(-50%);
        min-width: 140px; padding: 12px 15px; font-size: 0.95rem;
    }
    .card-tooltip::before {
        top: unset; bottom: -8px; left: 50%;
        transform: translateX(-50%);
        border-top: 8px solid #1e2527;
        border-right: 8px solid transparent; border-left: 8px solid transparent; border-bottom: none;
    }
    .genes-card { width: 80%; }
    .scan-btn { display: none; }
}

@media (max-width: 480px) {
    .containers { padding: 10px; }
    .top-bar button { width: 100%; }
    .genes-card { width: 98%; margin-bottom: 20px; }
    .genes-area-block { padding: 15px 10px; }
    .genes-textarea { min-height: 120px;  }
    .btn-calc { width: 100%; padding: 12px 20px; }
    .results-grid { gap: 15px; }
    .result-card { padding: 18px 12px; }
}

.genes-textarea::-webkit-scrollbar { width: 8px; }
.genes-textarea::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
.genes-textarea::-webkit-scrollbar-thumb { background: var(--primary-color); border-radius: 4px; }
.genes-textarea::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); }

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition-duration: 0.01ms !important; }
    body::before { display: none; }
}

.scan-modal-backdrop {
    position: fixed;
    z-index: 99999;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(17, 27, 35, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-modal {
    /* تطبيق تأثير الزجاج على النافذة أيضاً */
    background: rgba(25, 29, 33, 0.8);
    border-radius: 16px;
    box-shadow: 0 6px 38px #000c;
    max-width: 460px;
    width: 98vw;
    padding: 0 0 15px 0;
    border: 2.5px solid var(--primary-color);
    direction: rtl;
    animation: popup 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popup {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.scan-modal-headers {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    border-bottom: 1.7px solid #151e23;
    padding: 22px 20px 10px 20px;
    letter-spacing: 1.3px;
    text-shadow: 0 0 8px rgba(25, 179, 190, 0.5);
}

.scan-modal-header { text-align: center; font-size: 1.5rem; padding: 20px 0; }
.scan-modal-body {
    font-size: 1.06rem;
    color: #ebf9fb;
    padding: 19px 23px 7px 19px;
}
.scan-modal-body ul { padding-right: 22px; margin: 0; }
.scan-modal-body li { margin-bottom: 11px; line-height: 1.7; }
.scan-modal-body code {
    background: #232b34;
    color: #6bfada;
    padding: 1px 7px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.99em;
    user-select: all !important;
}
.scan-modal-footer {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    align-items: center;
    padding: 11px 23px 5px 15px;
}
.btn-modal-close,
.btn-modal-scan {
    font-family: inherit;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    padding: 8px 22px;
    cursor: pointer;
    margin-top: 2px;
    box-shadow: 0 2px 8px #0005;
    transition: all 0.2s ease;
}
.btn-modal-close { background: #32394a; color: #eee; }
.btn-modal-scan { background: #21c8e5; color: #fff; }

.btn-modal-scan:hover { background: var(--primary-color); box-shadow: 0 4px 15px rgba(33, 200, 229, 0.4); }
.btn-modal-close:hover { background: #40485c; }
.btn-modal-scan:active { background: #19b3be; }
.btn-modal-close:active { background: #262b34; }





/* أنماط النافذة المنبثقة */
.genes-region-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.genes-region-modal.is-visible {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 30px;
    border-radius: 20px;
    width: 90vw;
    max-width: 900px;
    max-height: 90vh;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.genes-region-modal.is-visible .modal-content {
    transform: scale(1);
}

/* زر الإغلاق */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.1);
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #dc3545;
}

.modal-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: rotate(90deg);
}

/* العنوان */
.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    width: 80%;
    margin: 20px auto;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(45deg, #667eea, #1FBB5B);
    border-radius: 2px;
}

/* الكانفاس */
.popup-gene-canvas {
    background: #1a1a2e;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
    cursor: grab;
    transition: all 0.3s ease;
    min-height: 250px;
    flex-shrink: 0;
}

.popup-gene-canvas.is-panning {
    cursor: grabbing;
}

.popup-gene-canvas:hover {
    border-color: #667eea;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.2);
}

/* حاوية الإدخال */
.region-inputs-container {
    overflow-y: auto;
    max-height: 300px;
    padding-right: 10px;
    margin-bottom: 20px;
}

.region-inputs-container::-webkit-scrollbar {
    width: 8px;
}

.region-inputs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.region-inputs-container::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #1FBB5B);
    border-radius: 10px;
}

/* عناوين المناطق */
.region-group-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 10px 0;
    padding: 10px;
    background: linear-gradient(45deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

/* صفوف الإدخال */
.input-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.input-row:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateX(-5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.input-row label {
    width: 130px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    flex-shrink: 0;
}

/* شريط التمرير */
.input-row input[type="range"] {
    flex: 1;
    min-width: 100px;
    height: 6px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    appearance: none;
}

.input-row input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #667eea, #1FBB5B);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.input-row input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.input-row input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #667eea, #1FBB5B);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* حقل الأرقام */
.input-row input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
}

.input-row input[type="number"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* زر التطبيق */
.apply-btn {
    background: linear-gradient(45deg, #1FE1DD, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    align-self: center;
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.apply-btn:active {
    transform: translateY(0);
}

/* أنماط ريسبونسيف */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw;
        padding: 20px;
        margin: 10px;
    }

    .popup-gene-canvas {
        min-height: 200px;
    }

    .input-row {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .input-row label {
        width: 100%;
        text-align: center;
    }

    .input-row input[type="number"] {
        width: 100%;
    }

    .region-inputs-container {
        max-height: 200px;
    }
}

@media (max-width: 480px) {
    .modal-title {
        font-size: 20px;
    }

    .region-group-title {
        font-size: 16px;
    }
}

/* تأثيرات الحركة */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.input-row {
    animation: fadeIn 0.5s ease forwards;
}

/* أنماط الإمكانية الوصول */
.edit-btn:focus,
.apply-btn:focus,
.modal-close-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* تحسين الأداء */
.popup-gene-canvas {
    will-change: transform;
}

/* دعم اللمس */
@media (hover: none) {
    .input-row:hover {
        transform: none;
    }

    .edit-btn:hover,
    .apply-btn:hover {
        transform: none;
    }
}
















.highlight-section {
    border: 2px dashed #4caf50;
    padding: 16px 12px 10px 12px;
    margin-bottom: 24px;
    background: #f8fff8;
    border-radius: 14px;
    box-shadow: 0 6px 32px #4caf5040;
    max-width: 530px;
    margin-left: auto;
    margin-right: auto;
    transition: box-shadow 0.3s, border-color 0.3s;
}
.highlight-section.hidden {
    display: none;
}
.result-card.highlighted {
    border-color: #fbbf24 !important;
    box-shadow: 0 0 18px #fbbf2430, 0 0 0 8px #fffbe688;
    transform: scale(1.03);
    background: #fffbe6;
    z-index: 5;
}
.related-cards-container .result-card {
    margin-top: 10px;
    margin-bottom: 14px;
    box-shadow: 0 2px 18px #e4e7ec12;
}
.highlight-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.highlight-title {
    font-weight: bold;
    color: #4caf50;
    font-size: 18px;
}
.clear-highlight-btn {
    padding: 4px 14px;
    border: none;
    background: #e53935;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    transition: background 0.2s;
}
.clear-highlight-btn:hover {
    background: #c62828;
}



.stats-row{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}


