/* ================================================
   Expert Finder Pro - Re-Defined Community Style
   Light Theme - Figma Design Match
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600&display=swap');

:root {
    --efp-bg: #FFFFFF;
    --efp-border: #EDEDED;
    --efp-border-card: rgba(216, 216, 216, 0.6);
    --efp-accent: #EE4A62;
    --efp-mentor-color: #FF0000;
    --efp-mentee-pink: #FF2D55;
    --efp-text-primary: #222222;
    --efp-text-secondary: #797676;
    --efp-text-dark: #000000;
    --efp-text-light: #4B4B4B;
}

/* Base Reset */
.efp-content-wrapper,
.efp-content-wrapper * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================================================
   MAIN CONTENT WRAPPER
   ================================================ */
.efp-content-wrapper {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 24px 0 40px;
    max-width: 1096px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ================================================
   HEADER ROW - Title + Filters
   ================================================ */
.efp-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

.efp-section-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #111111 !important;
    margin: 0;
    flex: 1;
    /* Takes available space */
}

/* ================================================
   FILTERS ROW - Inline Horizontal
   ================================================ */
.efp-filters-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    /* Pushes to the right */
    position: relative;
    z-index: 50;
    /* Ensure filters are on top of grid */
}

.efp-filter-dropdown {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    padding: 8px 16px;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 100px;
    transition: all 0.2s ease;
}

.efp-filter-dropdown:hover {
    border-color: var(--efp-accent);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.efp-filter-label {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 20px;
    color: var(--efp-text-dark);
}

.efp-filter-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.efp-filter-icon svg {
    width: 20px;
    height: 20px;
}

/* Dropdown Menu */
.efp-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #FFFFFF;
    border: 1px solid var(--efp-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.efp-filter-dropdown.open .efp-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.efp-dropdown-item {
    padding: 10px 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--efp-text-primary);
    cursor: pointer;
    transition: background 0.15s ease;
}

.efp-dropdown-item:hover {
    background: #F5F5F5;
}

.efp-dropdown-item.selected {
    background: #FEF2F3;
    color: var(--efp-accent);
    font-weight: 500;
}

/* ================================================
   PROFILE CARDS GRID
   ================================================ */
.efp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ================================================
   PROFILE CARD - Figma Style
   ================================================ */
.efp-card {
    background: var(--efp-bg);
    border: 1px solid #F0F0F0;
    /* Softer border */
    border-radius: 16px;
    /* More rounded */
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    /* structured height */
}

.efp-card:hover {
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-6px);
    border-color: transparent;
}

/* Top Color Stripe */
.efp-card-stripe {
    width: 100%;
    height: 4px;
    background: var(--efp-mentor-color);
}

.efp-card-stripe.mentee {
    background: var(--efp-mentee-pink);
}

/* Card Body */
.efp-card-body {
    padding: 24px 20px;
    /* More breathing room */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-grow: 1;
}

/* Profile Photo with Ring */
.efp-card-photo-wrapper {
    position: relative;
    margin-bottom: 4px;
}

.efp-card-photo-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--efp-mentor-color);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.efp-card-photo-ring.mentee {
    border-color: var(--efp-mentee-pink);
}

/* Decorative ring effect */
.efp-card-photo-ring::before {
    content: '';
    position: absolute;
    width: 80px;
    height: 80px;
    border: 1px solid var(--efp-mentor-color);
    border-radius: 50%;
    transform: rotate(-45deg);
    opacity: 0.5;
}

.efp-card-photo-ring.mentee::before {
    border-color: var(--efp-mentee-pink);
}

.efp-card-photo {
    width: 66px;
    height: 66px;
    border-radius: 50%;
    overflow: hidden;
    background: #F0F0F0;
}

.efp-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.efp-card-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #888;
    background: #E5E5E5;
}

/* Badge */
.efp-card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    background: var(--efp-mentor-color);
    border-radius: 3px;
    margin-bottom: 4px;
}

.efp-card-badge.mentee {
    background: var(--efp-mentee-pink);
}

.efp-card-badge span {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0.04px;
    color: #FFFFFF;
}

/* Card Info */
.efp-card-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    /* Larger name */
    line-height: 1.3;
    color: #111111 !important;
    /* Force distinct black */
    margin: 8px 0 4px 0;
}

.efp-card-role {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.6;
    color: #555555;
    /* Darker grey for better visibility */
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    /* Allow more text */
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* Removed min-height to allow natural flow */
}

/* Company Info inside Meta Left */
.efp-company-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    height: 24px;
    max-width: 100%;
    /* Prevent overflow */
    overflow: hidden;
}

.efp-company-logo {
    height: 22px !important;
    /* Strict fixed height */
    width: auto !important;
    max-width: 100px !important;
    /* Strict max width */
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    /* Prevent shrinking below visibility */
}

/* Meta Row (Split Layout) */
.efp-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: auto 0 16px 0;
    padding: 0 4px;
    height: 32px;
    /* Force a consistent row height */
}

.efp-meta-left {
    display: flex;
    align-items: center;
    max-width: 55%;
    height: 100%;
}

.efp-meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #797676;
    max-width: 45%;
    justify-content: flex-end;
    height: 100%;
}

.efp-company-name {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    /* Standardize font size */
    line-height: normal;
    /* Allow flex centering */
    color: #222222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-top: 2px;
    /* Visual optical alignment */
}

.efp-location-icon {
    color: #797676;
    /* Ensure icon matches text */
    flex-shrink: 0;
    margin-top: -1px;
    /* Optical alignment for icon */
}

/* Connect Button */
.efp-card-button {
    width: 100%;
    max-width: 168px;
    height: 32px;
    background: var(--efp-accent);
    border: none;
    border-radius: 100px;
    font-family: 'Roboto', 'Inter', sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 32px;
    letter-spacing: 0.25px;
    color: #FFFFFF !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(238, 74, 98, 0.2);
}

.efp-card-button:hover {
    background: #D43b52;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 74, 98, 0.3);
    color: #FFFFFF;
}

/* ================================================
   LOADING SKELETON
   ================================================ */
.efp-loading {
    display: contents;
}

.efp-skeleton-card {
    background: var(--efp-bg);
    border: 1px solid var(--efp-border-card);
    border-radius: 8px;
    overflow: hidden;
}

.efp-skeleton-stripe {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #E0E0E0 0%, #F0F0F0 50%, #E0E0E0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.efp-skeleton-body {
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.efp-skeleton-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(90deg, #E0E0E0 0%, #F0F0F0 50%, #E0E0E0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 8px;
}

.efp-skeleton-badge {
    width: 60px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(90deg, #E0E0E0 0%, #F0F0F0 50%, #E0E0E0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 8px;
}

.efp-skeleton-name {
    width: 120px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(90deg, #E0E0E0 0%, #F0F0F0 50%, #E0E0E0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 4px;
}

.efp-skeleton-role {
    width: 150px;
    height: 36px;
    border-radius: 4px;
    background: linear-gradient(90deg, #E0E0E0 0%, #F0F0F0 50%, #E0E0E0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 12px;
}

.efp-skeleton-button {
    width: 140px;
    height: 26px;
    border-radius: 100px;
    background: linear-gradient(90deg, #E0E0E0 0%, #F0F0F0 50%, #E0E0E0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ================================================
   NO RESULTS
   ================================================ */
.efp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--efp-text-secondary);
}

.efp-no-results h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: var(--efp-text-primary);
    margin-bottom: 8px;
}

.efp-no-results p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

/* ================================================
   PAGINATION
   ================================================ */
.efp-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 16px 0;
    font-family: 'Inter', sans-serif;
}

.efp-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.efp-page-num {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--efp-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.efp-page-num:hover {
    border-color: var(--efp-accent);
    color: var(--efp-accent);
    background: #FEF2F3;
}

.efp-page-num.active {
    background: var(--efp-accent);
    border-color: var(--efp-accent);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(238, 74, 98, 0.25);
}

.efp-page-ellipsis {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--efp-text-secondary);
    letter-spacing: 2px;
}

.efp-page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    height: 40px;
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    background: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--efp-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.efp-page-btn:hover:not(.disabled) {
    border-color: var(--efp-accent);
    color: var(--efp-accent);
    background: #FEF2F3;
}

.efp-page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.efp-page-btn svg {
    flex-shrink: 0;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

/* 3 columns */
@media (max-width: 1200px) {
    .efp-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 columns + stacked filters */
@media (max-width: 900px) {
    .efp-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .efp-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .efp-filters-row {
        margin-left: 0;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
    }
}

/* 2 columns */
@media (max-width: 700px) {
    .efp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .efp-content-wrapper {
        padding: 16px 20px 32px;
        border-radius: 12px;
    }

    .efp-section-title {
        font-size: 18px;
    }

    .efp-filters-row {
        gap: 12px;
    }

    .efp-filter-dropdown {
        gap: 8px;
    }

    .efp-filter-label {
        font-size: 13px;
    }
}

/* Pagination responsive */
@media (max-width: 700px) {
    .efp-pagination {
        gap: 4px;
    }

    .efp-page-btn {
        padding: 6px 10px;
        font-size: 13px;
    }

    .efp-page-num {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }
}

/* 1 column (mobile) */
@media (max-width: 480px) {
    .efp-grid {
        grid-template-columns: 1fr;
        max-width: 220px;
        margin: 0 auto;
    }

    .efp-content-wrapper {
        padding: 12px 16px 24px;
    }

    .efp-filters-row {
        width: 100%;
        justify-content: space-between;
    }

    .efp-filter-label {
        font-size: 12px;
    }

    .efp-filter-icon {
        width: 16px;
        height: 16px;
    }

    .efp-filter-icon svg {
        width: 16px;
        height: 16px;
    }
}