/* ProfileSearch Plugin Styles */

/* Container */
.profileslist-container {
    max-width: 90%;
    margin: 40px auto;
    padding: 0 15px;
    position: relative;
    z-index: 1;
}

/* List view */
.profileslist-list-view {
    display: block !important;
}

/* Profile item */
.profileslist-container .profileslist-item {
    display: flex !important;
    align-items: center;
    margin-bottom: 20px;
    padding: 2vw;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
    opacity: 0;
    transform: translateY(30px);
    position: relative;
    z-index: 2;
    background: #F7FAFC;
    border: 1px solid #CBD5E0;
    border-radius: 10px;
    cursor: pointer; /* Indicates clickability */
}

/* Hover effect */
body .profileslist-container .profileslist-item:hover,
body .profileslist-container .profileslist-item.profileslist-hover {
    transform: scale(1.03) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
}

/* Image */
.profileslist-image {
    flex: 0 0 15vw;
    margin-right: 2vw;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.profileslist-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 15vw;
    transition: transform 0.4s ease !important;
}

.profileslist-image:hover img {
    transform: scale(1.05) !important;
}

/* Image hover overlay */
.profileslist-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease !important;
}

.profileslist-image:hover::after {
    opacity: 1 !important;
}

/* Content */
.profileslist-content {
    flex: 1;
}

/* Title */
.profileslist-title {
    font-family: "ALLAGESDEMO";
    font-size: clamp(1.2rem, 2vw, 2rem);
    margin: 0 0 10px;
    font-weight: 600;
}

/* Description */
.profileslist-desc {
    font-family: "LibrevilleFree", sans-serif;
    font-size: INHERIT;
    line-height: 1.5;
    margin: 0 0 15px;
}

/* More Details button */
.profileslist-more-details {
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    font-weight: 500;
    line-height: 1.5;
    min-height: 44px; /* Consistent height */
    min-width: 120px; /* Consistent width */
    transition: background-color 0.3s ease, transform 0.3s ease !important;
    background: #1DA1F2;
    color: #FFFFFF;
}

.profileslist-more-details:hover {
    background: #63B3ED !important;
    transform: scale(1.05) !important;
}

/* Modal */
/* Ensure modal is hidden by default and only shown with 'active' class */
#profileslist-modal {
    display: none; /* Modal hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    overflow-y: auto;
}

#profileslist-modal.active {
    display: flex; /* Show modal when active */
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.profileslist-modal-content {
    background: #FFFFFF;
    margin: auto;
    padding: 2vw;
    max-width: 80vw;
    width: 90%;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

#profileslist-modal.active .profileslist-modal-content {
    transform: translateY(0);
    opacity: 1;
}

/* Scrollbar */
.profileslist-modal-content::-webkit-scrollbar {
    width: 8px;
}

.profileslist-modal-content::-webkit-scrollbar-track {
    background: #F1F1F1;
    border-radius: 4px;
}

.profileslist-modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.profileslist-modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal header */
.profileslist-modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 15px;
}

.profileslist-modal-image {
    flex: 0 0 10vw;
    margin-right: 1vw;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.profileslist-modal-image img {
    width: 100%;
    height: 10vw;
    object-fit: cover;
    transition: transform 0.4s ease;
    aspect-ratio: 1 / 1;
}

.profileslist-modal-image:hover img {
    transform: scale(1.05);
}

.profileslist-modal-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.profileslist-modal-image:hover::after {
    opacity: 1;
}

/* Modal title */
.profileslist-modal-title {
    font-family: inherit;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    color: #1A202C;
    margin: 0;
    flex: 1;
    font-weight: 700;
}

/* Modal tabs */
.profileslist-tabs {
    display: flex;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.profileslist-tab {
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: 500;
    color: #4A5568;
    transition: color 0.3s ease, border-bottom 0.3s ease;
    border-bottom: 2px solid transparent;
}

.profileslist-tab:hover {
    color: #1DA1F2;
}

.profileslist-tab.active {
    color: #1DA1F2;
    border-bottom: 2px solid #1DA1F2;
}

.profileslist-tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profileslist-tab-content.active {
    display: flex;
    opacity: 1;
}

/* Modal body */
.profileslist-modal-body {
    font-family: inherit;
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    color: #4A5568;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Modal status */
.profileslist-modal-status {
    font-family: inherit;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #718096;
    margin-bottom: 15px;
    font-style: italic;
}

/* Modal close button */
.profileslist-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #4A5568;
    width: 36px;
    height: 36px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    transition: background 0.3s ease, color 0.3s ease;
}

.profileslist-modal-close:hover {
    background: #E53E3E !important;
    color: #FFFFFF !important;
}

/* Thumbnails */
.profileslist-modal-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.profileslist-modal-thumbnail {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.profileslist-modal-thumbnail:hover {
    transform: scale(1.05);
}

.profileslist-modal-thumbnail img,
.profileslist-modal-thumbnail video {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    aspect-ratio: 1 / 1;
}

.profileslist-modal-thumbnail:hover img,
.profileslist-modal-thumbnail:hover video {
    transform: scale(1.05);
}

.profileslist-modal-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profileslist-modal-thumbnail:hover::after {
    opacity: 1;
}

/* Full view modal */
#profileslist-modal-full {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

#profileslist-modal-full.active {
    display: flex; /* Show when active */
}

.profileslist-modal-full-container {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
}

.profileslist-modal-full-content {
    max-width: 100%;
    max-height: 90vh;
    overflow: hidden;
}

.profileslist-modal-full-content img,
.profileslist-modal-full-content video,
.profileslist-modal-full-content iframe {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

/* Full view close button */
.profileslist-modal-full-close {
    position: absolute;
    top: -40px;
    right: -40px;
    font-size: 24px;
    color: #FFFFFF;
    background: #E53E3E;
    width: 36px;
    height: 36px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.profileslist-modal-full-close:hover {
    background: #C53030 !important;
}

/* Navigation buttons */
.profileslist-modal-full-prev,
.profileslist-modal-full-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #FFFFFF;
    font-size: 24px;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: none;
}

.profileslist-modal-full-prev.active,
.profileslist-modal-full-next.active {
    display: block;
}

.profileslist-modal-full-prev {
    left: -50px;
}

.profileslist-modal-full-next {
    right: -50px;
}

.profileslist-modal-full-prev:hover,
.profileslist-modal-full-next:hover {
    background: rgba(0, 0, 0, 0.9) !important;
}

/* Responsive Design */
@media (max-width: 1440px) {
    .profileslist-image {
        flex: 0 0 18vw;
    }
    .profileslist-image img {
        max-height: 18vw;
    }
    .profileslist-modal-content {
        max-width: 85vw;
        padding: 3vw;
    }
    .profileslist-modal-image {
        flex: 0 0 12vw;
    }
    .profileslist-modal-image img {
        height: 12vw;
    }
}

@media (max-width: 1024px) {
    .profileslist-container .profileslist-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 3vw;
    }
    .profileslist-image {
        margin-right: 0;
        margin-bottom: 2vw;
        flex: 0 0 auto;
        width: 100%;
        max-width: 35vw;
    }
    .profileslist-image img {
        max-height: 25vw;
    }
    .profileslist-modal-content {
        max-width: 90vw;
        padding: 3vw;
    }
    .profileslist-modal-full-close {
        top: -30px;
        right: 0;
    }
    .profileslist-modal-full-prev {
        left: -40px;
    }
    .profileslist-modal-full-next {
        right: -40px;
    }
}

@media (max-width: 768px) {
    .profileslist-container .profileslist-item {
        padding: 4vw;
    }
    .profileslist-image {
        max-width: 40vw;
    }
    .profileslist-image img {
        max-height: 30vw;
    }
    .profileslist-modal-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .profileslist-modal-image {
        margin-right: 0;
        margin-bottom: 3vw;
        width: 100%;
        max-width: 40vw;
    }
    .profileslist-modal-image img {
        height: 40vw;
        max-height: 150px;
    }
    .profileslist-modal-title {
        font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    }
    .profileslist-modal-body {
        font-size: clamp(0.8rem, 2vw, 0.9rem);
    }
    .profileslist-modal-status {
        font-size: clamp(0.85rem, 2vw, 1rem);
    }
    .profileslist-modal-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 10px;
    }
    .profileslist-modal-thumbnail img,
    .profileslist-modal-thumbnail video {
        height: 70px;
        max-height: 70px;
    }
    .profileslist-modal-content {
        padding: 4vw;
        max-width: 95vw;
        max-height: 90vh;
    }
    .profileslist-modal-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 20px;
    }
    .profileslist-title {
        font-size: clamp(1rem, 2.5vw, 1.4rem);
    }
    .profileslist-desc {
        font-size: clamp(0.75rem, 2vw, 0.9rem);
    }
    .profileslist-more-details {
        padding: 0.65rem 1.3rem;
        font-size: clamp(0.75rem, 2vw, 0.9rem);
        min-height: 40px;
        min-width: 100px;
        width: 100%;
        max-width: 200px;
    }
    .profileslist-tabs {
        flex-wrap: wrap;
    }
    .profileslist-tab {
        font-size: clamp(0.85rem, 2vw, 1rem);
        padding: 8px 15px;
    }
}

@media (max-width: 480px) {
    .profileslist-container {
        margin: 20px auto;
        padding: 0 10px;
    }
    .profileslist-container .profileslist-item {
        margin-bottom: 15px;
        padding: 5vw;
    }
    .profileslist-image {
        max-width: 100%;
    }
    .profileslist-image img {
        max-height: 40vw;
    }
    .profileslist-title {
        font-size: clamp(0.9rem, 3vw, 1.2rem);
    }
    .profileslist-desc {
        font-size: clamp(0.7rem, 2.5vw, 0.85rem);
        margin-bottom: 10px;
    }
    .profileslist-more-details {
        padding: 0.5rem 1rem;
        font-size: clamp(0.7rem, 2.5vw, 0.85rem);
        min-height: 40px;
        min-width: 90px;
        width: 100%;
        max-width: 180px;
        text-align: center;
    }
    .profileslist-modal-content {
        padding: 5vw;
        max-height: 95vh;
    }
    .profileslist-modal-image {
        max-width: 50vw;
    }
    .profileslist-modal-image img {
        height: 50vw;
        max-height: 120px;
    }
    .profileslist-modal-title {
        font-size: clamp(1rem, 3vw, 1.4rem);
    }
    .profileslist-modal-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 8px;
    }
    .profileslist-modal-thumbnail img,
    .profileslist-modal-thumbnail video {
        height: 60px;
        max-height: 60px;
    }
    .profileslist-modal-full-close {
        top: -25px;
        right: 0;
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 18px;
    }
    .profileslist-modal-full-prev,
    .profileslist-modal-full-next {
        width: 30px;
        height: 30px;
        line-height: 30px;
        font-size: 18px;
    }
    .profileslist-modal-full-prev {
        left: -30px;
    }
    .profileslist-modal-full-next {
        right: -30px;
    }
}

@media (max-width: 320px) {
    .profileslist-container .profileslist-item {
        padding: 6vw;
    }
    .profileslist-image {
        max-width: 100%;
    }
    .profileslist-image img {
        max-height: 50vw;
    }
    .profileslist-more-details {
        padding: 0.4rem 0.8rem;
        font-size: clamp(0.65rem, 3vw, 0.8rem);
        min-width: 80px;
        max-width: 150px;
    }
    .profileslist-modal-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 6px;
    }
    .profileslist-modal-thumbnail img,
    .profileslist-modal-thumbnail video {
        height: 50px;
        max-height: 50px;
    }
}

@media (min-width: 2560px) {
    .profileslist-container {
        max-width: 80%;
    }
    .profileslist-image {
        flex: 0 0 12vw;
    }
    .profileslist-image img {
        max-height: 12vw;
    }
    .profileslist-modal-content {
        max-width: 70vw;
        padding: 1.5vw;
    }
    .profileslist-modal-image {
        flex: 0 0 8vw;
    }
    .profileslist-modal-image img {
        height: 8vw;
    }
    .profileslist-modal-thumbnails {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }
    .profileslist-modal-thumbnail img,
    .profileslist-modal-thumbnail video {
        height: 100px;
    }
}

/* Ensure animations are not blocked */
.profileslist-container .profileslist-item,
.profileslist-image,
.profileslist-modal-thumbnail,
.profileslist-more-details,
.profileslist-modal-close,
.profileslist-modal-full-close,
.profileslist-modal-full-prev,
.profileslist-modal-full-next {
    will-change: transform, opacity, box-shadow, background;
}

/* Fallback for no-js environments */
.no-js .profileslist-container .profileslist-item {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Video placeholder for thumbnails */
.video-placeholder {
    background: #2D3748;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    text-align: center;
    border-radius: 8px;
}

/* Accessibility */
.profileslist-more-details:focus,
.profileslist-modal-close:focus,
.profileslist-modal-full-close:focus,
.profileslist-modal-full-prev:focus,
.profileslist-modal-full-next:focus {
    outline: 2px solid #3182CE;
    outline-offset: 2px;
}

/* Prevent layout shifts */
.profileslist-container .profileslist-item,
.profileslist-modal-content,
.profileslist-modal-full-content {
    contain: content;
}