/* ============================================================
   صفحة الأعمال + صفحة تفاصيل المشروع — هوية أفق التقنية
   ============================================================ */

/* ===== Works Page Hero ===== */
.works-hero {
    padding: 170px 0 50px;
    background-color: var(--primary-color);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.works-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(242, 177, 0, 0.18), transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(242, 177, 0, 0.12), transparent 45%);
    pointer-events: none;
}

.works-hero .container { position: relative; z-index: 1; }

.works-hero .eyebrow {
    display: inline-block;
    color: var(--secondary-color);
    font-size: clamp(15px, 1.4vw, 20px);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.works-hero h1 {
    color: var(--white);
    font-size: clamp(34px, 5vw, 64px);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 18px;
}

.works-hero h1 .accent { color: var(--secondary-color); }

.works-hero p {
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(16px, 1.5vw, 21px);
    max-width: 720px;
    margin: 0 auto 30px;
    line-height: 1.8;
}

.works-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(24px, 5vw, 70px);
    margin-top: 10px;
}

.works-stat .num {
    display: block;
    color: var(--secondary-color);
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 900;
    line-height: 1;
}

.works-stat .lbl {
    color: rgba(255, 255, 255, 0.75);
    font-size: clamp(13px, 1.2vw, 16px);
    font-weight: 700;
}

/* ===== Works Listing ===== */
.works-listing {
    padding: 55px 0 90px;
    background-color: var(--light-bg);
}

.works-listing .works-filter { margin-bottom: 45px; }

.works-count {
    text-align: center;
    color: var(--text-light);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 30px;
}

.works-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* بطاقة مشروع */
.pcard {
    background-color: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-align: right;
}

.pcard:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 50px rgba(31, 51, 78, 0.16);
}

.pcard-media {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, var(--primary-color) 0%, #16273b 100%);
}

.pcard-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, rgba(242,177,0,0.22), transparent 55%);
}

.pcard-media img.pcard-logo {
    max-width: 62%;
    max-height: 62%;
    object-fit: contain;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 8px 20px rgba(0,0,0,0.3));
}

.pcard-media img.pcard-shot {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* اسم كبديل للصورة */
.pcard-media .pcard-name-fallback {
    position: relative;
    z-index: 1;
    color: var(--white);
    font-size: 30px;
    font-weight: 900;
    letter-spacing: 1px;
    text-align: center;
    padding: 0 16px;
}

.pcard-cat {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    background: rgba(242, 177, 0, 0.95);
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
}

.pcard-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pcard-body h3 {
    font-size: 21px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.pcard-en {
    font-size: 13px;
    color: var(--secondary-color);
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.pcard-tagline {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.pcard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pcard-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 800;
}

.pcard:hover .pcard-more { color: var(--secondary-color); }

.pcard-more svg { transition: transform 0.3s ease; }
.pcard:hover .pcard-more svg { transform: translateX(-5px); }

/* شارات الحالة */
.status-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 11px;
    border-radius: 20px;
    white-space: nowrap;
}
.status-live      { background: #e6f7ee; color: #0f9d58; }
.status-appstore  { background: #e8f0fe; color: #1a73e8; }
.status-apk       { background: #fff4e0; color: #d98700; }
.status-design    { background: #f0eaf8; color: #7c3aed; }

.pcard.is-hidden { display: none; }
.pcard.is-animating { animation: workFadeIn 0.45s ease both; }

/* ============================================================
   صفحة تفاصيل المشروع (work.html)
   ============================================================ */

.wd-hero {
    padding: 155px 0 55px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #16273b 100%);
    position: relative;
    overflow: hidden;
}
.wd-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 12% 25%, rgba(242,177,0,0.20), transparent 42%),
        radial-gradient(circle at 88% 75%, rgba(242,177,0,0.10), transparent 45%);
}
.wd-hero .container { position: relative; z-index: 1; }

.wd-breadcrumb {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 22px;
}
.wd-breadcrumb a { color: var(--secondary-color); }
.wd-breadcrumb a:hover { text-decoration: underline; }

.wd-hero-grid {
    display: flex;
    flex-direction: row-reverse;
    gap: 40px;
    align-items: center;
}

.wd-hero-text { flex: 1; }

.wd-badge {
    display: inline-block;
    background: rgba(242,177,0,0.16);
    color: var(--secondary-color);
    font-size: 15px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.wd-title {
    color: var(--white);
    font-size: clamp(32px, 4.5vw, 54px);
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 8px;
}

.wd-title-en {
    color: rgba(255,255,255,0.55);
    font-size: clamp(16px, 1.6vw, 22px);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 18px;
}

.wd-tagline {
    color: rgba(255,255,255,0.85);
    font-size: clamp(17px, 1.7vw, 22px);
    line-height: 1.7;
    margin-bottom: 26px;
}

.wd-cta-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.wd-visit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--secondary-color);
    color: var(--primary-color);
    font-size: 17px;
    font-weight: 800;
    padding: 13px 30px;
    border-radius: 12px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wd-visit:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(242,177,0,0.35); }

/* بطاقة الشعار في الهيرو */
.wd-hero-media {
    width: 440px;
    min-width: 300px;
    aspect-ratio: 1200 / 820;
    border-radius: 22px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* اللوقو (احتياطي) يبقى صغيراً في المنتصف */
.wd-hero-media img {
    max-width: 62%;
    max-height: 62%;
    object-fit: contain;
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.4));
}
/* صورة العرض تملأ الكارد بالكامل + قابلة للتكبير */
.wd-hero-media img.wd-hero-shot {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    filter: none;
    cursor: zoom-in;
    transition: transform 0.35s ease;
}
.wd-hero-media img.wd-hero-shot:hover { transform: scale(1.035); }
.wd-hero-media .wd-logo-fallback {
    color: var(--white);
    font-size: 38px;
    font-weight: 900;
    text-align: center;
    padding: 0 20px;
}

/* ===== محتوى التفاصيل ===== */
.wd-body { padding: 65px 0; background: var(--white); }

.wd-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 45px;
    align-items: start;
}

.wd-section { margin-bottom: 45px; }
.wd-section:last-child { margin-bottom: 0; }

.wd-h2 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    padding-right: 16px;
}
.wd-h2::before {
    content: '';
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 5px;
    border-radius: 4px;
    background: var(--secondary-color);
}

.wd-overview {
    font-size: 19px;
    line-height: 1.95;
    color: rgba(31,51,78,0.9);
}

/* قائمة المميزات */
.wd-features { display: grid; gap: 14px; }
.wd-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--light-bg);
    border-radius: 14px;
    padding: 16px 18px;
    font-size: 17px;
    font-weight: 500;
    color: var(--primary-color);
    line-height: 1.6;
}
.wd-feature .tick {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

/* شاشات UI/UX */
.wd-screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.wd-screen {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--light-bg);
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 700;
    color: var(--primary-color);
}
.wd-screen .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary-color); }

/* معرض الصور */
.wd-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.wd-gallery img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.wd-gallery img:hover { transform: scale(1.03); }

/* الشريط الجانبي */
.wd-aside { position: sticky; top: 100px; display: grid; gap: 22px; }

.wd-card {
    background: var(--white);
    border: 1px solid rgba(31,51,78,0.08);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.06);
}
.wd-card h4 {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 18px;
}

.wd-tech-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.wd-chip {
    background: var(--primary-color);
    color: var(--white);
    font-size: 14px;
    font-weight: 700;
    padding: 7px 15px;
    border-radius: 20px;
}

.wd-meta-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(31,51,78,0.08);
    font-size: 15px;
}
.wd-meta-item:last-child { border-bottom: none; }
.wd-meta-item .k { color: var(--text-light); font-weight: 700; }
.wd-meta-item .v { color: var(--primary-color); font-weight: 800; }

/* لوحة الألوان */
.wd-palette { display: flex; flex-wrap: wrap; gap: 10px; }
.wd-swatch { text-align: center; }
.wd-swatch .chip {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 6px;
}
.wd-swatch .hex { font-size: 11px; color: var(--text-light); font-weight: 700; direction: ltr; }

/* المشاريع ذات الصلة */
.wd-related { padding: 20px 0 80px; background: var(--white); }
.wd-related .section-title { margin-bottom: 35px; }

/* ===== Responsive ===== */
@media (max-width: 992px) {
    .works-cards { grid-template-columns: repeat(2, 1fr); }
    .wd-layout { grid-template-columns: 1fr; }
    .wd-aside { position: static; }
    .wd-hero-grid { flex-direction: column; text-align: center; }
    .wd-hero-media { width: 100%; max-width: 340px; }
    .wd-cta-row { justify-content: center; }
    .wd-badge { margin-inline: auto; }
}

@media (max-width: 620px) {
    .works-cards { grid-template-columns: 1fr; }
    .wd-screens { grid-template-columns: 1fr; }
}

/* ===== Lightbox (تكبير صورة العرض على صفحة التفاصيل) ===== */
.lightbox {
    position: fixed; inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none; justify-content: center; align-items: center;
    opacity: 0; transition: opacity 0.3s ease;
}
.lightbox.active { display: flex; opacity: 1; }
.lightbox-content { max-width: 92%; max-height: 88%; display: flex; justify-content: center; align-items: center; }
.lightbox-content img { max-width: 100%; max-height: 86vh; object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.lightbox-close {
    position: absolute; top: 26px; inset-inline-end: 30px;
    background: rgba(255,255,255,0.1); border: none; color: #fff; cursor: pointer;
    width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: color 0.3s ease, transform 0.3s ease, background-color 0.3s ease; z-index: 10000;
}
.lightbox-close:hover { color: var(--secondary-color, #F2B100); transform: scale(1.1); }
.lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); border: none; color: #fff; cursor: pointer;
    width: 54px; height: 54px; padding: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background-color 0.3s ease; z-index: 10000;
}
.lightbox-nav:hover { background: var(--secondary-color, #F2B100); }
.lightbox-prev { inset-inline-end: 30px; }
.lightbox-next { inset-inline-start: 30px; }
.lightbox-counter { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 16px; font-weight: 700; opacity: .85; }
