/* Projects Listing Page Styles */

/* Category Banner */
.category-banner {
    position: relative;
    height: 65vh;
    min-height: 500px;
    color: var(--light-text);
    overflow: hidden;
    display: flex;
    align-items: center;
    margin-top: 80px;
    /* Add space below the header */
}

.category-banner-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.category-banner-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-banner-bg .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.45));
    z-index: 1;
}

.blur-box-container {
    position: relative;
    z-index: 2;
    padding-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.blur-background-box {
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 40px 60px;
    border-radius: 8px;
    max-width: 800px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blur-background-box h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
}

.blur-background-box h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
    box-shadow: 0 0 16px rgba(231, 76, 60, 0.5);
}

.blur-background-box p {
    text-align: justify;
    font-size: 1.0rem;
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    font-weight: 400;
    line-height: 1.5;
}

/* Filters Section */
.filters-section {
    background-color: #fff;
    padding: 30px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    /* Removed sticky positioning to prevent hiding projects */
}

.filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #fff;
    font-family: 'Montserrat', sans-serif;
    color: var(--secondary-color);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    cursor: pointer;
}

.search-group {
    flex: 2;
    min-width: 300px;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 45px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
}

.search-input-wrapper button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    cursor: pointer;
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #f3f4f6;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.filter-tag .remove-filter {
    margin-left: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.filter-tag .remove-filter:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Projects Grid */
.projects-listing-grid {
    padding: 50px 0;
    background-color: #f9fafb;
}

.projects-count {
    margin-bottom: 30px;
    font-size: 1rem;
    color: #6b7280;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

/* No Results */
.no-results {
    padding: 60px 0;
    text-align: center;
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results i {
    font-size: 3rem;
    color: #d1d5db;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.no-results p {
    color: #6b7280;
    margin-bottom: 20px;
}

.reset-button {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reset-button:hover {
    background-color: #c0392b;
}

/* Load More Button */
.load-more-section {
    padding: 20px 0 60px;
    text-align: center;
    background-color: #f9fafb;
}

.load-more-btn {
    padding: 12px 30px;
    background-color: #fff;
    color: var(--secondary-color);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.load-more-btn:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.load-more-btn .fa-spinner {
    font-size: 1.2rem;
}

/* Project Card Styles - Enhanced for listing page */
.listing-project-card {
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.listing-project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1), 0 0 15px rgba(231, 76, 60, 0.1);
}

.listing-project-media {
    position: relative;
    height: 350px;
    overflow: hidden;
}

.listing-project-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
    background-color: #f9fafb;
    /* Light background for letterboxing */
}

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

/* Carousel images within project cards */
.listing-project-media .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.5s ease;
    background-color: #f9fafb;
    /* Light background for letterboxing */
}

.listing-project-card:hover .listing-project-media .carousel-item img {
    transform: scale(1.05);
}

.listing-project-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 12px;
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.3);
}

.listing-project-year {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.listing-project-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.listing-project-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.listing-project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    color: #6b7280;
    font-size: 0.9rem;
}

.listing-project-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.listing-project-meta i {
    color: var(--primary-color);
}

.listing-project-description {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.listing-project-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f3f4f6;
    padding-top: 15px;
}

.listing-project-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.listing-project-link:hover {
    color: #c0392b;
}

.listing-project-link:hover i {
    transform: translateX(3px);
}

.listing-project-link i {
    transition: transform 0.2s ease;
}

/* Project Lightbox Styles - Completely Redesigned */
.project-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

/* Show lightbox when aria-hidden is false */
.project-lightbox[aria-hidden="false"] {
    display: flex;
}

.lightbox-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
}

.lightbox-content {
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    position: relative;
    z-index: 2001;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.lightbox-content.lightbox-animate-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lightbox-container {
    display: flex;
    height: 90vh;
    background-color: #fff;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: black;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background-color: var(--primary-color);
    transform: rotate(90deg);
}

/* Left side - Image Carousel */
.lightbox-media {
    flex: 1.5;
    background-color: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Override any red backgrounds */
.lightbox-media *,
.lightbox-carousel *,
.lightbox-carousel-container *,
.lightbox-carousel-nav * {
    background-color: transparent !important;
    border-color: transparent !important;
}

/* Only allow specific elements to have their own background */
.lightbox-prev,
.lightbox-next,
.lightbox-indicator,
.lightbox-carousel-item img {
    background-color: initial !important;
    border-color: initial !important;
}

.lightbox-carousel {
    width: 100%;
    height: 100%;
    position: relative;
    background: transparent;
}

.lightbox-carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: transparent;
    border: none;
    outline: none;
}

.lightbox-carousel-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(1.05);
    background: transparent;
    border: none;
    outline: none;
}

.lightbox-carousel-item.active {
    opacity: 1;
    z-index: 1;
    transform: scale(1);
}

.lightbox-carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    z-index: 2;
    position: relative;
}

.lightbox-carousel-nav {
    position: absolute;
    top: 50%;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    z-index: 3;
    padding: 0 20px;
    pointer-events: none;
    /* This allows clicks to pass through the nav container */
    background: transparent !important;
    /* Force no background color */
    border: none;
    outline: none;
    box-shadow: none;
}

.lightbox-prev,
.lightbox-next {
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: #fff;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    pointer-events: auto;
    /* Make buttons clickable */
    z-index: 10;
    position: relative;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.7) !important;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4) !important;
}

.lightbox-carousel-indicators {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 4;
    pointer-events: none;
}

.lightbox-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 5;
}

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

.lightbox-indicator.active {
    background-color: #ffffff;
    border-color: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Right side - Project Information */
.lightbox-info {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

.lightbox-header {
    margin-bottom: 20px;
    border-bottom: 1px solid #f1f1f1;
    padding-bottom: 20px;
}

.lightbox-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 10px;
    line-height: 1.2;
}

.lightbox-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
}

.lightbox-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f1f1;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 1rem;
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.lightbox-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-section h3,
.description-section h3 {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-label {
    font-weight: 600;
    color: #6b7280;
    font-size: 0.9rem;
}

.detail-value {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

.lightbox-description {
    color: #4b5563;
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: justify;
}

.lightbox-description p {
    margin: 0 0 1em 0;
}

.lightbox-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-button.primary {
    background-color: var(--primary-color);
    color: #fff;
}

.action-button.primary:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

.action-button.secondary {
    background-color: #f3f4f6;
    color: var(--secondary-color);
}

.action-button.secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-2px);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .category-banner {
        height: 60vh;
    }

    .blur-background-box {
        padding: 30px 40px;
        max-width: 700px;
    }

    .blur-background-box h1 {
        font-size: 3.5rem;
    }

    .blur-background-box p {
        font-size: 1.1rem;
        max-width: 95%;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    /* Lightbox responsive styles */
    .lightbox-container {
        flex-direction: column;
        height: auto;
        max-height: 90vh;
    }

    .lightbox-media {
        flex: none;
        height: 50vh;
    }

    .lightbox-info {
        padding: 30px;
    }

    .lightbox-title {
        font-size: 2rem;
    }

    .detail-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .category-banner {
        height: 55vh;
    }

    .blur-background-box {
        padding: 25px 30px;
        max-width: 90%;
    }

    .blur-background-box h1 {
        font-size: 2.8rem;
    }

    .blur-background-box p {
        font-size: 1rem;
        max-width: 100%;
    }

    .filters-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    /* Lightbox responsive styles */
    .lightbox-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .lightbox-container {
        height: 100vh;
        flex-direction: column;
    }

    .lightbox-media {
        height: 40vh;
        flex: none;
    }

    .lightbox-info {
        padding: 20px;
        overflow-y: auto;
    }

    .lightbox-title {
        font-size: 1.8rem;
    }

    .lightbox-stats {
        flex-direction: column;
        gap: 10px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-actions {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
        justify-content: center;
    }

    .project-detail-item {
        flex-direction: column;
    }

    .detail-label {
        width: 100%;
        margin-bottom: 5px;
    }
}

@media (max-width: 480px) {
    .category-banner {
        height: 50vh;
    }

    .blur-background-box {
        padding: 20px;
        max-width: 95%;
    }

    .blur-background-box h1 {
        font-size: 2.2rem;
    }

    .blur-background-box p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .listing-project-media {
        height: 280px;
    }

    /* Lightbox responsive styles */
    .lightbox-media {
        height: 35vh;
    }

    .lightbox-info {
        padding: 15px;
    }

    .lightbox-title {
        font-size: 1.5rem;
    }

    .lightbox-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
    }

    .stat-item {
        font-size: 0.9rem;
    }

    .detail-section h3,
    .description-section h3 {
        font-size: 1.1rem;
    }

    .detail-value {
        font-size: 1rem;
    }

    .lightbox-description {
        font-size: 0.95rem;
    }
}