﻿:root {
    /* عدّل الرقم حسب ارتفاع الهيدر عندك */
    --header-h: 80px;
    --header-extra-gap: 16px; /* مسافة إضافية مريحة تحت الهيدر */
}

@media (max-width: 768px) {
    :root {
        --header-h: 60px; /* هيدر أصغر على الموبايل */
        --header-extra-gap: 14px;
    }
}

html {
    scroll-behavior: smooth;
    /* عند القفز للأنكور، خُد في الاعتبار ارتفاع الهيدر */
    scroll-padding-top: calc(var(--header-h) + var(--header-extra-gap));
}

.our-work-container {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    padding: 2rem;
    color: #fff;
    background-color: #111;
    flex-wrap: wrap;
    /* ✅ مسافة تحت الهيدر عشان الكلام ما يختفيش */
    margin-top: calc(var(--header-h) + var(--header-extra-gap));
}

/* === الشريط الجانبي (نسخة إبداعية) === */
.category-sidebar {
    width: 240px;
    position: fixed;
    top: calc(var(--header-h) + 40px);
    right: 2rem;
    z-index: 20;
    /* Glass / نيون */
    background: rgba(15, 23, 42, 0.92);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(34, 211, 238, 0.25);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(10px);
}

    /* هالة خفيفة حوالين الكرت */
    .category-sidebar::before {
        content: "";
        position: absolute;
        inset: -1px;
        border-radius: inherit;
        background: radial-gradient(circle at top, rgba(56, 189, 248, 0.4), transparent 55%);
        opacity: 0.2;
        z-index: -1;
    }

    .category-sidebar ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .category-sidebar li {
        margin-bottom: 0.3rem;
        position: relative;
        padding-bottom: 0.6rem;
    }

        /* فاصل منقط تحت كل عنصر */
        .category-sidebar li:not(:last-child)::after {
            content: "";
            display: block;
            width: 100%;
            height: 1px;
            margin-top: 6px;
            border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
        }


    /* اللينكات كبادجات – تعريف واحد فقط */
    .category-sidebar a {
        display: block;
        padding: 0.45rem 0.6rem;
        border-radius: 999px;
        text-decoration: none;
        font-weight: 500;
        font-size: 0.9rem;
        color: #e5f9ff;
        text-align: right;
        position: relative;
        line-height: 1.3;
        transition: background 0.25s ease, transform 0.2s ease, color 0.25s ease, box-shadow 0.25s ease;
    }

    /* السطر الرئيسي (العربي في الغالب) */
    .category-sidebar .cat-main {
        display: block;
        font-weight: 600;
        font-size: 0.9rem;
    }

    /* السطر الفرعي (الإنجليزي) */
    .category-sidebar .cat-sub {
        display: block;
        font-size: 0.78rem;
        opacity: 0.8;
        direction: ltr; /* يخلي الإنجليزي مستقيم */
        text-align: left; /* ناحية الشمال جوه نفس البادچ */
        margin-top: 2px;
    }

    /* هوفر على البادچ */
    .category-sidebar a:hover {
        background: linear-gradient(135deg, #0f172a, #022c22);
        color: #f9fafb;
        transform: translateY(-1px);
        box-shadow: 0 8px 18px rgba(34, 211, 238, 0.35);
    }

/* فاصل داخل الشريط */
.sidebar-sep {
    border-top: 1px dashed #334155;
    margin: 0.7rem 0 0.5rem;
}

/* عنوان رئيسي فوق الشريط */
.sidebar-main-title {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    color: #e5f9ff;
    text-align: right;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(34, 211, 238, 0.25);
    margin-top: 0.3rem;
}

/* === محتوى الأقسام === */
.our-work-content {
    flex: 1;
    min-width: 0;
    margin-right: 250px; /* نفس عرض الشريط تقريبًا + شوية مسافة */
}

.section-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #fff;
}

.section-subtitle {
    font-size: 1rem;
    color: #ccc;
    margin-bottom: 2rem;
}

/* === كل قسم خدمات (مشاريع) === */
.service-section {
    margin-bottom: 4rem;
    background-color: #1b1b1b;
    border-radius: 10px;
    padding: 1.5rem;
}

.service-title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: #00d9ff;
}

.service-description {
    color: #aaa;
    margin-bottom: 1.5rem;
}

/* === شبكة المشاريع === */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

/* === بطاقة المشروع === */
.project-card {
    background-color: #262626;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s;
    box-shadow: 0 0 8px #000;
    display: flex;
    flex-direction: column;
    color: inherit;
    height: 100%;
    position: relative;
    cursor: pointer;
}

    .project-card:hover {
        transform: scale(1.03);
        box-shadow: 0 0 10px #00eaff;
    }

    .project-card figure {
        margin: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

/* === القلبة 3D للصور === */
.flip-card {
    width: 100%;
    height: 230px;
    perspective: 1000px;
    position: relative;
}

.project-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #000;
    display: block;
    border-bottom: 1px solid #333;
    padding: 0;
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    border-bottom: 1px solid #333;
}

.project-card:hover .flip-inner {
    transform: rotateY(180deg);
}

.flip-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
    padding: 0;
    backface-visibility: hidden;
}

.flip-front {
    transform: rotateY(0deg);
}

.flip-back {
    transform: rotateY(180deg);
}

/* === معلومات المشروع === */
.project-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00f5ff;
    margin-bottom: 0.5rem;
}

.project-type {
    color: #bbb;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.project-placeholder {
    background-color: #444;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.project-overlay-icon {
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #00eaff;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-card:hover .project-overlay-icon {
    opacity: 1;
}

/* === استجابة للجوال === */
@media (max-width: 768px) {
    .our-work-container {
        flex-direction: column;
        padding: 1rem;
    }

    .category-sidebar {
        width: 100%;
        position: relative;
        top: unset;
        right: 0;
        margin-bottom: 2rem;
    }

    .our-work-content {
        margin-right: 0; /* ما فيش شريط ثابت على الموبايل */
    }
}
