/* إعادة تعيين الأنماط الأساسية */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* المتغيرات اللونية */
:root {
    --background: hsl(40, 20%, 97%);
    --foreground: hsl(30, 10%, 12%);
    --muted-foreground: hsl(30, 8%, 45%);
    --portfolio-card-radius: 1.25rem;
    --border-color: hsl(35, 15%, 88%);
}

/* أنماط الجسم */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
}

/* قسم معرض الأعمال */
.portfolio-section {
    padding: 5rem 1.5rem;
    max-width: 80rem;
    margin: 0 auto;
}

/* رأس القسم */
.portfolio-header {
    margin-bottom: 2.5rem;
}

.portfolio-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.portfolio-description {
    color: var(--muted-foreground);
    font-size: 1.125rem;
    max-width: 28rem;
}

/* شبكة المشاريع */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

/* استجابة الشبكة للشاشات المتوسطة */
@media (min-width: 640px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* استجابة الشبكة للشاشات الكبيرة */
@media (min-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .portfolio-title {
        font-size: 3rem;
    }
}

/* بطاقة المشروع */
.project-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--portfolio-card-radius);
    cursor: pointer;
    aspect-ratio: 3 / 4;
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover img {
    transform: scale(1.05);
}

/* تدرج الغطاء */
.project-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6), transparent, transparent);
}

/* عنوان المشروع */
.project-title {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.5);
    padding-bottom: 0.25rem;
}

/* زر عرض المزيد */
.see-more-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.see-more-btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid rgba(0,0,0,0.2);
    background: transparent;
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.3s ease;
}

.see-more-btn:hover {
    background: var(--foreground);
    color: var(--background);
}

/* ========== أنماط صندوق العرض ========== */

/* غطاء الخلفية */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lightbox-overlay.active {
    display: flex;
}

/* حاوية صندوق العرض */
.lightbox-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

/* أزرار التحكم المشتركة */
.lightbox-btn {
    position: absolute;
    z-index: 50;
    padding: 0.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    color: #1a1a1a;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-btn:hover {
    background: white;
}

/* زر الإغلاق */
.close-btn {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem;
}

/* زر السابق */
.prev-btn {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* زر التالي */
.next-btn {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* حاوية الصورة */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 1rem;
}

/* معلومات الصورة */
.image-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1.5rem;
    border-radius: 0 0 1rem 1rem;
}

.image-info h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 500;
}

.image-info p {
    color: rgba(255,255,255,0.7);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* مؤشرات الصور المصغرة */
.thumbnail-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover {
    background: rgba(255,255,255,0.7);
}

.indicator.active {
    width: 1.5rem;
    background: white;
}

/* أيقونات SVG */
.icon {
    width: 1.5rem;
    height: 1.5rem;
}
