/* --- 1. Grid & Container (من الكود الأصلي) --- */
.dg-cnt { margin: 0 auto; width: 100%; direction: ltr; }
.dg-cnt[dir="rtl"] { direction: rtl; }
.dg-grd { display: grid; gap: 30px; }

/* --- 2. Card Style (من الكود الأصلي) --- */
.dg-crd { transition: 0.3s; cursor: pointer; overflow: hidden; padding-bottom: 20px; }
.dg-crd:hover { transform: translateY(-5px); }
.dg-crd.tr { text-align: right; } .dg-crd.tl { text-align: left; }

.dg-img { width: 100%; aspect-ratio: 3/4; overflow: hidden; }
.dg-img img { width: 100%; height: 100%; object-fit: cover; transition: 0.4s; }
.dg-crd:hover .dg-img img { transform: scale(1.05); }

.dg-inf { padding: 15px; }
.dg-nm { margin: 0 0 5px; font-weight: bold; line-height: 1.2; display: block; min-height: 20px; font-family: inherit !important; }
.dg-spc { margin: 0; line-height: 1.4; display: block; min-height: 15px; font-family: inherit !important; }
.dg-extra-grid { margin-top: 5px; font-size: 13px; background: #f9f9f9; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-right: 5px; color: #555; }

/* --- 3. Modal/Popup (من الكود الأصلي) --- */
.dg-mod {
    display: none; position: fixed; z-index: 999999;
    left: 0; top: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.dg-mod.act { display: flex; }

.dg-mod-c {
    background: #fff; width: 900px; max-width: 90%;
    position: relative; border-radius: 8px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.dg-cls {
    position: absolute; top: 15px; font-size: 30px; cursor: pointer; z-index: 20;
    width: 35px; height: 35px; line-height: 35px; text-align: center;
    background: #fff; border-radius: 50%;
}
[dir="ltr"] .dg-cls { right: 15px; } [dir="rtl"] .dg-cls { left: 15px; }

.dg-mod-b { display: flex; width: 100%; transition: 0.3s; }
.dg-mod-img { width: 40%; background: #f0f0f0; }
.dg-mod-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dg-mod-inf { width: 60%; padding: 40px; display: flex; flex-direction: column; justify-content: center; }

/* ضبط المحاذاة للبوب أب */
.dg-mod[dir="rtl"] .dg-mod-inf { text-align: right; }
.dg-mod[dir="ltr"] .dg-mod-inf { text-align: left; }

.dg-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #00adef; padding-bottom: 15px; margin-bottom: 20px; }
.dg-head h2 { margin: 0; font-size: 1.8em; color: #222; font-family: inherit !important; }

.dg-nv { display: flex; gap: 5px; }
.dg-nv button {
    background: #fff !important; 
    border: 1px solid #ccc !important; 
    cursor: pointer; 
    width: 35px !important; height: 35px !important; 
    font-size: 18px !important; line-height: 1 !important;
    display: flex !important; align-items: center; justify-content: center;
    color: #333 !important;
    opacity: 1 !important; visibility: visible !important;
}
.dg-nv button:hover { background: #00adef !important; color: #fff !important; border-color: #00adef !important; }

.dg-rw { background: #f9f9f9; padding: 10px; margin-bottom: 10px; border-radius: 4px; display: flex; }
.dg-lbl { font-weight: bold; width: 130px; flex-shrink: 0; color: #444; font-family: inherit !important; }
.dg-val { color: #666; font-family: inherit !important; }
.bio-box { display: block; } .bio-box .dg-lbl { display: block; margin-bottom: 5px; }

.dg-act { margin-top: 30px; display: flex; gap: 10px; }
.btn-ln { border: 2px solid #333; padding: 10px 25px; text-decoration: none; color: #333; font-weight: bold; text-transform: uppercase; transition: 0.3s; font-family: inherit !important; display: inline-block; }
.btn-ln:hover { background: #00adef; border-color: #00adef; color: #fff; }

.dg-ld { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); border: 4px solid #f3f3f3; border-top: 4px solid #00adef; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s infinite; display: none; }
@keyframes spin { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }

/* --- 4. Profile Styles (استعادة الشكل القديم + تثبيت العمودين) --- */
.dg-pf-wrap { 
    display: flex !important; /* إجبار الفليكس */
    gap: 40px; 
    background: #fff; 
    padding: 40px; 
    border-radius: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    margin: 30px auto; 
    align-items: flex-start;
}
.dg-pf-side { flex: 0 0 30%; text-align: center; }
.dg-pf-img img { width: 100%; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); height: auto; object-fit: cover; }
.dg-pf-main { flex: 1; }
.dg-pf-name { font-size: 2.5em; margin: 0 0 8px 0; color: #2c3e50; line-height: 1.2; }
.dg-pf-pos-main { color: #999; font-size: 1.2em; font-weight: normal; margin-bottom: 15px; }
.dg-name-sep { width: 60px; height: 1px; background: #eee; margin-bottom: 25px; }
.dg-pf-bio { font-size: 1.1em; line-height: 1.8; color: #555; margin-bottom: 20px; }
.dg-pf-full-desc { font-size: 1em; line-height: 1.6; color: #444; }
.dg-pf-det { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 20px; border-top: 1px solid #eee; padding-top: 30px; margin-top: 30px; }
.dg-dt-it { display: flex; flex-direction: column; }
.dg-dt-it.cnt { border-left: 1px solid #eee; padding-left: 20px; }
[dir="rtl"] .dg-dt-it.cnt { border-right: 1px solid #eee; padding-right: 20px; border-left: none; padding-left: 0; }
.dg-dt-l { font-size: 0.9em; text-transform: uppercase; color: #999; font-weight: bold; }
.dg-dt-v { font-size: 1.2em; color: #333; font-weight: 600; }

@media(max-width:768px){
    .dg-mod-c { height: 90vh; overflow-y: auto; }
    .dg-mod-b { flex-direction: column; }
    .dg-mod-img, .dg-mod-inf { width: 100%; }
    .dg-mod-img { height: 250px; }
    
    .dg-pf-wrap { flex-direction: column !important; }
    .dg-pf-side { width: 100%; }
    .dg-dt-it.cnt { border: none; padding: 0; }
}