/* ===================================
   PECB-Style Client Directory
   =================================== */

:root {
    --pecb-primary: #005eb8;
    --pecb-secondary: #6c757d;
    --pecb-border: #e0e0e0;
    --pecb-text: #333;
    --pecb-light-bg: #f8f9fa;
}

/* ===================================
   Search Container & Form
   =================================== */
.pcc-search-container {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.pcc-search-form .search-row {
    display: grid;
    gap: 20px;
    align-items: flex-end; /* Align inputs and buttons at the bottom */
}

/* Custom Widths for Desktop Search Form */
@media (min-width: 1024px) {
    .pcc-search-form .search-row {
        /* 1. Name/ID: 2 parts
           2. Country: 1 part
           3. Standard: 1 part
           4. Certification: 3 parts
           5. Buttons: auto 
        */
        grid-template-columns: 2fr 1fr 1fr 3fr auto; 
    }
}

.search-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--pecb-text);
    font-size: 16px; /* Bigger labels */
}

.search-field .form-control,
.search-field .form-select {
    width: 100%;
    /*padding: 10px 15px;*/
    height: 48px; /* Taller inputs */
    border: 1px solid var(--pecb-border);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s ease;
    --bs-form-select-bg-img: none;
}

.search-field .form-control:focus,
.search-field .form-select:focus {
    border-color: var(--pecb-primary);
    box-shadow: 0 0 0 3px rgba(0, 94, 184, 0.1);
    outline: none;
}

/* ===================================
   Custom Pretty Buttons
   =================================== */
.search-actions {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.search-actions .btn {
    height: 48px;
    padding: 0 35px;
    font-weight: 700;
    border-radius: 25px; /* Pill shape */
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Primary "Search" Button - Gradient & Shadow */
.search-actions .btn-primary {
    background: linear-gradient(135deg, var(--pecb-primary) 0%, #003d7a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 94, 184, 0.25);
}

.search-actions .btn-primary:hover {
    background: linear-gradient(135deg, #004a94 0%, #001f3f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 94, 184, 0.4);
}

/* Secondary "Reset" Button */
.search-actions .btn-secondary {
    background: #fff;
    color: var(--pecb-secondary);
    border: 2px solid var(--pecb-border);
}

.search-actions .btn-secondary:hover {
    background: var(--pecb-light-bg);
    color: #333;
    border-color: #adb5bd;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

#pcc-loading {
    text-align: center;
    padding: 20px;
    color: var(--pecb-primary);
}

#pcc-loading .spinner-border {
    margin-right: 10px;
}

/* ===================================
   Clients Grid - 2 CARDS PER ROW
   =================================== */
.pcc-clients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 items per row */
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 40px;
}

/* ===================================
   PECB Trainer Card - SIDE BY SIDE
   =================================== */
.pecb-trainer-card {
    width: 100%;
    background: #fff;
    border: 1px solid var(--pecb-border);
    border-radius: 12px; /* Soft, modern corners */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: row; /* Places .title and .other side by side */
    height: 100%; /* Stretches cards to equal height */
}

.pecb-trainer-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 94, 184, 0.12);
}

/* --- Left Section (Title, Image, Socials) --- */
.pecb-trainer-card .title {
    flex: 0 0 37%; /* Left side takes up 45% of the card width */
    padding: 25px 20px;
    background: linear-gradient(180deg, #f4f9fd 0%, #ffffff 100%); /* Elegant gradient */
    border-right: 1px solid var(--pecb-border); /* Vertical Divider line */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.pecb-trainer-card .title-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* --- Beautiful Profile Image (Handles ANY large image size flawlessly) --- */
.pecb-trainer-card .profile-placeholder {
    width: 110px; 
    height: 110px;
    /*border-radius: 50%;*/ /* Perfect Circle */
    overflow: hidden;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 6px 18px rgba(0, 94, 184, 0.2); /* Soft blue shadow */
    margin-bottom: 15px;
    flex-shrink: 0;
    position: relative;
}

.pecb-trainer-card .profile-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes sure big images resize & crop without stretching! */
    object-position: top center; /* Prioritizes faces/top of the photo */
    transition: transform 0.5s ease;
}

/* Subtle image zoom on card hover */
.pecb-trainer-card:hover .profile-placeholder img {
    transform: scale(1.08); 
}

/* Typography */
.pecb-trainer-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pecb-text);
}

.pecb-trainer-card .level {
    margin: 0;
    font-size: 0.95rem;
    color: var(--pecb-primary);
    font-weight: 600;
}

.pecb-trainer-card hr {
    display: none; /* Hide standard horizontal rules */
}

/* Location & Social Icons Centering */
.pecb-trainer-card .trainer-location {
    text-align: center;
    width: 100%;
    margin-top: 15px;
}

.pecb-trainer-card .trainer-location .country {
    margin: 0 0 0px 0;
    font-size: 0.95rem;
    color: var(--pecb-text);
}

.pecb-trainer-card .trainer-location .country span,
.pecb-trainer-card .connect-label span {
    font-weight: 700;
    display: inline-block;
    margin-right: 5px;
}

.pecb-trainer-card .connect-label {
    margin: 10px 0 8px 0;
    font-size: 0.95rem;
    color: var(--pecb-text);
    display: none; /* Hide the word 'Connect:' to save space */
}

.social-icons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center; /* Centers icons perfectly */
    margin-top: 5px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.social-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    color: #fff;
}

.social-icon.facebook { background: #1877f2; }
.social-icon.linkedin { background: #0a66c2; }
.social-icon.whatsapp { background: #25d366; }
.social-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* --- Right Section (Standards & Certifications) --- */
.pecb-trainer-card .other {
    flex: 1; /* Takes the remaining 55% of the card */
    padding: 25px 20px;
    /*display: flex;*/
    flex-direction: column;
    justify-content: center; /* Vertically center tags */
    background: #fff;
    gap: 15px;
}

.pecb-trainer-card .label {
    font-weight: 700;
    color: var(--pecb-text);
    font-size: 0.95rem;
}

.pecb-trainer-card .portfolio-tags,
.pecb-trainer-card .certified-courses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pecb-trainer-card .portfolio-tag {
    background: var(--pecb-primary);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.pecb-trainer-card .certified-course-tag {
    background: #e8f4fd;
    color: var(--pecb-primary);
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #c6e3f7;
}

.pecb-trainer-card .counter-btn {
    background: var(--pecb-primary);
    color: #fff;
    border: none;
    padding: 0px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.pecb-trainer-card .counter-btn:hover {
    background: #004a94;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 94, 184, 0.3);
}

/* ===================================
   Pagination Styles
   =================================== */
.pcc-pagination {
    margin-top: 50px;
    margin-bottom: 30px;
}

.pcc-pagination .pagination {
    gap: 8px;
}

.pcc-pagination .page-item .page-link {
    color: var(--pecb-text);
    border: 1px solid var(--pecb-border);
    border-radius: 6px;
    padding: 10px 16px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pcc-pagination .page-item .page-link:hover {
    background: var(--pecb-primary);
    color: #fff;
    border-color: var(--pecb-primary);
    transform: translateY(-2px);
}

.pcc-pagination .page-item.active .page-link {
    background: var(--pecb-primary);
    border-color: var(--pecb-primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 94, 184, 0.3);
}

/* ===================================
   Modal Styling
   =================================== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal-header {
    background: var(--pecb-primary);
    color: #fff;
    border-radius: 12px 12px 0 0;
    padding: 20px 25px;
}

.modal-title {
    font-weight: 700;
    font-size: 1.3rem;
    color: #ffffff;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 25px;
}

#modal-certifications-list {
    max-height: 500px;
    overflow-y: auto;
}

.modal-cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
	align-items: center;
}

.modal-cert-item {
    background: #e8f4fd;
    color: var(--pecb-primary);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid #c6e3f7;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: var(--pecb-secondary);
}

/* ===================================
   Responsive (Mobile & Tablet)
   =================================== */
@media (max-width: 1200px) {
    /* Slightly adjust card split on medium-large screens */
    .pecb-trainer-card .title { flex: 0 0 40%; }
}

@media (max-width: 992px) {
    /* Fallback to 1 row per card on tablets */
    .pcc-clients-grid { grid-template-columns: 1fr; }
    .pecb-trainer-card { flex-direction: row; }
    .pecb-trainer-card .title { flex: 0 0 35%; }
}

@media (max-width: 768px) {
    /* Convert the search form to vertical on small screens */
    .pcc-search-form .search-row { grid-template-columns: 1fr; }
    .search-actions { flex-direction: column; width: 100%; }
    .search-actions .btn { width: 100%; }

    /* Stack the card top-to-bottom on mobile */
    .pecb-trainer-card { flex-direction: column; }
    .pecb-trainer-card .title { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid var(--pecb-border); 
    }

    .pcc-pagination .pagination { flex-wrap: wrap; justify-content: center; }
}