/* ===========================
   Member Directory Styles
   =========================== */

.members-section {
    padding: 4rem 0;
    background: #f5f7fa;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-item {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.stat-item strong {
    display: block;
    font-size: 1.75rem;
    color: var(--dark-color);
}

.stat-item span {
    display: block;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Search and Filter Section */
.search-filter-section {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

.search-bar-large {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-bar-large i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.25rem;
}

.search-bar-large input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 4rem;
    border: 2px solid #e1e8ed;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: var(--transition);
}

.search-bar-large input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-weight: 500;
    font-size: 0.9rem;
}

.filter-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Members Grid */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.members-grid.list-view {
    grid-template-columns: 1fr;
}

.member-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.members-grid.list-view .member-card {
    flex-direction: row;
    align-items: center;
}

.member-avatar {
    position: relative;
    padding: 2rem 2rem 0;
    text-align: center;
}

.members-grid.list-view .member-avatar {
    padding: 1.5rem;
    flex-shrink: 0;
}

.member-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #f8f9fa;
}

.members-grid.list-view .member-avatar img {
    width: 80px;
    height: 80px;
}

.verified-badge {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: #27ae60;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.members-grid.list-view .verified-badge {
    top: 1.5rem;
    right: auto;
    left: 5.5rem;
}

.member-info {
    padding: 1.5rem 2rem;
    text-align: center;
    flex: 1;
}

.members-grid.list-view .member-info {
    text-align: left;
    padding: 1.5rem;
}

.member-info h3 {
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
}

.member-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.member-company {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.member-meta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-color);
}

.members-grid.list-view .member-meta {
    justify-content: flex-start;
}

.member-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.member-meta i {
    color: var(--primary-color);
}

.member-specializations {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1rem;
}

.members-grid.list-view .member-specializations {
    justify-content: flex-start;
}

.spec-tag {
    padding: 0.4rem 0.8rem;
    background: #e8f4f8;
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.member-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #e1e8ed;
}

.members-grid.list-view .member-stats {
    justify-content: flex-start;
    border-top: none;
    padding: 0.5rem 0 0;
}

.member-stats .stat {
    text-align: center;
}

.member-stats strong {
    display: block;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.member-stats span {
    font-size: 0.85rem;
    color: var(--text-light);
}

.member-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid #e1e8ed;
    display: flex;
    gap: 1rem;
}

.members-grid.list-view .member-actions {
    flex-direction: column;
    padding: 1.5rem;
    border-top: none;
    border-left: 1px solid #e1e8ed;
    flex-shrink: 0;
}

.member-actions .btn {
    flex: 1;
    justify-content: center;
}

.members-grid.list-view .member-actions .btn {
    width: 150px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.page-btn {
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

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

/* Profile Modal */
.profile-content {
    padding: 2rem;
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e1e8ed;
}

.profile-avatar-large img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-header-info {
    flex: 1;
}

.profile-header-info h2 {
    font-size: 2rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.profile-header-info p {
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.profile-contact {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.profile-contact a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.profile-contact a:hover {
    text-decoration: underline;
}

.profile-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e1e8ed;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 1rem 2rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.tab-pane h4 {
    color: var(--dark-color);
    margin: 1.5rem 0 1rem;
}

.tab-pane h4:first-child {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .members-grid {
        grid-template-columns: 1fr;
    }

    .members-grid.list-view .member-card {
        flex-direction: column;
    }

    .members-grid.list-view .member-avatar {
        padding: 2rem 2rem 0;
    }

    .members-grid.list-view .member-avatar img {
        width: 120px;
        height: 120px;
    }

    .members-grid.list-view .verified-badge {
        top: 2rem;
        left: auto;
        right: 2rem;
    }

    .members-grid.list-view .member-info {
        text-align: center;
        padding: 1.5rem 2rem;
    }

    .members-grid.list-view .member-meta {
        justify-content: center;
    }

    .members-grid.list-view .member-specializations {
        justify-content: center;
    }

    .members-grid.list-view .member-stats {
        justify-content: center;
        border-top: 1px solid #e1e8ed;
        padding: 1rem 0;
    }

    .members-grid.list-view .member-actions {
        flex-direction: row;
        border-left: none;
        border-top: 1px solid #e1e8ed;
        padding: 1.5rem 2rem;
    }

    .members-grid.list-view .member-actions .btn {
        width: auto;
        flex: 1;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-contact {
        flex-direction: column;
        align-items: center;
    }

    .pagination {
        flex-wrap: wrap;
    }
}
