/* Project Carousel */
.project-carousel {
    position: relative;
    height: clamp(260px, 40vw, 400px);
    overflow: hidden;
    width: 100%;
    direction: ltr; /* Force LTR for slider mechanics */
}

/* Track that contains all slides */
.project-track {
    display: flex;
    height: 100%;
    transform: translateX(0);
    will-change: transform;
}

/* Individual slide styling */
.project-slide {
    flex: 0 0 auto;
    height: 100%;
    padding: 0 0.35rem; /* Slight gap so images get more width */
    transition: transform 0.3s ease;
    cursor: pointer;
}

/* Calculate slide width based on visible count */
@media (min-width: 1024px) {
    .project-slide {
        width: calc(100% / 3);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .project-slide {
        width: calc(100% / 2);
    }
}

@media (max-width: 1023px) {
    .project-slide {
        width: calc(100% / 1.35);
    }
}

@media (max-width: 767px) {
    .project-carousel {
        height: clamp(220px, 65vw, 320px);
    }
    
    .project-slide {
        width: 100%;
        padding: 0 0.15rem;
    }
}

.project-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.75rem;
    transition: transform 0.3s ease;
}

.project-slide:hover img {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Make sure the slider container handles overflow properly */
.project-slider {
    position: relative;
    overflow: hidden; /* Hide overflow inside the slider */
    padding: 0.5rem 0.75rem 1rem;
    direction: rtl; /* Container is RTL */
}

/* Improved Navigation Arrows with Gold Color and Primary Background */
.project-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #141e27; /* Primary color */
    color: #fcb044; /* Gold accent color */
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #fcb044;
    font-size: 1.15rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35);
}

.project-arrow:hover {
    background: #1a2732;
    border-color: #fdc372;
    color: #fdc372;
    transform: translateY(-50%) scale(1.1);
}

.project-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.project-arrow:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(252, 176, 68, 0.5);
}

/* Position the arrows layered above the carousel */
.project-arrow--prev {
    right: 10px;
}

.project-arrow--next {
    left: 10px;
}

/* Add a subtle animation to draw attention to the arrows */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(252, 176, 68, 0.3); }
    70% { box-shadow: 0 0 0 10px rgba(252, 176, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(252, 176, 68, 0); }
}

.project-arrow {
    animation: pulse 2s infinite;
}

/* Responsive adjustments for arrows on smaller screens */
@media (max-width: 1023px) {
    .project-arrow {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    .project-arrow--prev {
        right: 6px;
    }
    
    .project-arrow--next {
        left: 6px;
    }
}

@media (max-width: 640px) {
    .project-arrow {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
}

/* Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ...existing modal styles... */

.project-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.project-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 51;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.project-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.project-modal-close {
    position: absolute;
    top: -45px;
    right: 0;
    background: #141e27;
    color: #fcb044;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fcb044;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.project-modal-close:hover {
    background: #1a2732;
    color: #fdc372;
    transform: scale(1.1);
}

.project-modal-close:active {
    transform: scale(0.95);
}
