/* تحسين عرض Portfolio مع الصور الحقيقية */

.portfolio-item {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.portfolio-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(11, 11, 15, 0.3) 0%,
        rgba(11, 11, 15, 0.7) 100%
    );
    z-index: 1;
    transition: all 0.4s ease;
}

.portfolio-item:hover::before {
    background: linear-gradient(
        135deg,
        rgba(11, 11, 15, 0.1) 0%,
        rgba(11, 11, 15, 0.5) 100%
    );
}

.portfolio-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
    z-index: 0;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.portfolio-item:hover .portfolio-image {
    transform: scale(1.05);
}

.portfolio-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
}

.portfolio-category {
    background: rgba(212, 175, 55, 0.9);
    color: #0B0B0F;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    width: fit-content;
    backdrop-filter: blur(10px);
}

.portfolio-title {
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
    margin: 16px 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.portfolio-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* تحسين حالة التحميل */
.portfolio-loading {
    background: linear-gradient(
        135deg,
        rgba(212, 175, 55, 0.1) 0%,
        rgba(11, 11, 15, 0.9) 100%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.portfolio-loading::after {
    content: '📷';
    font-size: 48px;
    opacity: 0.5;
}

/* حالة عدم وجود صورة */
.portfolio-no-image {
    background: linear-gradient(
        135deg,
        rgba(212, 175, 55, 0.15) 0%,
        rgba(11, 11, 15, 0.95) 100%
    );
}

/* تحسين الإعدادات المتقدمة */
@media (max-width: 768px) {
    .portfolio-content {
        padding: 20px;
    }
    
    .portfolio-title {
        font-size: 18px;
    }
    
    .portfolio-description {
        font-size: 13px;
    }
}

/* تأثيرات الحركة */
@keyframes portfolioFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item {
    animation: portfolioFadeIn 0.6s ease-out;
}

/* Smooth hover effects */
.portfolio-item {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-item:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Improved card content visibility */
.portfolio-card-content {
    background: linear-gradient(to top, rgba(11, 11, 15, 0.95) 0%, rgba(11, 11, 15, 0.7) 60%, transparent 100%);
    padding: 1.5rem;
}

/* Better image overlay */
.portfolio-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(11, 11, 15, 0.2) 40%, rgba(11, 11, 15, 0.9) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.portfolio-card:hover::before {
    opacity: 0.85;
}

/* تحسين Modal */
.portfolio-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Filter Button Enhancements */
.portfolio-filter {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    outline: none;
}

.portfolio-filter::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.portfolio-filter:hover::before {
    opacity: 1;
}

.portfolio-filter.active-filter {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.1));
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.portfolio-filter.active-filter::before {
    opacity: 1;
}

/* Portfolio Card Enhancements */
.portfolio-card {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

.portfolio-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(11, 11, 15, 0.3) 60%, rgba(11, 11, 15, 0.95) 100%);
    z-index: 1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.portfolio-card:hover::after {
    opacity: 0.7;
}

/* Improved card content styling */
.portfolio-card-content {
    position: relative;
    z-index: 10;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-card-content {
    transform: translateY(-4px);
}

/* Line clamp utility for text truncation */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Smooth Image Loading */
.portfolio-image {
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    will-change: transform;
}

.portfolio-image[loading="lazy"] {
    opacity: 0;
    animation: fadeInImage 0.5s ease forwards;
}

.portfolio-image[loading="lazy"].loaded {
    opacity: 1;
}

@keyframes fadeInImage {
    to {
        opacity: 1;
    }
}

/* Gallery Modal Animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-modal.visible > div {
    animation: modalFadeIn 0.3s ease-out;
}

/* Improved grid spacing and layout */
#portfolioGrid {
    animation: fadeInGrid 0.8s ease-out;
}

@keyframes fadeInGrid {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Better empty state styling */
#portfolioEmptyState {
    min-height: 400px;
    align-items: center;
    justify-content: center;
    display: none !important; /* Hidden by default - use !important to override any other styles */
}

#portfolioEmptyState:not(.hidden) {
    display: flex !important;
    animation: fadeInEmpty 0.5s ease-out;
}

#portfolioEmptyState.hidden {
    display: none !important;
}

#portfolioEmptyState svg {
    animation: float 3s ease-in-out infinite;
}

@keyframes fadeInEmpty {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Enhanced filter button active state */
.portfolio-filter.active-filter {
    position: relative;
}

.portfolio-filter.active-filter::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #D4AF37, transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Loading state for images */
.portfolio-image {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(11, 11, 15, 0.9));
    min-height: 200px;
}

.portfolio-image.loaded {
    background: none;
}

/* Better focus states for accessibility */
.portfolio-item:focus {
    outline: 2px solid rgba(212, 175, 55, 0.5);
    outline-offset: 4px;
    border-radius: 24px;
}

.portfolio-item:focus-visible {
    outline: 2px solid #D4AF37;
    outline-offset: 4px;
}

/* Smooth transitions for all interactive elements */
.portfolio-item,
.portfolio-filter {
    will-change: transform, opacity;
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
    #portfolioGrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .portfolio-card-content {
        padding: 1.25rem;
    }
    
    .portfolio-item {
        margin-bottom: 1rem;
    }
    
    #portfolioGrid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .portfolio-filter {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .gallery-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .gallery-nav-btn.prev {
        right: 10px;
    }
    
    .gallery-nav-btn.next {
        left: 10px;
    }
    
    .gallery-thumbnail {
        width: 60px;
        height: 60px;
    }
}






