@import "../../../../styles/variables.scss";

.suggestedBlogsContainer {
    width: 100%;
    max-height: calc(100vh - 90px);
    border: 1px solid $dark-skin-color;
    border-radius: 20px !important;
    overflow-y: auto;
    background-color: $white;
    padding: 24px 16px;
    position: relative;

    @media (min-width: 1000px) and (max-width: 1800px) {
        max-height: 132vh;
    }

    &::-webkit-scrollbar {
        width: 0px;
    }


    .sectionHeader {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
        padding: 0 8px;

        h5 {
            font-size: 22px;
            font-weight: 700;
            color: $dark-color;
            margin: 0;
            position: relative;
            padding-left: 12px;

            &::before {
                content: '';
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                width: 4px;
                height: 24px;
                background: linear-gradient(180deg, $skin-color 0%, $dark-skin-color 100%);
                border-radius: 2px;
            }
        }
    }

    .blogsList {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 0 8px;

        @media (max-width: 768px) {
            gap: 12px;
        }
    }

    .emptyState {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 40px 20px;
        text-align: center;
        color: $grey;

        p {
            margin: 0;
            font-size: 16px;
            color: $grey2;
        }
    }
}

// Blog Card Styles
.blogCard {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: $white;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);

    &:hover {
        // transform: translateY(-4px);
        // box-shadow: 0 8px 24px rgba(188, 153, 111, 0.15);
        border-color: $skin-color;

        .blogImage {
            transform: scale(1.05);
        }

        .blogOverlay {
            opacity: 1;
        }

        .blogTitle {
            color: $dark-skin-color;
        }
    }

    .blogImageWrapper {
        position: relative;
        width: 100%;
        overflow: hidden;
        border-radius: 16px 16px 0 0;
        background: linear-gradient(135deg, $brownLight 0%, $white 100%);
    }

    .blogImage {
        width: 100%;
        height: 200px;
        object-fit: cover;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 16px 16px 0 0;

        @media (max-width: 768px) {
            height: 180px;
        }
    }

    .blogOverlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(to bottom,
                rgba(0, 0, 0, 0) 0%,
                rgba(0, 0, 0, 0.3) 100%);
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: 16px 16px 0 0;
    }

    .blogContent {
        padding: 16px;
        background: $white;

        .blogTitle {
            font-size: 16px;
            font-weight: 600;
            color: $dark-color;
            margin: 0;
            line-height: 1.4;
            transition: color 0.3s ease;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
            min-height: 44px;

            @media (max-width: 768px) {
                font-size: 14px;
                min-height: 40px;
            }
        }
    }
}

// Video Card Styles
.videoCard {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: $white;
    border: 1px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    gap: 12px;
    padding: 12px;

    &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(188, 153, 111, 0.15);
        border-color: $skin-color;

        .videoThumbnail {
            transform: scale(1.05);
        }

        .playIcon {
            transform: translate(-50%, -50%) scale(1.1);
        }

        .videoTitle {
            color: $dark-skin-color;
        }
    }

    .videoThumbnailWrapper {
        position: relative;
        flex-shrink: 0;
        width: 120px;
        height: 80px;
        border-radius: 12px;
        overflow: hidden;
        background: linear-gradient(135deg, $brownLight 0%, $white 100%);

        @media (max-width: 768px) {
            width: 100px;
            height: 70px;
        }
    }

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

    .videoOverlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.2);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .playIcon {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.3s ease;
        z-index: 10;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);

        img {
            width: 16px;
            height: 16px;
            margin-left: 2px;
        }
    }

    .videoContent {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;

        .videoTitle {
            font-size: 15px;
            font-weight: 600;
            color: $dark-color;
            margin: 0 0 8px 0;
            line-height: 1.4;
            transition: color 0.3s ease;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;

            @media (max-width: 768px) {
                font-size: 14px;
            }
        }

        .videoDescription {
            font-size: 13px;
            color: $grey2;
            margin: 0;
            line-height: 1.5;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;

            @media (max-width: 768px) {
                font-size: 12px;
            }
        }
    }
}

// Loading State
.loadingContainer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    min-height: 200px;
}

// Animation for cards appearing
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blogCard,
.videoCard {
    animation: fadeInUp 0.5s ease-out;

    @for $i from 1 through 10 {
        &:nth-child(#{$i}) {
            animation-delay: #{$i * 0.1}s;
        }
    }
}