/* Compact Project Card Styles */
.compact-project-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #eef2f6;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.compact-project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* Image Container - Fixed aspect ratio for all screens */
.project-image-wrapper {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    padding: 2px;
    width: 100%;
    /* Aspect ratio 16:9 for desktop */
    aspect-ratio: 16 / 9;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 10px;
}

.compact-project-card:hover .project-image {
    transform: scale(1.05);
}

/* Content Area with reduced spacing */
.project-content {
    padding: 8px 15px 12px 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Category above title - reduced spacing */
.project-category {
    color: #667eea;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Title with reduced spacing */
.project-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: #2d3748;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 42px;
}

.project-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: break-word;
}

.project-title a:hover {
    color: #667eea;
}

/* Rating with reduced spacing */
.project-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f6;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.single-star {
    color: #fbbf24;
    font-size: 14px;
}

.rating-text {
    font-size: 12px;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer with reduced spacing - FIXED for long names */
.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

/* Wrapper for avatar and online dot - FIXED to not shrink */
.author-avatar-wrapper {
    position: relative;
    display: flex;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.author-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #eef2f6;
    flex-shrink: 0;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    border-radius: 50%; /* Add this to make it round */
}

/* Online dot - positioned COMPLETELY outside */
.online-dot {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.offline-dot {
    position: absolute;
    bottom: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background-color: #d3d3d3;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Author name - FIXED to truncate instead of shrinking avatar */
.author-name {
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

/* Price in one line */
.project-price {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-align: right;
}

.price-line {
    font-size: 13px;
    color: #4a5568;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.price-amount {
    font-size: 16px;
    font-weight: 800;
    color: #2d3748;
    line-height: 1;
}

/* Project Image Slider Styles */
.project-image-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    width: 100%;
    height: 100%;
}

.project-slick-slider {
    position: relative;
    height: 100%;
}

.slider-item {
    width: 100%;
    height: 100%;
    display: none;
}

.slider-item.active {
    display: block;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.slider-item:hover img {
    transform: scale(1.05);
}

.slider-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 4px;
    z-index: 2;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background-color: #fff;
    transform: scale(1.2);
}

.slider-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: all 0.3s ease;
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.project-image-slider:hover .slider-arrow {
    opacity: 1;
}

.slider-arrow:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Image counter badge */
.image-counter-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

.image-counter-badge i {
    font-size: 10px;
}

/* Responsive Design */

/* Large tablets and small desktops */
@media (max-width: 1199px) {
    .project-image-wrapper {
        aspect-ratio: 16 / 9;
    }
    
    .project-content {
        padding: 6px 12px 10px 12px;
    }
    
    .project-title {
        font-size: 15px;
        min-height: 38px;
        margin-bottom: 6px;
    }
}

/* Tablets */
@media (max-width: 991px) {
    .project-image-wrapper {
        aspect-ratio: auto;
    }
    
    .project-content {
        padding: 6px 10px 8px 10px;
    }
    
    .project-title {
        font-size: 15px;
        min-height: 36px;
    }
    
    .project-category {
        font-size: 11px;
    }
    
    .price-amount {
        font-size: 15px;
    }
    
    .author-avatar-wrapper {
        width: 30px;
        height: 30px;
    }
    
    .slider-arrow {
        opacity: 1;
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .image-counter-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Large mobile devices */
@media (max-width: 767px) {
    .project-image-wrapper {
        aspect-ratio: auto;
    }
    
    .project-title {
        font-size: 14px;
        min-height: 34px;
        margin-bottom: 6px;
    }
    
    .project-rating {
        padding-bottom: 6px;
    }
    
    .author-info {
        gap: 6px;
    }
    
    .author-avatar-wrapper {
        width: 28px;
        height: 28px;
    }
    
    .author-name {
        font-size: 12px;
    }
    
    .price-line {
        font-size: 12px;
    }
    
    .price-amount {
        font-size: 14px;
    }
    
    .project-category {
        font-size: 10px;
        margin-bottom: 2px;
    }
    
    .online-dot,
    .offline-dot {
        width: 10px;
        height: 10px;
        bottom: -2px;
        right: -2px;
        border-width: 1.5px;
    }
}

/* Small mobile devices */
@media (max-width: 575px) {
    .project-image-wrapper {
        aspect-ratio: auto;
    }
    
    .project-image {
        border-radius: 6px;
        max-height: 202px;
    }
    
    .project-content {
        padding: 4px 8px 6px 8px;
    }
    
    .project-category {
        font-size: 10px;
    }
    
    .project-footer {
        margin-top: 6px;
        gap: 6px;
    }
    
    .price-line {
        font-size: 11px;
    }
    
    .author-avatar-wrapper {
        width: 26px;
        height: 26px;
    }
    
    .avatar-initial {
        font-size: 12px;
    }
    
    .online-dot,
    .offline-dot {
        width: 9px;
        height: 9px;
        bottom: -2px;
        right: -2px;
        border-width: 1.5px;
    }
    
    .slider-arrow {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }
    
    .slider-dots {
        bottom: 8px;
    }
    
    .slider-dot {
        width: 5px;
        height: 5px;
    }
}

/* Extra small mobile devices */
@media (max-width: 399px) {
    .project-image-wrapper {
        aspect-ratio:auto;
        /* height: 200px; */
    }
    
    .project-title {
        font-size: 13px;
        min-height: 32px;
        -webkit-line-clamp: 3;
    }
    
    .rating-text {
        font-size: 11px;
    }
    
    .project-footer {
        gap: 4px;
    }
    
    .author-info {
        width: 100%;
    }
    
    .author-avatar-wrapper {
        width: 24px;
        height: 24px;
    }
    
    .online-dot,
    .offline-dot {
        width: 8px;
        height: 8px;
        bottom: -1px;
        right: -1px;
        border-width: 1.5px;
    }
    
    .price-line {
        font-size: 10px;
        align-self: flex-end;
    }
    
    .price-amount {
        font-size: 13px;
    }
    
    .slider-arrow {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
    .project-image-wrapper {
        height: 0;
        padding-top: 56.25%; /* 16:9 aspect ratio fallback */
    }
    
    .project-image-slider {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
    
    @media (max-width: 991px) {
        .project-image-wrapper {
            /* padding-top: 75%; 4:3 for tablets */
        }
    }
    
    @media (max-width: 575px) {
        .project-image-wrapper {
            padding-top: 75%; /* 4:3 for mobile */
        }
    }
    
    @media (max-width: 399px) {
        .project-image-wrapper {
            /* padding-top: 66.67%; 3:2 for extra small */
        }
    }
}

/* Ensure grid columns display properly */
.row {
    display: flex;
    flex-wrap: wrap;
}

/* Make columns flex containers for equal card heights */
.col-xxl-4, .col-lg-3, .col-md-6, .col-sm-6 {
    /* display: flex; */
}

/* If using Bootstrap, ensure proper card alignment */
.d-flex > .compact-project-card {
    flex: 1;
    width: 100%;
}