/* ==========================================================================
   Client List Plugin - Styles with Animation & Pagination
   ========================================================================== */

.clp-clients-wrapper {
    position: relative;
    padding: 20px 50px; /* Space for side arrows */
    overflow: hidden;
}

/* Grid container */
.clp-clients-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Individual client item */
.clp-client-item {
    /* Use CSS variable for dynamic columns, fallback to 6 */
    flex: 0 0 calc(var(--clp-col-width, 16.6667%) - 15px);
    box-sizing: border-box;
    text-align: center;
    padding: 10px;
    /* Visible by default - JS adds animation class */
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* When JS is ready, hide items first then animate */
.clp-clients-wrapper.clp-js-ready .clp-client-item {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
}

.clp-clients-wrapper.clp-js-ready .clp-client-item.clp-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.clp-client-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: grayscale(30%);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.clp-client-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* ============================================
   NAVIGATION - Side Arrows
   ============================================ */
.clp-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, opacity 0.3s ease;
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.clp-nav-arrow:hover {
    background: #c0c0c0;
}

.clp-nav-arrow:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.5;
}

.clp-nav-arrow svg {
    width: 18px;
    height: 18px;
    fill: #666;
}

.clp-nav-arrow:hover svg {
    fill: #333;
}

.clp-nav-arrow:disabled svg {
    fill: #aaa;
}

.clp-prev-arrow {
    left: 0;
}

.clp-next-arrow {
    right: 0;
}

/* ============================================
   PAGINATION - Dots (bottom center)
   ============================================ */
.clp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.clp-pagination-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.clp-pagination-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    min-height: 10px;
    max-width: 10px;
    max-height: 10px;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    background: #d0d0d0;
    border: none;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.clp-pagination-dot:hover {
    background: #a0a0a0;
}

.clp-pagination-dot.clp-active {
    background: #888;
    transform: scale(1.3);
}

.clp-page-info {
    font-size: 12px;
    color: #888;
    margin: 0 8px;
}

/* Hide old button style pagination */
.clp-pagination-btn {
    display: none;
}

/* Page transition container */
.clp-pages-container {
    position: relative;
    overflow: hidden;
    /* Fixed height to prevent layout shift between pages */
    min-height: var(--clp-container-height, 200px);
}

.clp-page {
    display: none;
}

.clp-page.clp-page-active {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start; /* Align items to top */
    gap: 15px;
    min-height: inherit; /* Inherit container height */
}

/* Page transition animations */
.clp-page.clp-page-entering {
    animation: clpSlideIn 0.4s ease forwards;
}

.clp-page.clp-page-leaving {
    animation: clpSlideOut 0.3s ease forwards;
}

@keyframes clpSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes clpSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

/* Responsive - Override column width on smaller screens */
@media (max-width: 1200px) {
    .clp-client-item {
        flex: 0 0 calc(20% - 15px) !important; /* Max 5 columns */
    }
}

@media (max-width: 992px) {
    .clp-client-item {
        flex: 0 0 calc(25% - 15px) !important; /* Max 4 columns */
    }
}

@media (max-width: 768px) {
    .clp-client-item {
        flex: 0 0 calc(33.3333% - 15px) !important; /* Max 3 columns */
    }
    
    .clp-nav-arrow {
        width: 32px;
        height: 32px;
    }
    
    .clp-nav-arrow svg {
        width: 14px;
        height: 14px;
    }
    
    .clp-clients-wrapper {
        padding: 20px 40px;
    }
}

@media (max-width: 480px) {
    .clp-client-item {
        flex: 0 0 calc(50% - 15px) !important; /* Max 2 columns */
    }
    
    .clp-clients-wrapper {
        padding: 15px 35px;
    }
}

/* Legacy class support */
.client-list { padding: 0; margin: 0; }
.client-list .col-clnt-2 { display: inline-block; vertical-align: middle; text-align: center; padding: 8px; }
.client-list .col-clnt-2 img { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.client-list .row.client { display:flex; flex-wrap:wrap; justify-content:center; }
.client-list .col-clnt-2 { flex: 0 0 16.6667%; box-sizing:border-box; }

@media (max-width: 768px) {
  .client-list .col-clnt-2 { flex: 0 0 33.3333%; }
}
