/* =========================================
   MY PORTFOLIO TABS - FRONTEND STYLES (V5)
   Fix: Font Sizes (Desc & Btn), Mobile Layout
========================================= */

.my-portfolio-container {
    width: 100%;
    /* TĂNG PADDING TOP: 60px để chừa chỗ cho khối bay lên không bị cắt */
    padding: 60px 10px 60px 10px; 
    margin-bottom: 50px;
    position: relative;
    box-sizing: border-box;
    display: block;
    
    /* QUAN TRỌNG: Bắt buộc hiển thị phần tử tràn ra ngoài */
    overflow: visible !important; 
    
    /* Thiết lập biến mặc định */
    --mp-title-size: 22px;
    --mp-desc-size: 16px;
    --mp-title-color: #111;
    --mp-hover-color: #2271b1;
}

.my-portfolio-container * {
    box-sizing: border-box;
}

/* --- CARD ITEM --- */
.my-portfolio-card {
    position: relative;
    display: block;
    width: 100%;
    z-index: 1; 
    perspective: 1000px;
    transition: z-index 0s linear 0.4s; 
}

/* Khi hover: Đưa z-index lên cao nhất để đè lên mọi thứ xung quanh */
.my-portfolio-card:hover {
    z-index: 9999; 
    transition-delay: 0s;
}

/* --- KHUNG ẢNH --- */
.mp-image {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 25px; 
    background: #f0f0f0;
    box-shadow: 0 15px 35px -10px rgba(0,0,0,0.08);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateZ(0); 
    -webkit-backface-visibility: hidden;
    
    /* Đảm bảo ảnh nằm gọn trong khung */
    width: 100%; 
}

.mp-image-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* --- ẢNH --- */
.mp-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 24px; 
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- NÚT BẤM NỔI --- */
.mp-floating-btn {
    position: absolute;
    bottom: 25px;
    right: 25px;
    z-index: 10;
    background: #ffffff;
    color: #111;
    padding: 12px 24px 12px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    transition: all 0.4s ease;
    transform: translateY(0);
}

.mp-btn-icon {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

/* --- HIỆU ỨNG HOVER --- */
.my-portfolio-card:hover .mp-image {
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.2);
    /* Bay lên cao */
    transform: translateY(-10px); 
}

.my-portfolio-card:hover .mp-image img {
    transform: scale(1.08); 
}

.my-portfolio-card:hover .mp-floating-btn {
    background: #111; 
    color: #fff;
    padding-right: 20px;
}

.my-portfolio-card:hover .mp-btn-icon {
    transform: translateX(5px);
}

/* --- TEXT CONTENT --- */
.mp-content {
    padding: 5px 10px;
}

.mp-title {
    font-size: var(--mp-title-size);
    color: var(--mp-title-color);
    font-weight: 800;
    margin: 0 0 15px 0;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.my-portfolio-card:hover .mp-title {
    color: var(--mp-hover-color);
}

.mp-desc {
    font-size: var(--mp-desc-size);
    color: #666;
    line-height: 1.7;
    font-weight: 400;
}
.mp-desc p:last-child { margin-bottom: 0; }

/* --- RESPONSIVE & LAYOUT LOGIC --- */

/* 1. DESKTOP (Masonry Layout) */
@media (min-width: 768px) {
    .my-portfolio-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 120px; 
        align-items: flex-start;
        width: 100% !important;
    }
    
    .mp-column {
        flex: 1; 
        display: flex;
        flex-direction: column;
        gap: 100px; 
    }
    
    .mp-column-right { 
        margin-top: 180px; 
    }
    
    .my-portfolio-item { 
        width: 100% !important; 
        height: auto !important; 
        margin: 0 !important; 
    }
    
    .swiper-pagination { display: none !important; }
    
    /* Ẩn nút mũi tên navigation trên desktop */
    .mp-nav-btn { display: none !important; }
}

/* 2. MOBILE (Carousel Layout) - NÂNG CẤP V5 */
@media (max-width: 767px) {
    .my-portfolio-container { padding: 40px 0 50px 0; }
    .mp-column-right { margin-top: 0; }
    
    .mp-image, .mp-image img { border-radius: 20px; }
    
    /* === FIX: Nút bấm nhỏ lại === */
    .mp-floating-btn {
        padding: 8px 16px; /* Giảm padding cho gọn */
        bottom: 15px;
        right: 15px;
        font-size: 11px !important; /* Text nhỏ lại (gốc 12-14px) */
        gap: 6px;
    }
    /* Icon trong nút cũng nhỏ theo */
    .mp-btn-icon {
        font-size: 14px !important;
        width: 14px !important;
        height: 14px !important;
    }

    /* Style cho Card khi hiển thị dạng Carousel */
    .my-portfolio-item.swiper-slide {
        width: 85% !important; 
        opacity: 0.4;
        transition: opacity 0.3s ease;
    }
    .my-portfolio-item.swiper-slide-active {
        opacity: 1;
    }

    /* Ẩn Pagination (Dấu chấm) */
    .swiper-pagination { display: none !important; }

    /* Style Nút Mũi Tên Navigation (Tròn, trắng) */
    .mp-nav-btn {
        width: 44px !important;
        height: 44px !important;
        background-color: #ffffff;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        color: #111;
        transition: all 0.3s ease;
        z-index: 50; 
    }
    .mp-nav-btn:after { font-size: 18px !important; font-weight: bold; }
    
    /* Vị trí nút mũi tên sát lề */
    .swiper-button-prev { left: 5px !important; }
    .swiper-button-next { right: 5px !important; }
    .swiper-button-disabled { opacity: 0 !important; pointer-events: none; }

    /* Xử lý Tiêu đề: Giảm size và cắt dòng */
    .mp-title { 
        font-size: 18px !important; 
        margin-bottom: 10px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        height: auto;
    }
    
    /* === FIX: Giảm size Text Mô Tả === */
    .mp-desc {
        font-size: 14px !important; /* Nhỏ hơn desktop (16px) */
        line-height: 1.5;
    }
    
    .mp-content {
        padding: 0 5px 15px 5px;
    }
}