/* ========================================
   Development Projects Page Styles
   ======================================== */

/* Import base styles from advertisements */
@import url('../advertisements/css/style.css');

/* Development Projects Page Specific */
.development-projects-page {
    padding: 40px 0;
    background-color: var(--neutral-50);
}

.development-projects-page .content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

/* Listings Toolbar */
.listings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-md);
}

.view-toggle-group {
    display: flex;
    gap: 4px;
    background-color: var(--neutral-100);
    padding: 4px;
    border-radius: var(--radius-sm);
}

.btn-view-toggle {
    padding: var(--spacing-sm);
    border-radius: 6px;
    background-color: transparent;
    border: none;
    color: var(--neutral-500);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-view-toggle:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--neutral-700);
}

.btn-view-toggle.active {
    background-color: #ffffff;
    color: var(--primary-green);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-view-toggle svg {
    width: 20px;
    height: 20px;
}

.results-count {
    font-size: var(--font-size-base);
    color: var(--neutral-500);
}

/* Projects List */
.projects-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    position: relative;
    transition: grid-template-columns 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                gap 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Grid View (Default) - Already set above */
.projects-list.grid-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: stretch;
    transition: grid-template-columns 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                gap 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Grid View - Card Styling (Similar to Advertisements Grid View) */
.projects-list.grid-view .project-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    height: 100%;
    padding: 0 !important;
    overflow: hidden;
    border-radius: var(--radius-lg);
    gap: 0;
    transition: flex-direction 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.grid-view .project-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.grid-view .project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.projects-list.grid-view .project-body {
    padding: var(--spacing-2xl) var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    flex: 1;
    position: relative;
    transition: padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.grid-view .project-body-content {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 24px;
}

.projects-list.grid-view .project-progress {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin: 0;
    padding: 0;
}

.projects-list.grid-view .project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.projects-list.grid-view .project-price-wrapper {
    margin-bottom: 0;
}

.projects-list.grid-view .project-title {
    margin: 0;
    line-height: 1.4;
}

.projects-list.grid-view .project-location {
    margin-top: 4px;
}


/* List View */
.projects-list.list-view {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    transition: grid-template-columns 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                gap 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.list-view .project-card {
    flex-direction: row-reverse !important;
    align-items: stretch !important;
    min-height: 200px;
    height: auto !important;
    padding: 0 !important;
    gap: 0;
    transition: flex-direction 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.list-view .project-image-wrapper {
    width: 380px !important;
    height: auto !important;
    flex-shrink: 0 !important;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0 !important; /* RTL: Image on Right */
    overflow: hidden !important;
    position: relative;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.list-view .project-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.projects-list.list-view .project-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem 2.5rem !important;
    justify-content: space-between !important;
    transition: padding 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.projects-list.list-view .project-body-content {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 24px;
}

.projects-list.list-view .project-progress {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    margin: 0;
}

.projects-list.list-view .project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}


/* Smooth transition for page changes */
.projects-list.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.projects-list.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Project Link Wrapper */
.project-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-link-wrapper:hover {
    transform: translateY(-4px);
}

.project-link-wrapper:hover .project-card {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Project Card */
.project-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
    cursor: pointer;
    overflow: hidden;
}

.project-card.flex-row-reverse {
    flex-direction: row-reverse;
}

.project-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-lg);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    box-shadow: 0 12px 32px rgba(48, 105, 85, 0.15);
    z-index: -1;
}

.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

.project-card:nth-child(5) {
    animation-delay: 0.5s;
}

.project-card:nth-child(6) {
    animation-delay: 0.6s;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-green);
}

/* Grid View - Hover effect */
.projects-list.grid-view .project-card:hover {
    transform: translateY(-4px);
}

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

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

/* Fade In Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Indicator */
.project-progress {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    margin-left: 8px;
}

.progress-ring {
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}

.progress-ring-circle-bg {
    stroke: #E5E7EB;
    stroke-width: 6;
    fill: transparent;
}

.progress-ring-circle {
    stroke: #306955;
    stroke-width: 6;
    fill: transparent;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    /* stroke-dasharray and stroke-dashoffset are set inline dynamically based on completion percentage */
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--neutral-700);
}

/* Project Info */
.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    padding-right: 16px;
}

/* Grid View - Project Info */
.projects-list.grid-view .project-info {
    position: relative;
    padding: 24px;
    justify-content: space-between;
}

.project-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.currency-symbol {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-green-dark);
}

.project-price-range {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-green);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.project-title {
    font-size: var(--font-size-lg);
    font-weight: 500;
    color: #000929;
    letter-spacing: -0.2px;
    line-height: 1.4;
    margin: 0;
}

.project-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--neutral-600);
    font-size: var(--font-size-base);
    flex-direction: row-reverse;
}

.location-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    flex-shrink: 0;
}

.btn-favorite-project {
    position: absolute;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--neutral-400);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    padding: 0;
    z-index: 10;
}

.btn-favorite-project:hover {
    background-color: #ffffff;
    color: #e74c3c;
    transform: scale(1.1);
}

.btn-favorite-project.active {
    color: #e74c3c;
}

.btn-favorite-project svg {
    width: 24px;
    height: 24px;
}

/* Project Image Wrapper */
.project-image-wrapper {
    position: relative;
    width: 100%;
    height: 220px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--neutral-100);
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

/* Project Body */
.project-body {
    padding: var(--spacing-2xl) var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    flex: 1;
    position: relative;
}

.project-body-content {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 24px;
}

/* Status Badge */
.project-status-badge {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
    width: fit-content;
    min-width: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.project-status-badge.badge-available {
    background-color: rgba(23, 178, 106, 0.15);
    color: var(--success-green);
    border: 1px solid rgba(23, 178, 106, 0.3);
}

.project-status-badge.badge-sold {
    background-color: var(--sold-bg);
    color: var(--sold-gray);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Funded Badge - Ribbon style (exactly like badge-ribbon from advertisements) */
/* Badge Ribbon - Same style as advertisements page */
.project-card .badge-ribbon {
    position: absolute;
    top: calc(50% - 0px); /* Center vertically in the entire card */
    left: -8px; /* Extend outside card */
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: #467e67; /* Green from design */
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    z-index: 20;
    border-radius: 0 4px 4px 0;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
    margin: 0;
    line-height: 1;
    height: fit-content;
}

/* The Fold Effect (Triangle) */
.badge-ribbon::before {
    content: "";
    position: absolute;
    top: -6px; /* Sit on top edge */
    left: 0;
    width: 0;
    height: 0;
    border-bottom: 6px solid #284c3e; /* Darker shade for shadow */
    border-left: 8px solid transparent;
}

.badge-ribbon img {
    width: 14px;
    height: 14px;
}

/* List View - Badge Ribbon positioning (same as advertisements) */
.projects-list.list-view .badge-ribbon {
    top: auto !important;
    bottom: 20px !important;
    left: auto !important;
    right: -8px !important; /* Move to the Image side in RTL */
    border-radius: 4px 0 0 4px !important;
}

.projects-list.list-view .badge-ribbon::before {
    left: auto !important;
    right: 0 !important;
    border-left: 8px solid transparent !important; /* Point inwards from right */
    border-right: 0 !important;
}

/* No Projects */
.no-projects {
    text-align: center;
    padding: 60px 20px;
    color: var(--neutral-600);
    animation: fadeIn 0.5s ease;
}

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

/* Pagination Wrapper */
.pagination-wrapper {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--neutral-200);
    animation: fadeIn 0.5s ease;
}

/* Price Range Slider - Compact Version */
.price-range-slider {
    padding: 12px 0;
}

.slider-inputs-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slider-inputs-compact input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--neutral-700);
    background-color: #ffffff;
    transition: all var(--transition-fast);
    min-width: 0;
}

.slider-inputs-compact input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(48, 105, 85, 0.1);
}

.slider-inputs-compact input::placeholder {
    font-size: 11px;
    color: var(--neutral-400);
}

.slider-inputs-compact .separator {
    color: var(--neutral-400);
    font-weight: 500;
    font-size: 14px;
    flex-shrink: 0;
}

.slider-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.slider-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-input-group label {
    font-size: var(--font-size-sm);
    color: var(--neutral-600);
    font-weight: 500;
}

.slider-input-group input {
    padding: 8px 12px;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
}

.slider-input-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(48, 105, 85, 0.1);
}

.slider-container-box {
    position: relative;
    height: 40px;
    margin: 20px 0;
}

.slider-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--neutral-200);
    border-radius: 2px;
    transform: translateY(-50%);
}

.slider-fill {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: var(--primary-green);
    border-radius: 2px;
    transform: translateY(-50%);
    transition: all var(--transition-base);
}

.range-input {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-green);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
}

.range-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-green);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-base);
}

.range-input::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-sm);
    color: var(--neutral-500);
    margin-top: 8px;
}

/* Responsive */
@media (max-width: 991px) {
    .projects-list.grid-view {
        grid-template-columns: 1fr;
    }
    
    .projects-list.list-view .project-image-wrapper {
        width: 250px !important;
    }
    .development-projects-page .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .listings-section {
        order: 1;
    }

    .project-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-image-wrapper {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 768px) {
    .project-card {
        padding: 16px;
    }

    .project-progress {
        width: 60px;
        height: 60px;
    }

    .progress-ring {
        width: 60px;
        height: 60px;
    }

    .progress-percentage {
        font-size: var(--font-size-sm);
    }

    .project-title {
        font-size: var(--font-size-lg);
    }

    .slider-inputs {
        grid-template-columns: 1fr;
    }
}

