@import url('home.css');

/* Animations */
.project-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.project-card.animated {
    opacity: 1;
}

body {
    background-color: var(--white);
}

.page-banner {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 50px 0 50px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.banner-tag {
    animation: fadeInUp 0.6s ease-out;
}

.banner-title {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.banner-ar {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.page-banner .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.banner-tag {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 999px;
    background-color: rgba(250, 203, 35, 0.18);
    color: var(--accent-color) !important;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    font-size: 13px;
}

.banner-title {
    font-size: 44px;
    font-family: var(--font-heading-en);
    line-height: 1.05;
    color: var(--white) !important;
    margin-top: 4px;
}

.banner-ar {
    font-family: var(--font-body-ar);
    font-size: 22px;
    direction: rtl;
    text-align: center;
    color: var(--white) !important;
    margin-top: 2px;
}

.projects-overview {
    padding: 90px 0;
    scroll-margin-top: 100px;
}

.projects-overview .container {
    max-width: 1600px;
    padding: 0 40px;
}

.projects-intro {
    max-width: 800px;
    margin: 0 auto 50px;
    text-align: center;
    animation: fadeInUp 0.8s ease-out;
}

.intro-text {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.intro-ar {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.intro-text {
    font-size: 18px;
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 16px;
}

.intro-ar {
    font-family: var(--font-body-ar);
    font-size: 18px;
    color: var(--text-gray);
    direction: rtl;
    text-align: center;
    line-height: 1.8;
}

/* Project Type Tabs */
.project-type-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.type-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 40px;
    background: var(--white);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    text-align: center;
}

.type-tab i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 4px;
}

.type-tab span:not(.type-tab-ar) {
    font-size: 20px;
    font-family: var(--font-heading-en);
    font-weight: 600;
    color: var(--primary-color);
}

.type-tab-ar {
    font-family: var(--font-body-ar);
    font-size: 16px;
    color: var(--text-gray);
    direction: rtl;
}

.type-tab:hover {
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.type-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.type-tab.active i {
    color: var(--accent-color);
}

.type-tab.active span:not(.type-tab-ar) {
    color: var(--white);
}

.type-tab.active .type-tab-ar {
    color: rgba(255, 255, 255, 0.9);
}

/* Category Sections */
.category-section {
    margin-bottom: 60px;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--accent-color);
}

.category-title {
    font-size: 28px;
    font-family: var(--font-heading-en);
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 8px 0;
    text-transform: capitalize;
}

.category-title-ar {
    font-family: var(--font-body-ar);
    font-size: 18px;
    color: var(--text-gray);
    direction: rtl;
    margin: 0;
}

/* Subcategory blocks under each category */
.subcategory-block {
    margin-bottom: 36px;
}

.subcategory-block:last-child {
    margin-bottom: 0;
}

.subcategory-header {
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.subcategory-title {
    font-size: 20px;
    font-family: var(--font-heading-en);
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 4px 0;
}

.subcategory-title-ar {
    font-family: var(--font-body-ar);
    font-size: 15px;
    color: var(--text-gray);
    direction: rtl;
    margin: 0;
}

/* Mobile Filter Toggle Button */
.mobile-filter-toggle {
    display: none;
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: var(--font-body-en);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
}

.mobile-filter-toggle:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.mobile-filter-toggle i {
    font-size: 18px;
}

/* Projects Layout */
.projects-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    width: 100%;
}

/* Filters Sidebar */
.filters-sidebar {
    width: 340px;
    background-color: var(--white);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
}

.sidebar-title {
    font-size: 22px;
    font-family: var(--font-heading-en);
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.sidebar-close {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

/* Filter Section */
.filter-section {
    margin-bottom: 24px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter-section:last-of-type {
    margin-bottom: 0;
}

.filter-section-header {
    padding: 14px 18px;
    background-color: rgba(0, 0, 0, 0.02);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    user-select: none;
}

.filter-section-header:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.filter-section-header:active {
    background-color: rgba(0, 0, 0, 0.06);
}

.filter-section-title {
    font-size: 16px !important;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-section-title i {
    font-size: 14px;
    color: var(--accent-color);
}

.filter-section-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    font-size: 12px;
    opacity: 0.7;
    border-radius: 4px;
}

.filter-section-header:hover .filter-section-toggle {
    opacity: 1;
}

.filter-section.collapsed .filter-section-toggle {
    transform: rotate(-90deg);
}

.filter-section:not(.collapsed) .filter-section-toggle {
    transform: rotate(0deg);
}

.filter-section-content {
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease, opacity 0.3s ease;
    padding: 18px;
    opacity: 1;
    -webkit-overflow-scrolling: touch;
}

.filter-section.collapsed .filter-section-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    overflow: hidden;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 0;
    min-height: min-content;
}

.filter-option {
    padding: 14px 18px;
    border: 2px solid rgba(0, 0, 0, 0.08);
    background-color: var(--white);
    color: var(--primary-color);
    border-radius: 8px;
    font-family: var(--font-body-en);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-option:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: rgba(250, 203, 35, 0.05);
    transform: translateX(4px);
}

.filter-option.active {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(250, 203, 35, 0.3);
}

.filter-option i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* Filter Actions */
.filter-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid rgba(0, 0, 0, 0.05);
}

.clear-filters-btn {
    width: 100%;
    padding: 14px 20px;
    background-color: transparent;
    color: var(--text-gray);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-family: var(--font-body-en);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.clear-filters-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(0, 0, 0, 0.02);
}

/* Projects Content */
.projects-content {
    flex: 1;
    min-width: 0;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    margin-top: 0;
    width: 100%;
}

.project-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 26px 48px rgba(0, 0, 0, 0.12);
}

.project-image {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background-color: var(--light-gray);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.overlay-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.image-count {
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-count i {
    color: var(--accent-color);
}

.project-view-btn {
    padding: 12px 28px;
    background-color: var(--accent-color);
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    font-family: var(--font-body-en);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(250, 203, 35, 0.4);
}

.project-view-btn i {
    font-size: 16px;
}

.project-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.project-category {
    display: inline-block;
    padding: 6px 14px;
    background-color: rgba(250, 203, 35, 0.18);
    color: var(--accent-color);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}

.project-type-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-card h3 {
    font-size: 22px;
    font-family: var(--font-heading-en);
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.project-location {
    font-size: 14px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.project-location i {
    color: var(--accent-color);
    font-size: 12px;
}

/* Project Lightbox */
.project-lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    padding: 40px;
}

.project-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.project-lightbox img {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.lightbox-caption {
    margin-top: 24px;
    color: var(--white);
    font-size: 18px;
    font-family: var(--font-heading-en);
    text-align: center;
    max-width: 800px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.lightbox-close:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Hide filtered projects */
.project-card.hidden {
    display: none;
}

.no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-gray);
    font-size: 18px;
}

/* Project Gallery Modal */
.project-gallery-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 1;
    padding: 40px 20px;
    overflow-y: auto;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    z-index: 10;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 32px;
    color: var(--white);
}

.modal-title {
    font-size: 36px;
    font-family: var(--font-heading-en);
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--white);
}

.modal-location {
    font-size: 18px;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-location i {
    font-size: 16px;
}

.modal-gallery {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    position: relative;
    min-height: 60vh;
    max-width: 95vw;
    margin-left: auto;
    margin-right: auto;
}

.gallery-image {
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    display: none;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.gallery-image.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    max-width: 500px;
    margin: 0 auto;
    position: sticky;
    bottom: 20px;
    z-index: 10;
}

.gallery-nav {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.gallery-counter {
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* Large Screens - Extra Wide Container */
@media (min-width: 1400px) {
    .projects-overview .container {
        max-width: 1800px;
        padding: 0 60px;
    }

    .projects-layout {
        gap: 56px;
    }

    .filters-sidebar {
        width: 360px;
    }

    .projects-grid {
        gap: 36px;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .page-banner {
        padding: 50px 0 50px;
    }

    .banner-title {
        font-size: 38px;
    }

    .projects-overview .container {
        padding: 0 24px;
    }
    
    .project-type-tabs {
        margin-bottom: 36px;
    }
    
    .type-tab {
        padding: 22px 36px;
        min-width: 160px;
    }

    .projects-layout {
        flex-direction: column;
        gap: 24px;
    }

    .filters-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        display: none;
    }

    .filters-sidebar.active {
        display: block;
    }

    .mobile-filter-toggle {
        display: flex;
    }

    .sidebar-close {
        display: flex;
    }

    .projects-content {
        width: 100%;
    }

    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }

    .project-image {
        height: 240px;
    }
}

@media (max-width: 768px) {
    .page-banner {
        padding: 80px 0 60px;
    }

    .banner-title {
        font-size: 30px;
    }

    .banner-ar {
        font-size: 18px;
    }
    
    .project-type-tabs {
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .type-tab {
        padding: 20px 32px;
        min-width: 150px;
    }
    
    .type-tab i {
        font-size: 28px;
    }
    
    .type-tab span:not(.type-tab-ar) {
        font-size: 18px;
    }
    
    .type-tab-ar {
        font-size: 14px;
    }
    
    .category-title {
        font-size: 24px;
    }
    
    .category-title-ar {
        font-size: 16px;
    }

    .projects-overview {
        padding: 70px 0;
    }

    .projects-overview .container {
        padding: 0 20px;
    }

    .projects-intro {
        margin-bottom: 36px;
    }

    .intro-text,
    .intro-ar {
        font-size: 16px;
    }

    .project-type-tabs {
        gap: 12px;
        margin-bottom: 24px;
    }

    .type-tab {
        padding: 10px 24px;
        font-size: 14px;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 360px;
        height: 100vh;
        z-index: 2000;
        border-radius: 0;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        padding: 32px 24px;
    }

    .filters-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header {
        position: relative;
        background-color: var(--white);
        z-index: 10;
        padding-top: 20px;
        margin-top: -24px;
        padding-left: 24px;
        padding-right: 24px;
        margin-left: -24px;
        margin-right: -24px;
    }

    .mobile-filter-toggle {
        width: 100%;
        justify-content: center;
    }

    /* Mobile sidebar overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

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

    .project-image {
        height: 220px;
    }

    .project-info {
        padding: 20px;
    }

    .project-card h3 {
        font-size: 20px;
    }

    .modal-content {
        padding: 20px 10px;
    }
    
    .modal-gallery {
        min-height: 50vh;
    }
    
    .gallery-image {
        max-height: 70vh;
    }
    
    .gallery-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .modal-title {
        font-size: 28px;
    }

    .gallery-image {
        max-height: 60vh;
    }

    .modal-nav {
        gap: 16px;
        padding: 16px;
    }

    .gallery-nav {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .project-type-tabs {
        flex-direction: column;
        align-items: stretch;
    }

    .type-tab {
        width: 100%;
        justify-content: center;
    }

    .filters-sidebar {
        width: 90%;
        max-width: 300px;
    }

    .filter-option {
        padding: 10px 14px;
        font-size: 13px;
    }

    .sidebar-title {
        font-size: 18px;
    }

    .project-image {
        height: 200px;
    }

    .modal-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 220px;
    }
}
