.pagination-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination-buttons button {
    background-color: #ffc107; 
    color: #212529; 
    border: none;
    padding: 7px 20px;
    height: 40px;
    margin: 0 5px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
    font-weight: bold; 
    transition: background-color 0.3s ease;
}

.pagination-buttons button:hover {
    background-color: #e0a800;
}

.pagination-buttons button:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.our-projects {padding-top: 0 !important;}

/* Compact spacing for project items */
.project-item-box {
    margin-bottom: 20px !important;
}

/* Modal container */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    object-fit: contain;
    margin: auto;
    margin-left: auto;
    margin-right: auto;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001; 
}

.close-modal:hover {
    color: #ffc107;
}

/* Project Category Tabs Styles */
.project-category-tabs {
    margin: 40px 0;
    padding: 20px 0;
}

.project-category-tabs .nav-pills .nav-link {
    background-color: #f8f9fa;
    color: #212529;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 24px;
    margin: 0 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-category-tabs .nav-pills .nav-link:hover {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #212529;
}

.project-category-tabs .nav-pills .nav-link.active {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* Mobile responsive tabs */
@media (max-width: 768px) {
    .project-category-tabs .nav-pills {
        flex-wrap: wrap;
    }

    .project-category-tabs .nav-pills .nav-link {
        margin: 5px;
        flex: 1 1 calc(50% - 10px);
        text-align: center;
        font-size: 14px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .project-category-tabs .nav-pills .nav-link {
        flex: 1 1 100%;
        font-size: 13px;
        padding: 10px 12px;
    }
}

/* Fallback Image Styling with Logo - Desktop (>1024px) */
figure.image-fallback {
    position: relative;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    aspect-ratio: 1 / 1.2; /* Match the aspect-ratio of actual project images for consistent positioning */
}

figure.image-fallback img {
    max-width: 140px;
    max-height: 90px;
    object-fit: contain;
    opacity: 0.7;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Enhance project-content visibility on fallback items (ALL DEVICES) */
.project-item-box:has(figure.image-fallback) .project-content h3 {
    color: #ffffff !important;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5);
}

.project-item-box:has(figure.image-fallback) .project-content p {
    color: #ffc107 !important;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.9);
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Fix project-content positioning for fallback items - ensure it overlays on figure */
.project-item-box:has(figure.image-fallback) .project-content {
    position: absolute;
    bottom: 10px;
    right: 30px;
    left: 30px;
    text-align: center;
    z-index: 10;
}

/* Modal Fallback Styling */
img.modal-fallback {
    max-width: 220px;
    max-height: 170px;
    object-fit: contain;
    opacity: 0.85;
    filter: drop-shadow(0 0 15px rgba(255, 193, 7, 0.4));
}

/* Carousel Modal Styles */
.modal-carousel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
    padding-top: 50px;
    box-sizing: border-box;
}

.carousel-image {
    max-width: 85%;
    max-height: 70%;
    margin: auto;
    margin-left: auto;
    margin-right: auto;
    object-fit: contain;
    display: block;
    align-self: center;
}

.modal-single {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    margin-left: auto;
    margin-right: auto;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1002;
    user-select: none;
    padding: 10px;
}

.carousel-nav:hover {
    color: #ffc107;
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: background-color 0.3s;
}

.carousel-dot:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.carousel-dot.active {
    background-color: #ffc107;
}

.carousel-counter {
    display: none;
}

/* Mobile responsive carousel */
@media (max-width: 768px) {
    .modal-carousel {
        padding-top: 40px;
    }

    .carousel-nav {
        font-size: 36px;
        padding: 8px;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .carousel-image {
        max-width: 90%;
        max-height: 65%;
    }

    .carousel-counter {
        display: none;
    }

    .carousel-indicators {
        margin-top: 8px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
    }
}

/* Image fallback on hover */
figure.image-fallback:hover img {
    opacity: 0.85;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    figure.image-fallback {
        min-height: 180px;
        aspect-ratio: 1 / 1.2; /* Match the aspect-ratio of actual project images */
    }

    figure.image-fallback img {
        max-width: 110px;
        max-height: 70px;
    }

    .project-item-box:has(figure.image-fallback) .project-content h3 {
        font-size: 20px;
    }

    .project-item-box:has(figure.image-fallback) .project-content p {
        font-size: 14px;
    }

    .project-item-box:has(figure.image-fallback) .project-content {
        bottom: 10px;
    }
}

/* Mobile Landscape (481px - 768px) */
@media (max-width: 768px) {
    figure.image-fallback {
        min-height: 160px;
        aspect-ratio: 1 / 1.2; /* Match the aspect-ratio of actual project images */
    }

    figure.image-fallback img {
        max-width: 90px;
        max-height: 60px;
    }

    .project-item-box:has(figure.image-fallback) .project-content h3 {
        font-size: 18px !important;
        text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.9);
    }

    .project-item-box:has(figure.image-fallback) .project-content p {
        font-size: 13px !important;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    }

    .project-item-box:has(figure.image-fallback) .project-content {
        bottom: 10px;
    }

    img.modal-fallback {
        max-width: 180px;
        max-height: 140px;
    }
}

/* Mobile Portrait (<=480px) */
@media (max-width: 480px) {
    figure.image-fallback {
        min-height: 140px;
        aspect-ratio: 1 / 1.2; /* Match the aspect-ratio of actual project images */
    }

    figure.image-fallback img {
        max-width: 70px;
        max-height: 45px;
    }

    .project-item-box:has(figure.image-fallback) .project-content h3 {
        font-size: 16px !important;
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.95);
    }

    .project-item-box:has(figure.image-fallback) .project-content p {
        font-size: 12px !important;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.95);
    }

    .project-item-box:has(figure.image-fallback) .project-content {
        bottom: 10px;
    }

    img.modal-fallback {
        max-width: 150px;
        max-height: 120px;
    }
}